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,110 +475,98 @@
433475 oe.radioPanel.add(dummyButton);
434476 oe.buttonGroup.add(dummyButton);
435477 */
436
- aConstraints.gridy += 1;
437
-
438478 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439479
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
442
-
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
480
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
444481 liveCB.setToolTipText("Enabled animation");
445482 liveCB.addItemListener(this);
446483
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), 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");
490
+ fastCB.addItemListener(this);
491
+
492
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449493 trackCB.setToolTipText("Enable tracking");
450494 trackCB.addItemListener(this);
451495
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
496
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
454497 screenfitButton.setToolTipText("Screen fit");
455498 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
499
+
457500 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458501 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464502
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
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);
471511 flashSelectionButton.setToolTipText("Show selection");
472512 flashSelectionButton.addActionListener(this);
473513
474
- oe.toolbarPanel.add(new cButton(" ", false));
514
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475515
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
516
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
482517 twoButton.setToolTipText("Show center view only");
483518 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
519
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485520 fourButton.addActionListener(this);
486521 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
522
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488523 sixButton.setToolTipText("2-column layout left");
489524 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
525
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
491526 threeButton.setToolTipText("2-column layout right");
492527 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
528
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494529 sevenButton.setToolTipText("3-column layout");
495530 sevenButton.addActionListener(this);
496531 //
497532
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- 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");
500535 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
536
+
537
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503538 closeButton.setToolTipText("Close tab");
504539 closeButton.addActionListener(this);
505540 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506541 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508542
509
- oe.aConstraints.gridx = 1; //
510
- 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");
511547 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515548
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
549
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
550
+ uneditButton.setToolTipText("Unedit selection");
517551 uneditButton.addActionListener(this);
518552
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
553
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
554
+ allParamsButton.setToolTipText("Edit all params");
531555 allParamsButton.addActionListener(this);
532556
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
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");
538563 unselectButton.addActionListener(this);
539564
565
+ commandsPanel.preferredHeight = 1;
566
+
567
+ oe.treePanel.add(commandsPanel);
568
+ oe.treePanel.Return();
569
+
540570 // oe.aConstraints.gridx += 1;
541571 // oe.aConstraints.weighty = 0;
542572 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +578,37 @@
548578 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549579 // gcButton.addActionListener(this);
550580
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
581
+ cGridBag jSPPanel = new cGridBag();
582
+
583
+ JScrollPane jSP;
562584 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
585
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564586 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
587
+
588
+ oe.treePanel.add(jSPPanel);
589
+ oe.treePanel.Return();
569590
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
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");
574595 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- 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");
577599 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- 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");
580603 textureCB.addItemListener(this);
581604
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
605
+ copyOptionsPanel.preferredHeight = 1;
606
+ oe.treePanel.add(copyOptionsPanel);
607
+ oe.treePanel.Return();
584608
609
+// mainPanel.setDividerLocation(0.5); //1.0);
610
+// mainPanel.setResizeWeight(0.5);
611
+
585612 //jList.addListSelectionListener(this);
586613 oe.jTree.addTreeSelectionListener(this);
587614 //jTree.setRootVisible(false);
....@@ -604,45 +631,37 @@
604631 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605632 }
606633
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
634
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608635 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
618
-
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // localCB.addItemListener(this);
622
-
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
625
- crowdCB.setToolTipText("Used for crowds");
626
- crowdCB.addItemListener(this);
627
-
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
630
- smoothCB.setToolTipText("Snapping delay");
631
- smoothCB.addItemListener(this);
632
-
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
636
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639637 boxCB.setToolTipText("Display bounding boxes");
640638 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
639
+
640
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643641 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644642 zoomBoxCB.addItemListener(this);
645643
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
+
646665 // constraints.gridy += 1;
647666 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648667 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +669,16 @@
650669 if (false)
651670 {
652671 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
672
+ //constraints.gridy += 1;
673
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655674 speakerCameraCB.addItemListener(this);
656675
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
676
+ //constraints.gridy += 1;
677
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659678 speakerFocusCB.addItemListener(this);
660679
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
680
+ //constraints.gridy += 1;
681
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663682 smoothfocusCB.addItemListener(this);
664683 }
665684
....@@ -667,14 +686,20 @@
667686 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668687 // debugCB.addItemListener(this);
669688
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
689
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672690 oeilCB.addItemListener(this);
673691
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
692
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676693 lookAtCB.setToolTipText("Look-at target");
677694 lookAtCB.addItemListener(this);
695
+
696
+ }
697
+
698
+ cGridBag fill = new cGridBag();
699
+
700
+ fill.preferredHeight = 200;
701
+
702
+ panel.add(fill);
678703
679704 }
680705
....@@ -959,11 +984,11 @@
959984 {
960985 loadClipboard(true);
961986 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
987
+ pasteInto(false, false);
963988 } else {
964989 loadClipboard(false);
965990 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
991
+ pasteInto(false, false); // true); // ???
967992 }
968993 }
969994 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1110,33 @@
10851110 kleinItem.addActionListener(this);
10861111 particleItem = menu.add(new MenuItem("Particle system"));
10871112 particleItem.addActionListener(this);
1113
+ if (Globals.ADVANCED)
1114
+ {
10881115 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891116 ragdollItem.addActionListener(this);
10901117 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911118 ragdoll2Item.addActionListener(this);
1119
+ }
10921120 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1121
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941122 meshItem.addActionListener(this);
10951123 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961124 // meshGroupItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10971127 springItem = menu.add(new MenuItem("Spring"));
10981128 springItem.addActionListener(this);
10991129 flagItem = menu.add(new MenuItem("Flag"));
11001130 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051131 blobItem = menu.add(new MenuItem("Blob"));
11061132 blobItem.addActionListener(this);
11071133 latheItem = menu.add(new MenuItem("Lathe"));
11081134 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);
11091140 lightItem = menu.add(new MenuItem("Light"));
11101141 lightItem.addActionListener(this);
11111142 menu.add("-");
....@@ -1115,25 +1146,26 @@
11151146 loopItem.addActionListener(this);
11161147 doubleItem = menu.add(new MenuItem("Fork"));
11171148 doubleItem.addActionListener(this);
1149
+ if (Globals.ADVANCED)
1150
+ {
11181151 tripleItem = menu.add(new MenuItem("Trident"));
11191152 tripleItem.addActionListener(this);
1153
+ }
11201154 }
11211155
11221156 void buildToolsMenu(Menu menu)
11231157 {
11241158 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251159 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1160
+ animationItem.setState(Globals.ANIMATION);
11271161
11281162 menu.add("-");
11291163 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301164 parseverticesItem.addActionListener(this);
11311165 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321166 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1167
+ alignItem = menu.add(new MenuItem("Align Object"));
11341168 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371169 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381170 reduceMorphItem.addActionListener(this);
11391171 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
....@@ -1141,8 +1173,12 @@
11411173
11421174 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431175 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451176
1177
+ if (Globals.ADVANCED)
1178
+ {
1179
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1180
+ mirrorItem.addActionListener(this);
1181
+ menu.add("-");
11461182 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471183 memoryItem.addActionListener(this);
11481184 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1165,6 +1201,7 @@
11651201 menu.add("-");
11661202 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671203 editScriptItem.addActionListener(this);
1204
+ }
11681205 }
11691206
11701207 void ScreenFit()
....@@ -1518,6 +1555,7 @@
15181555 //
15191556 public void actionPerformed(ActionEvent event) // , Object arg)
15201557 {
1558
+ Object source = event.getSource();
15211559 /*
15221560 if (event.getSource() == nameField)
15231561 {
....@@ -1529,11 +1567,11 @@
15291567 }
15301568 else
15311569 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1570
+ if (source == lookAtItem || source == lookFromItem)
15331571 {
15341572 ScreenFit();
15351573 } else
1536
- if (event.getSource() == switchItem)
1574
+ if (source == switchItem)
15371575 {
15381576 cVector v1 = new cVector();
15391577 cVector v2 = new cVector();
....@@ -1542,11 +1580,11 @@
15421580 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431581 objEditor.cameraView.repaint();
15441582 } else
1545
- if (event.getSource() == rectoidItem)
1583
+ if (source == rectoidItem)
15461584 {
15471585 makeSomething(new Box());
15481586 } else
1549
- if (event.getSource() == particleItem)
1587
+ if (source == particleItem)
15501588 {
15511589 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521590 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1605,9 @@
15671605 applyExample(particleGeom, "SMOKE");
15681606 makeSomething(particleGeom);
15691607 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1608
+ if (source == ragdollItem || source == ragdoll2Item)
15711609 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1610
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731611
15741612 ragdoll.toParent = LA.newMatrix();
15751613 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1625,7 @@
15871625 } else
15881626 /*
15891627 */
1590
- if (event.getSource() == heightFieldItem)
1628
+ if (source == heightFieldItem)
15911629 {
15921630 Object3D obj = new Object3D();
15931631
....@@ -1625,31 +1663,31 @@
16251663
16261664 makeSomething(obj);
16271665 } else
1628
- if (event.getSource() == gridItem)
1666
+ if (source == gridItem)
16291667 {
16301668 makeSomething(new Grid());
16311669 } else
1632
- if (event.getSource() == ellipsoidItem)
1670
+ if (source == ellipsoidItem)
16331671 {
16341672 makeSomething(new Sphere());
16351673 } else
1636
- if (event.getSource() == coneItem)
1674
+ if (source == coneItem)
16371675 {
16381676 makeSomething(new Cone());
16391677 } else
1640
- if (event.getSource() == torusItem)
1678
+ if (source == torusItem)
16411679 {
16421680 makeSomething(new Torus());
16431681 } else
1644
- if (event.getSource() == superItem)
1682
+ if (source == superItem)
16451683 {
16461684 makeSomething(new Superellipsoid());
16471685 } else
1648
- if (event.getSource() == kleinItem)
1686
+ if (source == kleinItem)
16491687 {
16501688 makeSomething(new Klein());
16511689 } else
1652
- if (event.getSource() == blobItem)
1690
+ if (source == blobItem)
16531691 {
16541692 Blob blob = new Blob();
16551693 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1695,15 @@
16571695 //blob.retile();
16581696 makeSomething(blob);
16591697 } else
1660
- if (event.getSource() == latheItem)
1698
+ if (source == latheItem)
16611699 {
16621700 makeSomething(new Lathe());
16631701 } else
1664
- if (event.getSource() == bezierItem)
1702
+ if (source == bezierItem)
16651703 {
16661704 makeSomething(new BezierSurface());
16671705 } else
1668
- if (event.getSource() == checkerItem)
1706
+ if (source == overlayItem)
16691707 {
16701708 /*
16711709 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1718,7 @@
16801718 */
16811719 makeSomething(new Checker());
16821720 } else
1683
- if (event.getSource() == meshItem)
1721
+ if (source == meshItem)
16841722 {
16851723 Object3D itemtomake = new Object3D();
16861724 Object3D child;
....@@ -1701,35 +1739,35 @@
17011739 makeSomething(child);
17021740 }
17031741 } else
1704
- if (event.getSource() == springItem)
1742
+ if (source == springItem)
17051743 {
17061744 cSpring s = new cSpring();
17071745 s.setup();
17081746 makeSomething(s);
17091747 } else
1710
- if (event.getSource() == flagItem)
1748
+ if (source == flagItem)
17111749 {
17121750 cSpring s = new cFlag();
17131751 s.setup();
17141752 makeSomething(s);
17151753 } else
1716
- if (event.getSource() == lightItem)
1754
+ if (source == lightItem)
17171755 {
17181756 makeSomething(new Light());
17191757 } else
1720
- if (event.getSource() == csgItem)
1758
+ if (source == csgItem)
17211759 {
17221760 group(new CSG());
17231761 } else
1724
- if (event.getSource() == templateItem)
1762
+ if (source == templateItem)
17251763 {
17261764 group(new cTemplate());
17271765 } else
1728
- if (event.getSource() == attributeItem)
1766
+ if (source == attributeItem)
17291767 {
17301768 makeSomething(new Attribute());
17311769 } else
1732
- if (event.getSource() == pointflowItem)
1770
+ if (source == pointflowItem)
17331771 {
17341772 makeSomething(new PointFlow());
17351773 } else
....@@ -1741,7 +1779,7 @@
17411779 } else
17421780 */
17431781
1744
- if (event.getSource() == superLoopItem)
1782
+ if (source == superLoopItem)
17451783 {
17461784 Composite g = new cGroup();
17471785 for (int i=0; i<15; i++)
....@@ -1763,7 +1801,7 @@
17631801
17641802 group(g);
17651803 } else
1766
- if (event.getSource() == loopItem)
1804
+ if (source == loopItem)
17671805 {
17681806 Composite csg = new GroupLeaf();
17691807 csg.count = 5;
....@@ -1772,7 +1810,7 @@
17721810 csg.addChild(child);
17731811 child.addChild(csg);
17741812 } else
1775
- if (event.getSource() == doubleItem)
1813
+ if (source == doubleItem)
17761814 {
17771815 Composite csg = new GroupLeaf();
17781816 csg.count = 5;
....@@ -1784,7 +1822,7 @@
17841822 csg.addChild(child);
17851823 child.addChild(csg);
17861824 } else
1787
- if (event.getSource() == tripleItem)
1825
+ if (source == tripleItem)
17881826 {
17891827 Composite csg = new GroupLeaf();
17901828 csg.count = 4;
....@@ -1800,70 +1838,75 @@
18001838 child.addChild(csg);
18011839 } else
18021840
1803
- if (event.getSource() == importGFDItem)
1841
+ if (source == importGFDItem)
18041842 {
18051843 ImportGFD();
18061844 } else
1807
- if (event.getSource() == importVRMLX3DItem)
1845
+ if (source == importVRMLX3DItem)
18081846 {
18091847 ImportVRMLX3D();
18101848 } else
1811
- if (event.getSource() == import3DSItem)
1849
+ if (source == import3DSItem)
18121850 {
18131851 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18141852 } else
1815
- if (event.getSource() == importOBJItem)
1853
+ if (source == importOBJItem)
18161854 {
18171855 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18181856 } else
1819
- if (event.getSource() == computeAOItem)
1857
+ if (source == computeAOItem)
18201858 {
18211859 Globals.drawMode = CameraPane.OCCLUSION;
18221860 Globals.theRenderer.repaint();
18231861 } else
1824
- if (event.getSource() == recompileItem)
1862
+ if (source == recompileItem)
18251863 {
18261864 Recompile();
18271865 refreshContents();
18281866 } else
1829
- if (event.getSource() == editScriptItem)
1867
+ if (source == editScriptItem)
18301868 {
18311869 OpenDialog();
18321870 refreshContents();
18331871 } else
1834
- if (event.getSource() == invariantsItem)
1872
+ if (source == invariantsItem)
18351873 {
18361874 System.out.println("Invariants:");
18371875 GrafreeD.grafreeD.universe.invariants();
18381876 } else
1839
- if (event.getSource() == memoryItem)
1877
+ if (source == memoryItem)
18401878 {
18411879 //System.out.println("Invariants:");
18421880 PrintMemory();
18431881 } else
1844
- if (event.getSource() == pathItem)
1882
+ if (source == pathItem)
18451883 {
18461884 PrintPath();
18471885 } else
1848
- if (event.getSource() == analyzeItem)
1886
+ if (source == analyzeItem)
18491887 {
18501888 AnalyzeObject();
18511889 } else
1852
- if (event.getSource() == dumpItem)
1890
+ if (source == dumpItem)
18531891 {
18541892 DumpObject();
18551893 } else
1856
- if (event.getSource() == screenfitButton)
1894
+ if (source == oneStepButton)
1895
+ {
1896
+ Globals.ONESTEP = true;
1897
+ cameraView.repaint();
1898
+ } else
1899
+ if (source == screenfitButton)
18571900 {
18581901 //Reload(lastConverter, lastFilename, true);
18591902 ScreenFit();
18601903 } else
1861
- if (event.getSource() == screenfitpointButton)
1904
+ if (source == screenfitpointButton)
18621905 {
18631906 //Reload(lastConverter, lastFilename, true);
18641907 ScreenFitPoint();
18651908 } else
1866
- if (event.getSource() == snapobjectButton)
1909
+ if (source == snapobjectButton)
18671910 {
18681911 //Reload(lastConverter, lastFilename, true);
18691912 SnapObject();
....@@ -1874,13 +1917,13 @@
18741917 // Recompile();
18751918 // refreshContents();
18761919 // } else
1877
- if (event.getSource() == gcButton)
1920
+ if (source == gcButton)
18781921 {
18791922 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18801923 System.gc();
18811924 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18821925 } else
1883
- if (event.getSource() == editLeafItem)
1926
+ if (source == editLeafItem)
18841927 {
18851928 Object3D obj;
18861929 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +1937,66 @@
18941937 }
18951938 refreshContents(true);
18961939 } else
1897
- if (event.getSource() == openWindowItem)
1940
+ if (source == openWindowItem)
18981941 {
18991942 EditSelection(true);
19001943 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1944
+ if (source == cutItem || source == clearButton)
19021945 {
19031946 loadClipboard(true);
19041947 } else
1905
- if (event.getSource() == duplicateItem)
1948
+ if (source == duplicateItem)
19061949 {
19071950 Object3D keep = GrafreeD.clipboard;
19081951 loadClipboard(false);
19091952 paste(false);
19101953 GrafreeD.clipboard = keep;
19111954 } else
1912
- if (event.getSource() == cloneItem)
1955
+ if (source == cloneItem)
19131956 {
19141957 CloneSelection(false);
19151958 } else
1916
- if (event.getSource() == cloneSupportItem)
1959
+ if (source == cloneSupportItem)
19171960 {
19181961 CloneSelection(true);
19191962 } else
1920
- if (event.getSource() == copyItem)
1963
+ if (source == copyItem)
19211964 {
19221965 loadClipboard(false);
19231966 } else
1924
- if (event.getSource() == pasteItem)
1967
+ if (source == pasteItem)
19251968 {
19261969 paste(false);
19271970 } else
1928
- if (event.getSource() == pasteLinkItem)
1971
+ if (source == pasteIntoItem)
19291972 {
1930
- pasteInto(false);
1973
+ pasteInto(true, false);
19311974 } else
1932
- if (event.getSource() == pasteCloneItem)
1975
+ if (source == pasteLinkItem)
19331976 {
1934
- pasteInto(true);
1977
+ pasteInto(false, false);
19351978 } else
1936
- if (event.getSource() == pasteExpandItem)
1979
+ if (source == pasteCloneItem)
1980
+ {
1981
+ pasteInto(true, true);
1982
+ } else
1983
+ if (source == pasteExpandItem)
19371984 {
19381985 paste(true);
19391986 } else
1940
- if (event.getSource() == synchronizeItem)
1987
+ if (source == synchronizeItem)
19411988 {
19421989 Overwrite(Object3D.TRANSFORM);
19431990 } else
1944
- if (event.getSource() == overwriteNameItem)
1991
+ if (source == overwriteNameItem)
19451992 {
19461993 Overwrite(Object3D.NAME);
19471994 } else
1948
- if (event.getSource() == overwriteUVItem)
1995
+ if (source == overwriteUVItem)
19491996 {
19501997 Overwrite(Object3D.UV);
19511998 } else
1952
- if (event.getSource() == overwriteMatItem)
1999
+ if (source == overwriteMatItem)
19532000 {
19542001 /* july 2015
19552002 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2016,7 @@
19692016
19702017 Overwrite(dropAttributes);
19712018 }
1972
- if (event.getSource() == overwriteGeoItem)
2019
+ if (source == overwriteGeoItem)
19732020 {
19742021 Overwrite(Object3D.GEOMETRY);
19752022 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2033,7 @@
19862033 // refreshContents();
19872034 // }
19882035 } else
1989
- if (event.getSource() == generateMeshItem)
2036
+ if (source == generateMeshItem)
19902037 {
19912038 //if (group.selection.size() == 1)
19922039 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2044,7 @@
19972044 ResetModel();
19982045 refreshContents();
19992046 } else
2000
- if (event.getSource() == extractGeometriesItem)
2047
+ if (source == extractGeometriesItem)
20012048 {
20022049 boolean one = false;
20032050
....@@ -2024,7 +2071,7 @@
20242071 ResetModel();
20252072 refreshContents();
20262073 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2074
+ if (source == cloneGeometriesItem)
20282075 {
20292076 boolean one = false;
20302077
....@@ -2050,7 +2097,7 @@
20502097 ResetModel();
20512098 refreshContents();
20522099 } else
2053
- if (event.getSource() == shareGeometriesItem)
2100
+ if (source == shareGeometriesItem)
20542101 {
20552102 boolean one = false;
20562103
....@@ -2080,7 +2127,7 @@
20802127 refreshContents();
20812128 }
20822129 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2130
+ if (source == mergeGeometriesItem)
20842131 {
20852132 boolean one = false;
20862133
....@@ -2110,7 +2157,7 @@
21102157 ResetModel();
21112158 refreshContents();
21122159 } else
2113
- if (event.getSource() == linkverticesItem)
2160
+ if (source == linkverticesItem)
21142161 {
21152162 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162163 // {
....@@ -2133,38 +2180,38 @@
21332180 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342181 for (int i=0; i<group.selection.size(); i++)
21352182 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2183
+ boolean random = CameraPane.SWITCH;
2184
+ CameraPane.SWITCH = false; // parse all random nodes
21382185 group.selection.get(i).linkVerticesThis(content);
21392186 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2187
+ CameraPane.SWITCH = random;
21412188 }
21422189 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432190 refreshContents();
21442191 }
21452192 } else
2146
- if (event.getSource() == resetsupportItem)
2193
+ if (source == resetsupportItem)
21472194 {
21482195 for (int i=0; i<group.selection.size(); i++)
21492196 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2197
+ boolean random = CameraPane.SWITCH;
2198
+ CameraPane.SWITCH = false; // parse all random nodes
21522199 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2200
+ CameraPane.SWITCH = random;
21542201 }
21552202
21562203 refreshContents();
21572204 } else
2158
- if (event.getSource() == relinkverticesItem)
2205
+ if (source == relinkverticesItem)
21592206 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2207
+ boolean random = CameraPane.SWITCH;
2208
+ CameraPane.SWITCH = false; // parse all random nodes
21622209 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2210
+ CameraPane.SWITCH = random;
21642211
21652212 refreshContents();
21662213 } else
2167
- if (event.getSource() == resetreferencesItem)
2214
+ if (source == resetreferencesItem)
21682215 {
21692216 for (int i=0; i<group.selection.size(); i++)
21702217 {
....@@ -2173,7 +2220,7 @@
21732220
21742221 refreshContents();
21752222 } else
2176
- if (event.getSource() == setMasterItem)
2223
+ if (source == setMasterItem)
21772224 {
21782225 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21792226 {
....@@ -2186,7 +2233,7 @@
21862233 refreshContents();
21872234 }
21882235 } else
2189
- if (event.getSource() == poseMeshItem)
2236
+ if (source == poseMeshItem)
21902237 {
21912238 if (group.selection.size() == 1)
21922239 {
....@@ -2205,19 +2252,19 @@
22052252 }
22062253
22072254 } else
2208
- if (event.getSource() == revertMeshItem)
2255
+ if (source == revertMeshItem)
22092256 {
22102257 RevertMeshes();
22112258 } else
2212
- if (event.getSource() == resetMeshItem)
2259
+ if (source == resetMeshItem)
22132260 {
22142261 ResetAll();
22152262 } else
2216
- if (event.getSource() == stepAllItem)
2263
+ if (source == stepAllItem)
22172264 {
22182265 StepAll();
22192266 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2267
+ if (source == clearItem) // || event.getSource() == clearButton)
22212268 {
22222269 //int indices[] = jList.getSelectedIndices();
22232270 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2272,46 @@
22252272
22262273 ClearSelection(false);
22272274 } else
2228
- if (event.getSource() == clearAllItem)
2275
+ if (source == clearAllItem)
22292276 {
22302277 ClearSelection(true);
22312278 } else
2232
- if (event.getSource() == grabItem)
2279
+ if (source == grabItem)
22332280 {
22342281 group(new cGroup(), true);
22352282 } else
2236
- if (event.getSource() == hideItem)
2283
+ if (source == hideItem)
22372284 {
22382285 group(new HiddenObject());
22392286 } else
2240
- if (event.getSource() == frontItem)
2287
+ if (source == frontItem)
22412288 {
22422289 front();
22432290 } else
2244
- if (event.getSource() == backItem)
2291
+ if (source == backItem)
22452292 {
22462293 back();
22472294 } else
2248
- if (event.getSource() == cameraItem)
2295
+ if (source == cameraItem)
22492296 {
22502297 makeSomething(new Camera());
22512298 } else
2252
- if (event.getSource() == compositeItem)
2299
+ if (source == compositeItem)
22532300 {
22542301 group(new Composite());
22552302 } else
2256
- if (event.getSource() == randomItem)
2303
+ if (source == randomItem)
22572304 {
22582305 RandomNode random = new RandomNode();
22592306 group(random);
22602307 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2308
+ random.name = random.get(0).name + "Switch";
22622309 } else
2263
- if (event.getSource() == physicsItem)
2310
+ if (source == physicsItem)
22642311 {
22652312 group(new PhysicsNode());
22662313 } else
2267
- if (event.getSource() == frameselectorItem)
2314
+ if (source == frameselectorItem)
22682315 {
22692316 for (int i=0; i<group.selection.size(); i++)
22702317 {
....@@ -2276,7 +2323,7 @@
22762323 ResetModel();
22772324 refreshContents();
22782325 } else
2279
- if (event.getSource() == switchGeoItem)
2326
+ if (source == switchGeoItem)
22802327 {
22812328 for (int i=0; i<group.selection.size(); i++)
22822329 {
....@@ -2288,7 +2335,7 @@
22882335 ResetModel();
22892336 refreshContents();
22902337 } else
2291
- if (event.getSource() == switchTransfoItem)
2338
+ if (source == switchTransfoItem)
22922339 {
22932340 for (int i=0; i<group.selection.size(); i++)
22942341 {
....@@ -2300,7 +2347,7 @@
23002347 ResetModel();
23012348 refreshContents();
23022349 } else
2303
- if (event.getSource() == morphItem)
2350
+ if (source == morphItem)
23042351 {
23052352 for (int i=0; i<group.selection.size(); i++)
23062353 {
....@@ -2312,7 +2359,7 @@
23122359 ResetModel();
23132360 refreshContents();
23142361 } else
2315
- if (event.getSource() == scriptNodeItem)
2362
+ if (source == scriptNodeItem)
23162363 {
23172364 boolean atleastone = false;
23182365
....@@ -2351,31 +2398,31 @@
23512398 }
23522399 }
23532400 } else
2354
- if (event.getSource() == linkerItem)
2401
+ if (source == linkerItem)
23552402 {
23562403 group(new cLinker());
23572404 } else
2358
- if (event.getSource() == textureItem)
2405
+ if (source == textureItem)
23592406 {
23602407 group(new TextureNode());
23612408 } else
2362
- if (event.getSource() == billboardItem)
2409
+ if (source == billboardItem)
23632410 {
23642411 group(new BillboardNode());
23652412 } else
2366
- if (event.getSource() == shadowXItem)
2413
+ if (source == shadowXItem)
23672414 {
23682415 CastShadow(0);
23692416 } else
2370
- if (event.getSource() == shadowYItem)
2417
+ if (source == shadowYItem)
23712418 {
23722419 CastShadow(1);
23732420 } else
2374
- if (event.getSource() == shadowZItem)
2421
+ if (source == shadowZItem)
23752422 {
23762423 CastShadow(2);
23772424 } else
2378
- if (event.getSource() == ungroupItem)
2425
+ if (source == ungroupItem)
23792426 {
23802427 //ungroup();
23812428 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2434,179 @@
23872434
23882435 refreshContents();
23892436 } else
2390
- if (event.getSource() == genUVItem)
2437
+ if (source == genUVItem)
23912438 {
23922439 GenUV();
23932440 } else
2394
- if (event.getSource() == genNormalsCADItem)
2441
+ if (source == genNormalsCADItem)
23952442 {
23962443 GenNormals(true);
23972444 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2445
+ if (source == genNormalsMESHItem)
23992446 {
24002447 GenNormals(true); // TODO
24012448 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2449
+ if (source == genNormalsORGANItem)
24032450 {
24042451 GenNormals(false);
24052452 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2453
+ if (source == genNormalsMINEItem)
24072454 {
24082455 GenNormalsMINE();
24092456 } else
2410
- if (event.getSource() == stripifyItem)
2457
+ if (source == stripifyItem)
24112458 {
24122459 Stripify();
24132460 } else
2414
- if (event.getSource() == unstripifyItem)
2461
+ if (source == unstripifyItem)
24152462 {
24162463 Unstripify();
24172464 } else
2418
- if (event.getSource() == trimItem)
2465
+ if (source == trimItem)
24192466 {
24202467 Trim();
24212468 } else
2422
- if (event.getSource() == untrimItem)
2469
+ if (source == untrimItem)
24232470 {
24242471 Untrim();
24252472 } else
2426
- if (event.getSource() == clearColorsItem)
2473
+ if (source == clearColorsItem)
24272474 {
24282475 ClearColors();
24292476 } else
2430
- if (event.getSource() == clearMaterialsItem)
2477
+ if (source == clearMaterialsItem)
24312478 {
24322479 ClearMaterials();
24332480 } else
2434
- if (event.getSource() == liveleavesItem)
2481
+ if (source == liveleavesItem)
24352482 {
24362483 LiveLeaves(true);
24372484 } else
2438
- if (event.getSource() == unliveleavesItem)
2485
+ if (source == unliveleavesItem)
24392486 {
24402487 LiveLeaves(false);
24412488 } else
2442
- if (event.getSource() == supportleavesItem)
2489
+ if (source == supportleavesItem)
24432490 {
24442491 SupportLeaves(true);
24452492 } else
2446
- if (event.getSource() == unsupportleavesItem)
2493
+ if (source == unsupportleavesItem)
24472494 {
24482495 SupportLeaves(false);
24492496 } else
2450
- if (event.getSource() == hideleavesItem)
2497
+ if (source == hideleavesItem)
24512498 {
24522499 HideLeaves(true);
24532500 } else
2454
- if (event.getSource() == showleavesItem)
2501
+ if (source == showleavesItem)
24552502 {
24562503 HideLeaves(false);
24572504 } else
2458
- if (event.getSource() == markleavesItem)
2505
+ if (source == markleavesItem)
24592506 {
24602507 MarkLeaves(true);
24612508 } else
2462
- if (event.getSource() == unmarkleavesItem)
2509
+ if (source == unmarkleavesItem)
24632510 {
24642511 MarkLeaves(false);
24652512 } else
2466
- if (event.getSource() == flipVItem)
2513
+ if (source == flipVItem)
24672514 {
24682515 FlipV(true);
24692516 } else
2470
- if (event.getSource() == unflipVItem)
2517
+ if (source == unflipVItem)
24712518 {
24722519 FlipV(false);
24732520 } else
2474
- if (event.getSource() == lowTexturesItem)
2521
+ if (source == lowTexturesItem)
24752522 {
24762523 SetTexRes(0);
24772524 } else
2478
- if (event.getSource() == normalTexturesItem)
2525
+ if (source == normalTexturesItem)
24792526 {
24802527 SetTexRes(1);
24812528 } else
2482
- if (event.getSource() == highTexturesItem)
2529
+ if (source == highTexturesItem)
24832530 {
24842531 SetTexRes(2);
24852532 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2533
+ if (source == veryhighTexturesItem)
24872534 {
24882535 SetTexRes(3);
24892536 } else
2490
- if (event.getSource() == maxTexturesItem)
2537
+ if (source == maxTexturesItem)
24912538 {
24922539 SetTexRes(4);
24932540 } else
2494
- if (event.getSource() == panoTexturesItem)
2541
+ if (source == panoTexturesItem)
24952542 {
24962543 SetTexRes(5);
24972544 } else
2498
- if (event.getSource() == reverseNormalsItem)
2545
+ if (source == reverseNormalsItem)
24992546 {
25002547 ReverseNormals();
25012548 } else
2502
- if (event.getSource() == parseverticesItem)
2549
+ if (source == parseverticesItem)
25032550 {
25042551 ParseVertices();
25052552 } else
2506
- if (event.getSource() == textureFieldItem)
2553
+ if (source == textureFieldItem)
25072554 {
25082555 TextureVertices();
25092556 } else
2510
- if (event.getSource() == alignItem)
2557
+ if (source == alignItem)
25112558 {
25122559 Align();
25132560 } else
2514
- if (event.getSource() == mirrorItem)
2561
+ if (source == mirrorItem)
25152562 {
25162563 MirrorPoses();
25172564 } else
2518
- if (event.getSource() == reduceMorphItem)
2565
+ if (source == reduceMorphItem)
25192566 {
25202567 MeshReduction(false);
25212568 } else
2522
- if (event.getSource() == reduce34MorphItem)
2569
+ if (source == reduce34MorphItem)
25232570 {
25242571 MeshReduction(true);
25252572 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2573
+ if (source == reverseTrianglesItem)
25272574 {
25282575 ReverseTriangles();
25292576 } else
2530
- if (event.getSource() == reduceMeshItem)
2577
+ if (source == reduceMeshItem)
25312578 {
25322579 ReduceMesh(false);
25332580 } else
2534
- if (event.getSource() == reduce34MeshItem)
2581
+ if (source == reduce34MeshItem)
25352582 {
25362583 ReduceMesh(true);
25372584 } else
2538
- if (event.getSource() == increaseMeshItem)
2585
+ if (source == increaseMeshItem)
25392586 {
25402587 IncreaseMesh();
25412588 } else
2542
- if (event.getSource() == clipMeshItem)
2589
+ if (source == clipMeshItem)
25432590 {
25442591 ClipMesh();
25452592 } else
2546
- if (event.getSource() == smoothMeshItem)
2593
+ if (source == smoothMeshItem)
25472594 {
25482595 SmoothMesh();
25492596 } else
2550
- if (event.getSource() == transformgeometryItem)
2597
+ if (source == transformgeometryItem)
25512598 {
25522599 TransformGeometry();
25532600 } else
2554
- if (event.getSource() == resetTransformItem)
2601
+ if (source == resetTransformItem)
25552602 {
25562603 ResetTransform();
25572604 } else
2558
- if (event.getSource() == resetCentroidItem)
2605
+ if (source == resetCentroidItem)
25592606 {
25602607 ResetCentroid();
25612608 } else
2562
- if (event.getSource() == resetParentItem)
2609
+ if (source == resetParentItem)
25632610 {
25642611 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652612 {
....@@ -2569,7 +2616,7 @@
25692616
25702617 refreshContents();
25712618 } else
2572
- if (event.getSource() == repairParentItem)
2619
+ if (source == repairParentItem)
25732620 {
25742621 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752622 {
....@@ -2583,7 +2630,7 @@
25832630
25842631 refreshContents();
25852632 } else
2586
- if (event.getSource() == repairShadowItem)
2633
+ if (source == repairShadowItem)
25872634 {
25882635 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892636 {
....@@ -2597,7 +2644,7 @@
25972644
25982645 refreshContents();
25992646 } else
2600
- if (event.getSource() == sortbysizeItem)
2647
+ if (source == sortbysizeItem)
26012648 {
26022649 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032650 {
....@@ -2609,7 +2656,7 @@
26092656 ResetModel();
26102657 refreshContents();
26112658 } else
2612
- if (event.getSource() == sortbynameItem)
2659
+ if (source == sortbynameItem)
26132660 {
26142661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152662 {
....@@ -2621,7 +2668,7 @@
26212668 ResetModel();
26222669 refreshContents();
26232670 } else
2624
- if (event.getSource() == attachPigmentItem)
2671
+ if (source == attachPigmentItem)
26252672 {
26262673 String texture = GetFile("Attach pigment");
26272674 Object3D obj;
....@@ -2633,7 +2680,7 @@
26332680
26342681 refreshContents();
26352682 } else
2636
- if (event.getSource() == detachPigmentItem)
2683
+ if (source == detachPigmentItem)
26372684 {
26382685 Object3D obj;
26392686 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2691,7 @@
26442691
26452692 refreshContents();
26462693 } else
2647
- if (event.getSource() == attachBumpItem)
2694
+ if (source == attachBumpItem)
26482695 {
26492696 String texture = GetFile("Attach bump");
26502697 Object3D obj;
....@@ -2656,7 +2703,7 @@
26562703
26572704 refreshContents();
26582705 } else
2659
- if (event.getSource() == detachBumpItem)
2706
+ if (source == detachBumpItem)
26602707 {
26612708 Object3D obj;
26622709 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2714,7 @@
26672714
26682715 refreshContents();
26692716 } else
2670
- if (event.getSource() == pigmentBumpItem)
2717
+ if (source == pigmentBumpItem)
26712718 {
26722719 Object3D obj;
26732720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2725,195 @@
26782725
26792726 refreshContents();
26802727 } else
2681
- if (event.getSource() == flashSelectionButton)
2728
+ if (source == flashSelectionButton)
26822729 {
26832730 CameraPane.flash = true;
26842731 refreshContents();
26852732 } else
2686
- if (event.getSource() == oneButton)
2733
+ if (source == oneButton)
26872734 {
26882735 } else
2689
- if (event.getSource() == twoButton)
2736
+ if (source == twoButton)
26902737 {
26912738 radio.layout = twoButton;
26922739 // bug
26932740 //gridPanel.setDividerLocation(1.0);
26942741 //bigPanel.setDividerLocation(0.0);
2695
- bigThree.remove(scenePanel);
2696
- bigThree.remove(centralPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- //bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(centralPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- //bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
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();
27192771 } else
2720
- if (event.getSource() == threeButton)
2772
+ if (source == threeButton)
27212773 {
27222774 radio.layout = threeButton;
2723
- bigThree.remove(scenePanel);
2724
- bigThree.remove(centralPanel);
2725
- bigThree.remove(XYZPanel);
2726
- aWindowConstraints.gridx = 0;
2727
- aWindowConstraints.gridy = 0;
2728
- aWindowConstraints.gridwidth = 1;
2729
- // aConstraints.gridheight = 3;
2730
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2731
- aWindowConstraints.weightx = 0;
2732
- aWindowConstraints.weighty = 1;
2733
- //bigThree.add(jtp, aWindowConstraints);
2734
- aWindowConstraints.weightx = 1;
2735
- aWindowConstraints.gridwidth = 3;
2736
- // aConstraints.gridheight = 3;
2737
- aWindowConstraints.gridx = 1;
2738
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2739
- bigThree.add(centralPanel, aWindowConstraints);
2740
- aWindowConstraints.weightx = 0;
2741
- aWindowConstraints.gridx = 4;
2742
- aWindowConstraints.gridwidth = 1;
2743
- // aConstraints.gridheight = 3;
2744
- aConstraints.fill = GridBagConstraints.VERTICAL;
2745
- bigThree.add(XYZPanel, aWindowConstraints);
2746
- bigThree.revalidate();
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();
27472807 } else
2748
- if (event.getSource() == fourButton)
2808
+ if (source == fourButton)
27492809 {
27502810 radio.layout = fourButton;
2751
- bigThree.remove(scenePanel);
2752
- bigThree.remove(centralPanel);
2753
- bigThree.remove(XYZPanel);
2754
- aWindowConstraints.gridx = 0;
2755
- aWindowConstraints.gridy = 0;
2756
- aWindowConstraints.gridwidth = 1;
2757
- // aWindowConstraints.gridheight = 3;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- aWindowConstraints.weightx = 1;
2760
- aWindowConstraints.weighty = 1;
2761
- bigThree.add(scenePanel, aWindowConstraints);
2762
- aWindowConstraints.weightx = 1;
2763
- aWindowConstraints.gridwidth = 3;
2764
- // aConstraints.gridheight = 3;
2765
- aWindowConstraints.gridx = 1;
2766
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2767
- //bigThree.add(cameraPanel, aWindowConstraints);
2768
- aWindowConstraints.weightx = 0;
2769
- aWindowConstraints.gridx = 4;
2770
- aWindowConstraints.gridwidth = 1;
2771
- // aWindowConstraints.gridheight = 3;
2772
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2773
- //bigThree.add(XYZPanel, aWindowConstraints);
2774
- bigThree.revalidate();
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();
27752842 } else
2776
- if (event.getSource() == sixButton)
2843
+ if (source == sixButton)
27772844 {
27782845 radio.layout = sixButton;
2779
- bigThree.remove(scenePanel);
2780
- bigThree.remove(centralPanel);
2781
- bigThree.remove(XYZPanel);
2782
- aWindowConstraints.gridx = 0;
2783
- aWindowConstraints.gridy = 0;
2784
- aWindowConstraints.gridwidth = 1;
2785
- // aConstraints.gridheight = 3;
2786
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2787
- aWindowConstraints.weightx = 0;
2788
- aWindowConstraints.weighty = 1;
2789
- bigThree.add(scenePanel, aWindowConstraints);
2790
- aWindowConstraints.weightx = 1;
2791
- aWindowConstraints.gridwidth = 3;
2792
- // aWindowConstraints.gridheight = 3;
2793
- aWindowConstraints.gridx = 1;
2794
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2795
- bigThree.add(centralPanel, aWindowConstraints);
2796
- aWindowConstraints.weightx = 0;
2797
- aWindowConstraints.gridx = 4;
2798
- aWindowConstraints.gridwidth = 1;
2799
- // aWindowConstraints.gridheight = 3;
2800
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2801
- //bigThree.add(XYZPanel, aConstraints);
2802
- bigThree.revalidate();
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();
28032878 } else
2804
- if (event.getSource() == sevenButton)
2879
+ if (source == sevenButton)
28052880 {
28062881 radio.layout = sevenButton;
2807
- bigThree.remove(scenePanel);
2808
- bigThree.remove(centralPanel);
2809
- bigThree.remove(XYZPanel);
2810
- aWindowConstraints.gridx = 0;
2811
- aWindowConstraints.gridy = 0;
2812
- aWindowConstraints.gridwidth = 1;
2813
- // aWindowConstraints.gridheight = 3;
2814
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2815
- aWindowConstraints.weightx = 0;
2816
- aWindowConstraints.weighty = 1;
2817
- bigThree.add(scenePanel, aWindowConstraints);
2818
- aWindowConstraints.weightx = 1;
2819
- aWindowConstraints.gridwidth = 3;
2820
- // aWindowConstraints.gridheight = 3;
2821
- aWindowConstraints.gridx = 1;
2822
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2823
- bigThree.add(centralPanel, aWindowConstraints);
2824
- aWindowConstraints.weightx = 0;
2825
- aWindowConstraints.gridx = 4;
2826
- aWindowConstraints.gridwidth = 1;
2827
- // aConstraints.gridheight = 3;
2828
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2829
- bigThree.add(XYZPanel, aWindowConstraints);
2830
- bigThree.revalidate();
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();
28312915 } else
2832
- if (event.getSource() == rootButton)
2916
+ if (source == rootButton)
28332917 {
28342918 Object3D obj;
28352919 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2841,7 +2925,7 @@
28412925
28422926 refreshContents(true);
28432927 } else
2844
- if (event.getSource() == closeButton)
2928
+ if (source == closeButton)
28452929 {
28462930 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28472931 cRadio ab;
....@@ -2862,11 +2946,11 @@
28622946 }
28632947 refreshContents(true);
28642948 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
2949
+ if (source == editItem || source == editButton)
28662950 {
28672951 EditSelection(false);
28682952 } else
2869
- if (event.getSource() == uneditButton)
2953
+ if (source == uneditButton)
28702954 {
28712955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28722956 {
....@@ -2878,12 +2962,12 @@
28782962
28792963 child.editWindow = null; // ???????????
28802964 }
2881
- objEditor.ctrlPanel.revalidate();
2965
+ objEditor.ctrlPanel.FlushUI();
28822966 //objEditor.jTree.clearSelection();
28832967 //objEditor.ResetSliders();
28842968 refreshContents(true);
28852969 } else
2886
- if (event.getSource() == clearPanelButton)
2970
+ if (source == clearPanelButton)
28872971 {
28882972 assert(copy == group);
28892973 //copy.ClearUI();
....@@ -2894,7 +2978,7 @@
28942978 listUI.clear();
28952979 refreshContents(true);
28962980 } else
2897
- if (event.getSource() == allParamsButton)
2981
+ if (source == allParamsButton)
28982982 {
28992983 assert(copy == group);
29002984
....@@ -2915,19 +2999,19 @@
29152999
29163000 refreshContents(true);
29173001 } else
2918
- if (event.getSource() == unselectButton)
3002
+ if (source == unselectButton)
29193003 {
29203004 objEditor.jTree.clearSelection();
29213005 // ?? oct 2012 GrafreeD.clipboard.clear();
29223006 objEditor.ResetSliders();
29233007 refreshContents(true);
29243008 } else
2925
- if(event.getSource() instanceof cRadio)
3009
+ if(source instanceof cRadio)
29263010 {
29273011 group.parent = keepparent;
29283012 group.attributes = 0;
29293013 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3014
+ /*cRadio*/ radio = (cRadio)source;
29313015 Object3D obj = radio.GetObject();
29323016 System.out.println("Edit " + obj);
29333017 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -3597,11 +3681,11 @@
35973681
35983682 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993683
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3684
+ boolean random = CameraPane.SWITCH;
3685
+ CameraPane.SWITCH = false; // parse all random nodes
36023686 lowres.linkVerticesThis(null);
36033687 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3688
+ CameraPane.SWITCH = random;
36053689
36063690 System.err.flush();
36073691
....@@ -4086,12 +4170,12 @@
40864170 System.err.println("info : " + child.GetPath());
40874171 }
40884172 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4173
+// else
4174
+// {
4175
+// objEditor.SetMaterial(group); // .GetMaterial());
4176
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4177
+// System.err.println("info : " + group.GetPath());
4178
+// }
40954179
40964180 objEditor.SetText(); // jan 2014
40974181
....@@ -4359,7 +4443,7 @@
43594443 refreshContents();
43604444 }
43614445
4362
- void pasteInto(boolean copyit)
4446
+ void pasteInto(boolean copyit, boolean clone)
43634447 {
43644448 // if (GrafreeD.clipboard == null)
43654449 // return;
....@@ -4388,7 +4472,14 @@
43884472 if (copyit)
43894473 {
43904474 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4475
+ if (clone)
4476
+ {
4477
+ CloneClipboard(false); // sept 2014
4478
+ }
4479
+ else
4480
+ {
4481
+ paste(false);
4482
+ }
43924483 }
43934484 else
43944485 {
....@@ -4932,10 +5023,12 @@
49325023 cButton flashSelectionButton;
49335024 cButton editButton;
49345025 cButton uneditButton;
5026
+ JCheckBox allParamsButton;
49355027 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375028 cButton unselectButton;
49385029
5030
+ cButton oneStepButton;
5031
+
49395032 cButton screenfitButton;
49405033 cButton screenfitpointButton;
49415034 cButton snapobjectButton;
....@@ -4990,6 +5083,7 @@
49905083 private MenuItem mergeGeometriesItem;
49915084 private MenuItem copyItem;
49925085 private MenuItem pasteItem;
5086
+ private MenuItem pasteIntoItem;
49935087 private MenuItem pasteLinkItem;
49945088 private MenuItem pasteCloneItem;
49955089 private MenuItem pasteExpandItem;
....@@ -5087,7 +5181,7 @@
50875181 private MenuItem blobItem;
50885182 private MenuItem latheItem;
50895183 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5184
+ private MenuItem overlayItem;
50915185 private MenuItem meshItem;
50925186 // private MenuItem meshGroupItem;
50935187 private MenuItem springItem;