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,153 +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);
481
+ liveCB.setToolTipText("Enabled animation");
441482 liveCB.addItemListener(this);
442483
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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);
489
+ fastCB.setToolTipText("Fast mode");
461490 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
491
+
492
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
493
+ trackCB.setToolTipText("Enable tracking");
503494 trackCB.addItemListener(this);
504495
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
496
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
497
+ screenfitButton.setToolTipText("Screen fit");
507498 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
499
+
509500 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510501 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515502
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
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);
511
+ flashSelectionButton.setToolTipText("Show selection");
522512 flashSelectionButton.addActionListener(this);
523513
524
- oe.toolbarPanel.add(new cButton(" ", false));
514
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525515
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
516
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
517
+ twoButton.setToolTipText("Show center view only");
532518 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
519
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534520 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
521
+ fourButton.setToolTipText("Show left panel only");
522
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523
+ sixButton.setToolTipText("2-column layout left");
536524 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
525
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
526
+ threeButton.setToolTipText("2-column layout right");
538527 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
528
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
529
+ sevenButton.setToolTipText("3-column layout");
540530 sevenButton.addActionListener(this);
541531 //
542532
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
533
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
+ rootButton.setToolTipText("Edit selection in new tab");
544535 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
536
+
537
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
538
+ closeButton.setToolTipText("Close tab");
547539 closeButton.addActionListener(this);
548540 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549541 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551542
552
- oe.aConstraints.gridx = 1; //
553
- 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");
554547 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558548
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
549
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
550
+ uneditButton.setToolTipText("Unedit selection");
560551 uneditButton.addActionListener(this);
561552
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
553
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
554
+ allParamsButton.setToolTipText("Edit all params");
574555 allParamsButton.addActionListener(this);
575556
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
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");
581563 unselectButton.addActionListener(this);
582564
565
+ commandsPanel.preferredHeight = 1;
566
+
567
+ oe.treePanel.add(commandsPanel);
568
+ oe.treePanel.Return();
569
+
583570 // oe.aConstraints.gridx += 1;
584571 // oe.aConstraints.weighty = 0;
585572 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +578,37 @@
591578 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592579 // gcButton.addActionListener(this);
593580
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
581
+ cGridBag jSPPanel = new cGridBag();
582
+
583
+ JScrollPane jSP;
605584 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
585
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607586 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
587
+
588
+ oe.treePanel.add(jSPPanel);
589
+ oe.treePanel.Return();
612590
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
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");
617595 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620599 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- 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");
623603 textureCB.addItemListener(this);
624604
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
605
+ copyOptionsPanel.preferredHeight = 1;
606
+ oe.treePanel.add(copyOptionsPanel);
607
+ oe.treePanel.Return();
627608
609
+// mainPanel.setDividerLocation(0.5); //1.0);
610
+// mainPanel.setResizeWeight(0.5);
611
+
628612 //jList.addListSelectionListener(this);
629613 oe.jTree.addTreeSelectionListener(this);
630614 //jTree.setRootVisible(false);
....@@ -646,6 +630,78 @@
646630 radio.layout = sevenButton;
647631 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648632 }
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
+ }
649705
650706 void EditObject(Object3D obj)
651707 {
....@@ -676,6 +732,7 @@
676732 JCheckBox fastCB;
677733 JCheckBox slowCB;
678734 JCheckBox boxCB;
735
+ JCheckBox zoomBoxCB;
679736 JCheckBox trackCB;
680737 JCheckBox smoothfocusCB;
681738 // JCheckBox speakerMocapCB;
....@@ -755,6 +812,10 @@
755812 Recompile();
756813 cameraView.repaint();
757814 // refreshContents();
815
+ }
816
+ else if(e.getSource() == zoomBoxCB)
817
+ {
818
+ cameraView.ToggleZoomBoxMode();
758819 }
759820 else if(e.getSource() == smoothfocusCB)
760821 {
....@@ -923,11 +984,11 @@
923984 {
924985 loadClipboard(true);
925986 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
987
+ pasteInto(false, false);
927988 } else {
928989 loadClipboard(false);
929990 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
991
+ pasteInto(false, false); // true); // ???
931992 }
932993 }
933994 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1110,33 @@
10491110 kleinItem.addActionListener(this);
10501111 particleItem = menu.add(new MenuItem("Particle system"));
10511112 particleItem.addActionListener(this);
1113
+ if (Globals.ADVANCED)
1114
+ {
10521115 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531116 ragdollItem.addActionListener(this);
10541117 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551118 ragdoll2Item.addActionListener(this);
1119
+ }
10561120 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1121
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581122 meshItem.addActionListener(this);
10591123 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601124 // meshGroupItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10611127 springItem = menu.add(new MenuItem("Spring"));
10621128 springItem.addActionListener(this);
10631129 flagItem = menu.add(new MenuItem("Flag"));
10641130 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691131 blobItem = menu.add(new MenuItem("Blob"));
10701132 blobItem.addActionListener(this);
10711133 latheItem = menu.add(new MenuItem("Lathe"));
10721134 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);
10731140 lightItem = menu.add(new MenuItem("Light"));
10741141 lightItem.addActionListener(this);
10751142 menu.add("-");
....@@ -1079,25 +1146,26 @@
10791146 loopItem.addActionListener(this);
10801147 doubleItem = menu.add(new MenuItem("Fork"));
10811148 doubleItem.addActionListener(this);
1149
+ if (Globals.ADVANCED)
1150
+ {
10821151 tripleItem = menu.add(new MenuItem("Trident"));
10831152 tripleItem.addActionListener(this);
1153
+ }
10841154 }
10851155
10861156 void buildToolsMenu(Menu menu)
10871157 {
10881158 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891159 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1160
+ animationItem.setState(Globals.ANIMATION);
10911161
10921162 menu.add("-");
10931163 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941164 parseverticesItem.addActionListener(this);
10951165 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961166 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1167
+ alignItem = menu.add(new MenuItem("Align Object"));
10981168 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011169 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021170 reduceMorphItem.addActionListener(this);
11031171 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
....@@ -1105,8 +1173,12 @@
11051173
11061174 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071175 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091176
1177
+ if (Globals.ADVANCED)
1178
+ {
1179
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1180
+ mirrorItem.addActionListener(this);
1181
+ menu.add("-");
11101182 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111183 memoryItem.addActionListener(this);
11121184 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1129,6 +1201,7 @@
11291201 menu.add("-");
11301202 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311203 editScriptItem.addActionListener(this);
1204
+ }
11321205 }
11331206
11341207 void ScreenFit()
....@@ -1482,6 +1555,7 @@
14821555 //
14831556 public void actionPerformed(ActionEvent event) // , Object arg)
14841557 {
1558
+ Object source = event.getSource();
14851559 /*
14861560 if (event.getSource() == nameField)
14871561 {
....@@ -1493,11 +1567,11 @@
14931567 }
14941568 else
14951569 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1570
+ if (source == lookAtItem || source == lookFromItem)
14971571 {
14981572 ScreenFit();
14991573 } else
1500
- if (event.getSource() == switchItem)
1574
+ if (source == switchItem)
15011575 {
15021576 cVector v1 = new cVector();
15031577 cVector v2 = new cVector();
....@@ -1506,11 +1580,11 @@
15061580 objEditor.cameraView.renderCamera.setAim(v2, v1);
15071581 objEditor.cameraView.repaint();
15081582 } else
1509
- if (event.getSource() == rectoidItem)
1583
+ if (source == rectoidItem)
15101584 {
15111585 makeSomething(new Box());
15121586 } else
1513
- if (event.getSource() == particleItem)
1587
+ if (source == particleItem)
15141588 {
15151589 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15161590 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +1605,9 @@
15311605 applyExample(particleGeom, "SMOKE");
15321606 makeSomething(particleGeom);
15331607 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1608
+ if (source == ragdollItem || source == ragdoll2Item)
15351609 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1610
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15371611
15381612 ragdoll.toParent = LA.newMatrix();
15391613 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +1625,7 @@
15511625 } else
15521626 /*
15531627 */
1554
- if (event.getSource() == heightFieldItem)
1628
+ if (source == heightFieldItem)
15551629 {
15561630 Object3D obj = new Object3D();
15571631
....@@ -1589,31 +1663,31 @@
15891663
15901664 makeSomething(obj);
15911665 } else
1592
- if (event.getSource() == gridItem)
1666
+ if (source == gridItem)
15931667 {
15941668 makeSomething(new Grid());
15951669 } else
1596
- if (event.getSource() == ellipsoidItem)
1670
+ if (source == ellipsoidItem)
15971671 {
15981672 makeSomething(new Sphere());
15991673 } else
1600
- if (event.getSource() == coneItem)
1674
+ if (source == coneItem)
16011675 {
16021676 makeSomething(new Cone());
16031677 } else
1604
- if (event.getSource() == torusItem)
1678
+ if (source == torusItem)
16051679 {
16061680 makeSomething(new Torus());
16071681 } else
1608
- if (event.getSource() == superItem)
1682
+ if (source == superItem)
16091683 {
16101684 makeSomething(new Superellipsoid());
16111685 } else
1612
- if (event.getSource() == kleinItem)
1686
+ if (source == kleinItem)
16131687 {
16141688 makeSomething(new Klein());
16151689 } else
1616
- if (event.getSource() == blobItem)
1690
+ if (source == blobItem)
16171691 {
16181692 Blob blob = new Blob();
16191693 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +1695,15 @@
16211695 //blob.retile();
16221696 makeSomething(blob);
16231697 } else
1624
- if (event.getSource() == latheItem)
1698
+ if (source == latheItem)
16251699 {
16261700 makeSomething(new Lathe());
16271701 } else
1628
- if (event.getSource() == bezierItem)
1702
+ if (source == bezierItem)
16291703 {
16301704 makeSomething(new BezierSurface());
16311705 } else
1632
- if (event.getSource() == checkerItem)
1706
+ if (source == overlayItem)
16331707 {
16341708 /*
16351709 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +1718,7 @@
16441718 */
16451719 makeSomething(new Checker());
16461720 } else
1647
- if (event.getSource() == meshItem)
1721
+ if (source == meshItem)
16481722 {
16491723 Object3D itemtomake = new Object3D();
16501724 Object3D child;
....@@ -1665,35 +1739,35 @@
16651739 makeSomething(child);
16661740 }
16671741 } else
1668
- if (event.getSource() == springItem)
1742
+ if (source == springItem)
16691743 {
16701744 cSpring s = new cSpring();
16711745 s.setup();
16721746 makeSomething(s);
16731747 } else
1674
- if (event.getSource() == flagItem)
1748
+ if (source == flagItem)
16751749 {
16761750 cSpring s = new cFlag();
16771751 s.setup();
16781752 makeSomething(s);
16791753 } else
1680
- if (event.getSource() == lightItem)
1754
+ if (source == lightItem)
16811755 {
16821756 makeSomething(new Light());
16831757 } else
1684
- if (event.getSource() == csgItem)
1758
+ if (source == csgItem)
16851759 {
16861760 group(new CSG());
16871761 } else
1688
- if (event.getSource() == templateItem)
1762
+ if (source == templateItem)
16891763 {
16901764 group(new cTemplate());
16911765 } else
1692
- if (event.getSource() == attributeItem)
1766
+ if (source == attributeItem)
16931767 {
16941768 makeSomething(new Attribute());
16951769 } else
1696
- if (event.getSource() == pointflowItem)
1770
+ if (source == pointflowItem)
16971771 {
16981772 makeSomething(new PointFlow());
16991773 } else
....@@ -1705,7 +1779,7 @@
17051779 } else
17061780 */
17071781
1708
- if (event.getSource() == superLoopItem)
1782
+ if (source == superLoopItem)
17091783 {
17101784 Composite g = new cGroup();
17111785 for (int i=0; i<15; i++)
....@@ -1727,7 +1801,7 @@
17271801
17281802 group(g);
17291803 } else
1730
- if (event.getSource() == loopItem)
1804
+ if (source == loopItem)
17311805 {
17321806 Composite csg = new GroupLeaf();
17331807 csg.count = 5;
....@@ -1736,7 +1810,7 @@
17361810 csg.addChild(child);
17371811 child.addChild(csg);
17381812 } else
1739
- if (event.getSource() == doubleItem)
1813
+ if (source == doubleItem)
17401814 {
17411815 Composite csg = new GroupLeaf();
17421816 csg.count = 5;
....@@ -1748,7 +1822,7 @@
17481822 csg.addChild(child);
17491823 child.addChild(csg);
17501824 } else
1751
- if (event.getSource() == tripleItem)
1825
+ if (source == tripleItem)
17521826 {
17531827 Composite csg = new GroupLeaf();
17541828 csg.count = 4;
....@@ -1764,70 +1838,75 @@
17641838 child.addChild(csg);
17651839 } else
17661840
1767
- if (event.getSource() == importGFDItem)
1841
+ if (source == importGFDItem)
17681842 {
17691843 ImportGFD();
17701844 } else
1771
- if (event.getSource() == importVRMLX3DItem)
1845
+ if (source == importVRMLX3DItem)
17721846 {
17731847 ImportVRMLX3D();
17741848 } else
1775
- if (event.getSource() == import3DSItem)
1849
+ if (source == import3DSItem)
17761850 {
17771851 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17781852 } else
1779
- if (event.getSource() == importOBJItem)
1853
+ if (source == importOBJItem)
17801854 {
17811855 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17821856 } else
1783
- if (event.getSource() == computeAOItem)
1857
+ if (source == computeAOItem)
17841858 {
17851859 Globals.drawMode = CameraPane.OCCLUSION;
17861860 Globals.theRenderer.repaint();
17871861 } else
1788
- if (event.getSource() == recompileItem)
1862
+ if (source == recompileItem)
17891863 {
17901864 Recompile();
17911865 refreshContents();
17921866 } else
1793
- if (event.getSource() == editScriptItem)
1867
+ if (source == editScriptItem)
17941868 {
17951869 OpenDialog();
17961870 refreshContents();
17971871 } else
1798
- if (event.getSource() == invariantsItem)
1872
+ if (source == invariantsItem)
17991873 {
18001874 System.out.println("Invariants:");
18011875 GrafreeD.grafreeD.universe.invariants();
18021876 } else
1803
- if (event.getSource() == memoryItem)
1877
+ if (source == memoryItem)
18041878 {
18051879 //System.out.println("Invariants:");
18061880 PrintMemory();
18071881 } else
1808
- if (event.getSource() == pathItem)
1882
+ if (source == pathItem)
18091883 {
18101884 PrintPath();
18111885 } else
1812
- if (event.getSource() == analyzeItem)
1886
+ if (source == analyzeItem)
18131887 {
18141888 AnalyzeObject();
18151889 } else
1816
- if (event.getSource() == dumpItem)
1890
+ if (source == dumpItem)
18171891 {
18181892 DumpObject();
18191893 } else
1820
- if (event.getSource() == screenfitButton)
1894
+ if (source == oneStepButton)
1895
+ {
1896
+ Globals.ONESTEP = true;
1897
+ cameraView.repaint();
1898
+ } else
1899
+ if (source == screenfitButton)
18211900 {
18221901 //Reload(lastConverter, lastFilename, true);
18231902 ScreenFit();
18241903 } else
1825
- if (event.getSource() == screenfitpointButton)
1904
+ if (source == screenfitpointButton)
18261905 {
18271906 //Reload(lastConverter, lastFilename, true);
18281907 ScreenFitPoint();
18291908 } else
1830
- if (event.getSource() == snapobjectButton)
1909
+ if (source == snapobjectButton)
18311910 {
18321911 //Reload(lastConverter, lastFilename, true);
18331912 SnapObject();
....@@ -1838,13 +1917,13 @@
18381917 // Recompile();
18391918 // refreshContents();
18401919 // } else
1841
- if (event.getSource() == gcButton)
1920
+ if (source == gcButton)
18421921 {
18431922 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441923 System.gc();
18451924 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18461925 } else
1847
- if (event.getSource() == editLeafItem)
1926
+ if (source == editLeafItem)
18481927 {
18491928 Object3D obj;
18501929 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +1937,66 @@
18581937 }
18591938 refreshContents(true);
18601939 } else
1861
- if (event.getSource() == openWindowItem)
1940
+ if (source == openWindowItem)
18621941 {
18631942 EditSelection(true);
18641943 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1944
+ if (source == cutItem || source == clearButton)
18661945 {
18671946 loadClipboard(true);
18681947 } else
1869
- if (event.getSource() == duplicateItem)
1948
+ if (source == duplicateItem)
18701949 {
18711950 Object3D keep = GrafreeD.clipboard;
18721951 loadClipboard(false);
18731952 paste(false);
18741953 GrafreeD.clipboard = keep;
18751954 } else
1876
- if (event.getSource() == cloneItem)
1955
+ if (source == cloneItem)
18771956 {
18781957 CloneSelection(false);
18791958 } else
1880
- if (event.getSource() == cloneSupportItem)
1959
+ if (source == cloneSupportItem)
18811960 {
18821961 CloneSelection(true);
18831962 } else
1884
- if (event.getSource() == copyItem)
1963
+ if (source == copyItem)
18851964 {
18861965 loadClipboard(false);
18871966 } else
1888
- if (event.getSource() == pasteItem)
1967
+ if (source == pasteItem)
18891968 {
18901969 paste(false);
18911970 } else
1892
- if (event.getSource() == pasteLinkItem)
1971
+ if (source == pasteIntoItem)
18931972 {
1894
- pasteInto(false);
1973
+ pasteInto(true, false);
18951974 } else
1896
- if (event.getSource() == pasteCloneItem)
1975
+ if (source == pasteLinkItem)
18971976 {
1898
- pasteInto(true);
1977
+ pasteInto(false, false);
18991978 } else
1900
- if (event.getSource() == pasteExpandItem)
1979
+ if (source == pasteCloneItem)
1980
+ {
1981
+ pasteInto(true, true);
1982
+ } else
1983
+ if (source == pasteExpandItem)
19011984 {
19021985 paste(true);
19031986 } else
1904
- if (event.getSource() == synchronizeItem)
1987
+ if (source == synchronizeItem)
19051988 {
19061989 Overwrite(Object3D.TRANSFORM);
19071990 } else
1908
- if (event.getSource() == overwriteNameItem)
1991
+ if (source == overwriteNameItem)
19091992 {
19101993 Overwrite(Object3D.NAME);
19111994 } else
1912
- if (event.getSource() == overwriteUVItem)
1995
+ if (source == overwriteUVItem)
19131996 {
19141997 Overwrite(Object3D.UV);
19151998 } else
1916
- if (event.getSource() == overwriteMatItem)
1999
+ if (source == overwriteMatItem)
19172000 {
19182001 /* july 2015
19192002 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2016,7 @@
19332016
19342017 Overwrite(dropAttributes);
19352018 }
1936
- if (event.getSource() == overwriteGeoItem)
2019
+ if (source == overwriteGeoItem)
19372020 {
19382021 Overwrite(Object3D.GEOMETRY);
19392022 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2033,7 @@
19502033 // refreshContents();
19512034 // }
19522035 } else
1953
- if (event.getSource() == generateMeshItem)
2036
+ if (source == generateMeshItem)
19542037 {
19552038 //if (group.selection.size() == 1)
19562039 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2044,7 @@
19612044 ResetModel();
19622045 refreshContents();
19632046 } else
1964
- if (event.getSource() == extractGeometriesItem)
2047
+ if (source == extractGeometriesItem)
19652048 {
19662049 boolean one = false;
19672050
....@@ -1988,7 +2071,7 @@
19882071 ResetModel();
19892072 refreshContents();
19902073 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2074
+ if (source == cloneGeometriesItem)
19922075 {
19932076 boolean one = false;
19942077
....@@ -2014,7 +2097,7 @@
20142097 ResetModel();
20152098 refreshContents();
20162099 } else
2017
- if (event.getSource() == shareGeometriesItem)
2100
+ if (source == shareGeometriesItem)
20182101 {
20192102 boolean one = false;
20202103
....@@ -2044,7 +2127,7 @@
20442127 refreshContents();
20452128 }
20462129 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2130
+ if (source == mergeGeometriesItem)
20482131 {
20492132 boolean one = false;
20502133
....@@ -2074,7 +2157,7 @@
20742157 ResetModel();
20752158 refreshContents();
20762159 } else
2077
- if (event.getSource() == linkverticesItem)
2160
+ if (source == linkverticesItem)
20782161 {
20792162 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802163 // {
....@@ -2097,38 +2180,38 @@
20972180 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982181 for (int i=0; i<group.selection.size(); i++)
20992182 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2183
+ boolean random = CameraPane.SWITCH;
2184
+ CameraPane.SWITCH = false; // parse all random nodes
21022185 group.selection.get(i).linkVerticesThis(content);
21032186 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2187
+ CameraPane.SWITCH = random;
21052188 }
21062189 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072190 refreshContents();
21082191 }
21092192 } else
2110
- if (event.getSource() == resetsupportItem)
2193
+ if (source == resetsupportItem)
21112194 {
21122195 for (int i=0; i<group.selection.size(); i++)
21132196 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2197
+ boolean random = CameraPane.SWITCH;
2198
+ CameraPane.SWITCH = false; // parse all random nodes
21162199 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2200
+ CameraPane.SWITCH = random;
21182201 }
21192202
21202203 refreshContents();
21212204 } else
2122
- if (event.getSource() == relinkverticesItem)
2205
+ if (source == relinkverticesItem)
21232206 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2207
+ boolean random = CameraPane.SWITCH;
2208
+ CameraPane.SWITCH = false; // parse all random nodes
21262209 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2210
+ CameraPane.SWITCH = random;
21282211
21292212 refreshContents();
21302213 } else
2131
- if (event.getSource() == resetreferencesItem)
2214
+ if (source == resetreferencesItem)
21322215 {
21332216 for (int i=0; i<group.selection.size(); i++)
21342217 {
....@@ -2137,7 +2220,7 @@
21372220
21382221 refreshContents();
21392222 } else
2140
- if (event.getSource() == setMasterItem)
2223
+ if (source == setMasterItem)
21412224 {
21422225 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21432226 {
....@@ -2150,7 +2233,7 @@
21502233 refreshContents();
21512234 }
21522235 } else
2153
- if (event.getSource() == poseMeshItem)
2236
+ if (source == poseMeshItem)
21542237 {
21552238 if (group.selection.size() == 1)
21562239 {
....@@ -2169,19 +2252,19 @@
21692252 }
21702253
21712254 } else
2172
- if (event.getSource() == revertMeshItem)
2255
+ if (source == revertMeshItem)
21732256 {
21742257 RevertMeshes();
21752258 } else
2176
- if (event.getSource() == resetMeshItem)
2259
+ if (source == resetMeshItem)
21772260 {
21782261 ResetAll();
21792262 } else
2180
- if (event.getSource() == stepAllItem)
2263
+ if (source == stepAllItem)
21812264 {
21822265 StepAll();
21832266 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2267
+ if (source == clearItem) // || event.getSource() == clearButton)
21852268 {
21862269 //int indices[] = jList.getSelectedIndices();
21872270 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2272,46 @@
21892272
21902273 ClearSelection(false);
21912274 } else
2192
- if (event.getSource() == clearAllItem)
2275
+ if (source == clearAllItem)
21932276 {
21942277 ClearSelection(true);
21952278 } else
2196
- if (event.getSource() == grabItem)
2279
+ if (source == grabItem)
21972280 {
21982281 group(new cGroup(), true);
21992282 } else
2200
- if (event.getSource() == hideItem)
2283
+ if (source == hideItem)
22012284 {
22022285 group(new HiddenObject());
22032286 } else
2204
- if (event.getSource() == frontItem)
2287
+ if (source == frontItem)
22052288 {
22062289 front();
22072290 } else
2208
- if (event.getSource() == backItem)
2291
+ if (source == backItem)
22092292 {
22102293 back();
22112294 } else
2212
- if (event.getSource() == cameraItem)
2295
+ if (source == cameraItem)
22132296 {
22142297 makeSomething(new Camera());
22152298 } else
2216
- if (event.getSource() == compositeItem)
2299
+ if (source == compositeItem)
22172300 {
22182301 group(new Composite());
22192302 } else
2220
- if (event.getSource() == randomItem)
2303
+ if (source == randomItem)
22212304 {
22222305 RandomNode random = new RandomNode();
22232306 group(random);
22242307 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
2308
+ random.name = random.get(0).name + "Switch";
22262309 } else
2227
- if (event.getSource() == physicsItem)
2310
+ if (source == physicsItem)
22282311 {
22292312 group(new PhysicsNode());
22302313 } else
2231
- if (event.getSource() == frameselectorItem)
2314
+ if (source == frameselectorItem)
22322315 {
22332316 for (int i=0; i<group.selection.size(); i++)
22342317 {
....@@ -2240,7 +2323,7 @@
22402323 ResetModel();
22412324 refreshContents();
22422325 } else
2243
- if (event.getSource() == switchGeoItem)
2326
+ if (source == switchGeoItem)
22442327 {
22452328 for (int i=0; i<group.selection.size(); i++)
22462329 {
....@@ -2252,7 +2335,7 @@
22522335 ResetModel();
22532336 refreshContents();
22542337 } else
2255
- if (event.getSource() == switchTransfoItem)
2338
+ if (source == switchTransfoItem)
22562339 {
22572340 for (int i=0; i<group.selection.size(); i++)
22582341 {
....@@ -2264,7 +2347,7 @@
22642347 ResetModel();
22652348 refreshContents();
22662349 } else
2267
- if (event.getSource() == morphItem)
2350
+ if (source == morphItem)
22682351 {
22692352 for (int i=0; i<group.selection.size(); i++)
22702353 {
....@@ -2276,7 +2359,7 @@
22762359 ResetModel();
22772360 refreshContents();
22782361 } else
2279
- if (event.getSource() == scriptNodeItem)
2362
+ if (source == scriptNodeItem)
22802363 {
22812364 boolean atleastone = false;
22822365
....@@ -2315,31 +2398,31 @@
23152398 }
23162399 }
23172400 } else
2318
- if (event.getSource() == linkerItem)
2401
+ if (source == linkerItem)
23192402 {
23202403 group(new cLinker());
23212404 } else
2322
- if (event.getSource() == textureItem)
2405
+ if (source == textureItem)
23232406 {
23242407 group(new TextureNode());
23252408 } else
2326
- if (event.getSource() == billboardItem)
2409
+ if (source == billboardItem)
23272410 {
23282411 group(new BillboardNode());
23292412 } else
2330
- if (event.getSource() == shadowXItem)
2413
+ if (source == shadowXItem)
23312414 {
23322415 CastShadow(0);
23332416 } else
2334
- if (event.getSource() == shadowYItem)
2417
+ if (source == shadowYItem)
23352418 {
23362419 CastShadow(1);
23372420 } else
2338
- if (event.getSource() == shadowZItem)
2421
+ if (source == shadowZItem)
23392422 {
23402423 CastShadow(2);
23412424 } else
2342
- if (event.getSource() == ungroupItem)
2425
+ if (source == ungroupItem)
23432426 {
23442427 //ungroup();
23452428 for (int i=0; i<group.selection.size(); i++)
....@@ -2351,179 +2434,179 @@
23512434
23522435 refreshContents();
23532436 } else
2354
- if (event.getSource() == genUVItem)
2437
+ if (source == genUVItem)
23552438 {
23562439 GenUV();
23572440 } else
2358
- if (event.getSource() == genNormalsCADItem)
2441
+ if (source == genNormalsCADItem)
23592442 {
23602443 GenNormals(true);
23612444 } else
2362
- if (event.getSource() == genNormalsMESHItem)
2445
+ if (source == genNormalsMESHItem)
23632446 {
23642447 GenNormals(true); // TODO
23652448 } else
2366
- if (event.getSource() == genNormalsORGANItem)
2449
+ if (source == genNormalsORGANItem)
23672450 {
23682451 GenNormals(false);
23692452 } else
2370
- if (event.getSource() == genNormalsMINEItem)
2453
+ if (source == genNormalsMINEItem)
23712454 {
23722455 GenNormalsMINE();
23732456 } else
2374
- if (event.getSource() == stripifyItem)
2457
+ if (source == stripifyItem)
23752458 {
23762459 Stripify();
23772460 } else
2378
- if (event.getSource() == unstripifyItem)
2461
+ if (source == unstripifyItem)
23792462 {
23802463 Unstripify();
23812464 } else
2382
- if (event.getSource() == trimItem)
2465
+ if (source == trimItem)
23832466 {
23842467 Trim();
23852468 } else
2386
- if (event.getSource() == untrimItem)
2469
+ if (source == untrimItem)
23872470 {
23882471 Untrim();
23892472 } else
2390
- if (event.getSource() == clearColorsItem)
2473
+ if (source == clearColorsItem)
23912474 {
23922475 ClearColors();
23932476 } else
2394
- if (event.getSource() == clearMaterialsItem)
2477
+ if (source == clearMaterialsItem)
23952478 {
23962479 ClearMaterials();
23972480 } else
2398
- if (event.getSource() == liveleavesItem)
2481
+ if (source == liveleavesItem)
23992482 {
24002483 LiveLeaves(true);
24012484 } else
2402
- if (event.getSource() == unliveleavesItem)
2485
+ if (source == unliveleavesItem)
24032486 {
24042487 LiveLeaves(false);
24052488 } else
2406
- if (event.getSource() == supportleavesItem)
2489
+ if (source == supportleavesItem)
24072490 {
24082491 SupportLeaves(true);
24092492 } else
2410
- if (event.getSource() == unsupportleavesItem)
2493
+ if (source == unsupportleavesItem)
24112494 {
24122495 SupportLeaves(false);
24132496 } else
2414
- if (event.getSource() == hideleavesItem)
2497
+ if (source == hideleavesItem)
24152498 {
24162499 HideLeaves(true);
24172500 } else
2418
- if (event.getSource() == showleavesItem)
2501
+ if (source == showleavesItem)
24192502 {
24202503 HideLeaves(false);
24212504 } else
2422
- if (event.getSource() == markleavesItem)
2505
+ if (source == markleavesItem)
24232506 {
24242507 MarkLeaves(true);
24252508 } else
2426
- if (event.getSource() == unmarkleavesItem)
2509
+ if (source == unmarkleavesItem)
24272510 {
24282511 MarkLeaves(false);
24292512 } else
2430
- if (event.getSource() == flipVItem)
2513
+ if (source == flipVItem)
24312514 {
24322515 FlipV(true);
24332516 } else
2434
- if (event.getSource() == unflipVItem)
2517
+ if (source == unflipVItem)
24352518 {
24362519 FlipV(false);
24372520 } else
2438
- if (event.getSource() == lowTexturesItem)
2521
+ if (source == lowTexturesItem)
24392522 {
24402523 SetTexRes(0);
24412524 } else
2442
- if (event.getSource() == normalTexturesItem)
2525
+ if (source == normalTexturesItem)
24432526 {
24442527 SetTexRes(1);
24452528 } else
2446
- if (event.getSource() == highTexturesItem)
2529
+ if (source == highTexturesItem)
24472530 {
24482531 SetTexRes(2);
24492532 } else
2450
- if (event.getSource() == veryhighTexturesItem)
2533
+ if (source == veryhighTexturesItem)
24512534 {
24522535 SetTexRes(3);
24532536 } else
2454
- if (event.getSource() == maxTexturesItem)
2537
+ if (source == maxTexturesItem)
24552538 {
24562539 SetTexRes(4);
24572540 } else
2458
- if (event.getSource() == panoTexturesItem)
2541
+ if (source == panoTexturesItem)
24592542 {
24602543 SetTexRes(5);
24612544 } else
2462
- if (event.getSource() == reverseNormalsItem)
2545
+ if (source == reverseNormalsItem)
24632546 {
24642547 ReverseNormals();
24652548 } else
2466
- if (event.getSource() == parseverticesItem)
2549
+ if (source == parseverticesItem)
24672550 {
24682551 ParseVertices();
24692552 } else
2470
- if (event.getSource() == textureFieldItem)
2553
+ if (source == textureFieldItem)
24712554 {
24722555 TextureVertices();
24732556 } else
2474
- if (event.getSource() == alignItem)
2557
+ if (source == alignItem)
24752558 {
24762559 Align();
24772560 } else
2478
- if (event.getSource() == mirrorItem)
2561
+ if (source == mirrorItem)
24792562 {
24802563 MirrorPoses();
24812564 } else
2482
- if (event.getSource() == reduceMorphItem)
2565
+ if (source == reduceMorphItem)
24832566 {
24842567 MeshReduction(false);
24852568 } else
2486
- if (event.getSource() == reduce34MorphItem)
2569
+ if (source == reduce34MorphItem)
24872570 {
24882571 MeshReduction(true);
24892572 } else
2490
- if (event.getSource() == reverseTrianglesItem)
2573
+ if (source == reverseTrianglesItem)
24912574 {
24922575 ReverseTriangles();
24932576 } else
2494
- if (event.getSource() == reduceMeshItem)
2577
+ if (source == reduceMeshItem)
24952578 {
24962579 ReduceMesh(false);
24972580 } else
2498
- if (event.getSource() == reduce34MeshItem)
2581
+ if (source == reduce34MeshItem)
24992582 {
25002583 ReduceMesh(true);
25012584 } else
2502
- if (event.getSource() == increaseMeshItem)
2585
+ if (source == increaseMeshItem)
25032586 {
25042587 IncreaseMesh();
25052588 } else
2506
- if (event.getSource() == clipMeshItem)
2589
+ if (source == clipMeshItem)
25072590 {
25082591 ClipMesh();
25092592 } else
2510
- if (event.getSource() == smoothMeshItem)
2593
+ if (source == smoothMeshItem)
25112594 {
25122595 SmoothMesh();
25132596 } else
2514
- if (event.getSource() == transformgeometryItem)
2597
+ if (source == transformgeometryItem)
25152598 {
25162599 TransformGeometry();
25172600 } else
2518
- if (event.getSource() == resetTransformItem)
2601
+ if (source == resetTransformItem)
25192602 {
25202603 ResetTransform();
25212604 } else
2522
- if (event.getSource() == resetCentroidItem)
2605
+ if (source == resetCentroidItem)
25232606 {
25242607 ResetCentroid();
25252608 } else
2526
- if (event.getSource() == resetParentItem)
2609
+ if (source == resetParentItem)
25272610 {
25282611 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25292612 {
....@@ -2533,7 +2616,7 @@
25332616
25342617 refreshContents();
25352618 } else
2536
- if (event.getSource() == repairParentItem)
2619
+ if (source == repairParentItem)
25372620 {
25382621 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25392622 {
....@@ -2547,7 +2630,7 @@
25472630
25482631 refreshContents();
25492632 } else
2550
- if (event.getSource() == repairShadowItem)
2633
+ if (source == repairShadowItem)
25512634 {
25522635 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25532636 {
....@@ -2561,7 +2644,7 @@
25612644
25622645 refreshContents();
25632646 } else
2564
- if (event.getSource() == sortbysizeItem)
2647
+ if (source == sortbysizeItem)
25652648 {
25662649 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672650 {
....@@ -2573,7 +2656,7 @@
25732656 ResetModel();
25742657 refreshContents();
25752658 } else
2576
- if (event.getSource() == sortbynameItem)
2659
+ if (source == sortbynameItem)
25772660 {
25782661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25792662 {
....@@ -2585,7 +2668,7 @@
25852668 ResetModel();
25862669 refreshContents();
25872670 } else
2588
- if (event.getSource() == attachPigmentItem)
2671
+ if (source == attachPigmentItem)
25892672 {
25902673 String texture = GetFile("Attach pigment");
25912674 Object3D obj;
....@@ -2597,7 +2680,7 @@
25972680
25982681 refreshContents();
25992682 } else
2600
- if (event.getSource() == detachPigmentItem)
2683
+ if (source == detachPigmentItem)
26012684 {
26022685 Object3D obj;
26032686 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +2691,7 @@
26082691
26092692 refreshContents();
26102693 } else
2611
- if (event.getSource() == attachBumpItem)
2694
+ if (source == attachBumpItem)
26122695 {
26132696 String texture = GetFile("Attach bump");
26142697 Object3D obj;
....@@ -2620,7 +2703,7 @@
26202703
26212704 refreshContents();
26222705 } else
2623
- if (event.getSource() == detachBumpItem)
2706
+ if (source == detachBumpItem)
26242707 {
26252708 Object3D obj;
26262709 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2631,7 +2714,7 @@
26312714
26322715 refreshContents();
26332716 } else
2634
- if (event.getSource() == pigmentBumpItem)
2717
+ if (source == pigmentBumpItem)
26352718 {
26362719 Object3D obj;
26372720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +2725,195 @@
26422725
26432726 refreshContents();
26442727 } else
2645
- if (event.getSource() == flashSelectionButton)
2728
+ if (source == flashSelectionButton)
26462729 {
26472730 CameraPane.flash = true;
26482731 refreshContents();
26492732 } else
2650
- if (event.getSource() == oneButton)
2733
+ if (source == oneButton)
26512734 {
26522735 } else
2653
- if (event.getSource() == twoButton)
2736
+ if (source == twoButton)
26542737 {
26552738 radio.layout = twoButton;
26562739 // bug
26572740 //gridPanel.setDividerLocation(1.0);
26582741 //bigPanel.setDividerLocation(0.0);
2659
- bigThree.remove(scenePanel);
2660
- bigThree.remove(centralPanel);
2661
- bigThree.remove(XYZPanel);
2662
- aWindowConstraints.gridx = 0;
2663
- aWindowConstraints.gridy = 0;
2664
- aWindowConstraints.gridwidth = 1;
2665
- // aConstraints.gridheight = 3;
2666
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2667
- aWindowConstraints.weightx = 0;
2668
- aWindowConstraints.weighty = 1;
2669
- //bigThree.add(jtp, aWindowConstraints);
2670
- aWindowConstraints.weightx = 1;
2671
- aWindowConstraints.gridwidth = 3;
2672
- // aConstraints.gridheight = 3;
2673
- aWindowConstraints.gridx = 1;
2674
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2675
- bigThree.add(centralPanel, aWindowConstraints);
2676
- aWindowConstraints.weightx = 0;
2677
- aWindowConstraints.gridx = 4;
2678
- aWindowConstraints.gridwidth = 1;
2679
- // aConstraints.gridheight = 3;
2680
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2681
- //bigThree.add(XYZPanel, aWindowConstraints);
2682
- 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();
26832771 } else
2684
- if (event.getSource() == threeButton)
2772
+ if (source == threeButton)
26852773 {
26862774 radio.layout = threeButton;
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
- aConstraints.fill = GridBagConstraints.VERTICAL;
2709
- bigThree.add(XYZPanel, aWindowConstraints);
2710
- 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();
27112807 } else
2712
- if (event.getSource() == fourButton)
2808
+ if (source == fourButton)
27132809 {
27142810 radio.layout = fourButton;
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
- // aWindowConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2723
- aWindowConstraints.weightx = 1;
2724
- aWindowConstraints.weighty = 1;
2725
- bigThree.add(scenePanel, 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(cameraPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aWindowConstraints.gridheight = 3;
2736
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2737
- //bigThree.add(XYZPanel, aWindowConstraints);
2738
- 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();
27392842 } else
2740
- if (event.getSource() == sixButton)
2843
+ if (source == sixButton)
27412844 {
27422845 radio.layout = sixButton;
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
- // aConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2751
- aWindowConstraints.weightx = 0;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aWindowConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- bigThree.add(centralPanel, 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, aConstraints);
2766
- 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();
27672878 } else
2768
- if (event.getSource() == sevenButton)
2879
+ if (source == sevenButton)
27692880 {
27702881 radio.layout = sevenButton;
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
- // aWindowConstraints.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
- // aConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- bigThree.add(XYZPanel, aWindowConstraints);
2794
- 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();
27952915 } else
2796
- if (event.getSource() == rootButton)
2916
+ if (source == rootButton)
27972917 {
27982918 Object3D obj;
27992919 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2805,7 +2925,7 @@
28052925
28062926 refreshContents(true);
28072927 } else
2808
- if (event.getSource() == closeButton)
2928
+ if (source == closeButton)
28092929 {
28102930 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28112931 cRadio ab;
....@@ -2826,11 +2946,11 @@
28262946 }
28272947 refreshContents(true);
28282948 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
2949
+ if (source == editItem || source == editButton)
28302950 {
28312951 EditSelection(false);
28322952 } else
2833
- if (event.getSource() == uneditButton)
2953
+ if (source == uneditButton)
28342954 {
28352955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28362956 {
....@@ -2842,12 +2962,12 @@
28422962
28432963 child.editWindow = null; // ???????????
28442964 }
2845
- objEditor.ctrlPanel.revalidate();
2965
+ objEditor.ctrlPanel.FlushUI();
28462966 //objEditor.jTree.clearSelection();
28472967 //objEditor.ResetSliders();
28482968 refreshContents(true);
28492969 } else
2850
- if (event.getSource() == clearPanelButton)
2970
+ if (source == clearPanelButton)
28512971 {
28522972 assert(copy == group);
28532973 //copy.ClearUI();
....@@ -2858,7 +2978,7 @@
28582978 listUI.clear();
28592979 refreshContents(true);
28602980 } else
2861
- if (event.getSource() == allParamsButton)
2981
+ if (source == allParamsButton)
28622982 {
28632983 assert(copy == group);
28642984
....@@ -2879,19 +2999,19 @@
28792999
28803000 refreshContents(true);
28813001 } else
2882
- if (event.getSource() == unselectButton)
3002
+ if (source == unselectButton)
28833003 {
28843004 objEditor.jTree.clearSelection();
28853005 // ?? oct 2012 GrafreeD.clipboard.clear();
28863006 objEditor.ResetSliders();
28873007 refreshContents(true);
28883008 } else
2889
- if(event.getSource() instanceof cRadio)
3009
+ if(source instanceof cRadio)
28903010 {
28913011 group.parent = keepparent;
28923012 group.attributes = 0;
28933013 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3014
+ /*cRadio*/ radio = (cRadio)source;
28953015 Object3D obj = radio.GetObject();
28963016 System.out.println("Edit " + obj);
28973017 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -3561,11 +3681,11 @@
35613681
35623682 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35633683
3564
- boolean random = CameraPane.RANDOM;
3565
- CameraPane.RANDOM = false; // parse all random nodes
3684
+ boolean random = CameraPane.SWITCH;
3685
+ CameraPane.SWITCH = false; // parse all random nodes
35663686 lowres.linkVerticesThis(null);
35673687 lowres.linkVerticesThis(sn);
3568
- CameraPane.RANDOM = random;
3688
+ CameraPane.SWITCH = random;
35693689
35703690 System.err.flush();
35713691
....@@ -4050,12 +4170,12 @@
40504170 System.err.println("info : " + child.GetPath());
40514171 }
40524172 }
4053
- else
4054
- {
4055
- objEditor.SetMaterial(group); // .GetMaterial());
4056
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4057
- System.err.println("info : " + group.GetPath());
4058
- }
4173
+// else
4174
+// {
4175
+// objEditor.SetMaterial(group); // .GetMaterial());
4176
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4177
+// System.err.println("info : " + group.GetPath());
4178
+// }
40594179
40604180 objEditor.SetText(); // jan 2014
40614181
....@@ -4323,7 +4443,7 @@
43234443 refreshContents();
43244444 }
43254445
4326
- void pasteInto(boolean copyit)
4446
+ void pasteInto(boolean copyit, boolean clone)
43274447 {
43284448 // if (GrafreeD.clipboard == null)
43294449 // return;
....@@ -4352,7 +4472,14 @@
43524472 if (copyit)
43534473 {
43544474 // paste(false);
4355
- CloneClipboard(false); // sept 2014
4475
+ if (clone)
4476
+ {
4477
+ CloneClipboard(false); // sept 2014
4478
+ }
4479
+ else
4480
+ {
4481
+ paste(false);
4482
+ }
43564483 }
43574484 else
43584485 {
....@@ -4896,10 +5023,12 @@
48965023 cButton flashSelectionButton;
48975024 cButton editButton;
48985025 cButton uneditButton;
5026
+ JCheckBox allParamsButton;
48995027 cButton clearpanelButton;
4900
- cButton allParamsButton;
49015028 cButton unselectButton;
49025029
5030
+ cButton oneStepButton;
5031
+
49035032 cButton screenfitButton;
49045033 cButton screenfitpointButton;
49055034 cButton snapobjectButton;
....@@ -4954,6 +5083,7 @@
49545083 private MenuItem mergeGeometriesItem;
49555084 private MenuItem copyItem;
49565085 private MenuItem pasteItem;
5086
+ private MenuItem pasteIntoItem;
49575087 private MenuItem pasteLinkItem;
49585088 private MenuItem pasteCloneItem;
49595089 private MenuItem pasteExpandItem;
....@@ -5051,7 +5181,7 @@
50515181 private MenuItem blobItem;
50525182 private MenuItem latheItem;
50535183 private MenuItem bezierItem;
5054
- private MenuItem checkerItem;
5184
+ private MenuItem overlayItem;
50555185 private MenuItem meshItem;
50565186 // private MenuItem meshGroupItem;
50575187 private MenuItem springItem;