Normand Briere
2019-05-02 a7277e6c6381e55761f7fa87276260fac1c94d5e
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,17 +163,21 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,18 +185,31 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
208
+ }
191209
192210 oe.menuBar.add(menu = new Menu("Setting"));
211
+ if (Globals.ADVANCED)
212
+ {
193213 resetMeshItem = menu.add(new MenuItem("Reset All"));
194214 resetMeshItem.addActionListener(this);
195215 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -199,6 +219,7 @@
199219 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200220 resetreferencesItem.addActionListener(this);
201221 menu.add("-");
222
+ }
202223 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203224 overwriteGeoItem.addActionListener(this);
204225 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +231,26 @@
210231 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211232 overwriteUVItem.addActionListener(this);
212233 menu.add("-");
234
+ if (Globals.ADVANCED)
235
+ {
213236 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214237 generateMeshItem.addActionListener(this);
215238 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216239 poseMeshItem.addActionListener(this);
217240 menu.add("-");
241
+ }
218242 resetsupportItem = menu.add(new MenuItem("Reset support"));
219243 resetsupportItem.addActionListener(this);
220244 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221245 linkverticesItem.addActionListener(this);
222246 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223247 relinkverticesItem.addActionListener(this);
248
+
249
+ if (Globals.ADVANCED)
250
+ {
224251 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225252 setMasterItem.addActionListener(this);
253
+ }
226254
227255 oe.menuBar.add(menu = new Menu("Group"));
228256 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +261,32 @@
233261 frontItem.addActionListener(this);
234262 compositeItem = menu.add(new MenuItem("Composite"));
235263 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
264
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237265 hideItem.addActionListener(this);
238266 ungroupItem = menu.add(new MenuItem("Ungroup"));
239267 ungroupItem.addActionListener(this);
240268 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
269
+ randomItem = menu.add(new MenuItem("Switch node"));
242270 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247271 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248272 switchGeoItem.addActionListener(this);
249273 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250274 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
275
+ morphItem = menu.add(new MenuItem("Morph Group"));
252276 morphItem.addActionListener(this);
277
+
278
+ if (Globals.ADVANCED)
279
+ {
280
+ menu.add("-");
281
+ physicsItem = menu.add(new MenuItem("Physics"));
282
+ physicsItem.addActionListener(this);
283
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
284
+ frameselectorItem.addActionListener(this);
253285 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254286 scriptNodeItem.addActionListener(this);
255287 cameraItem = menu.add(new MenuItem("Camera"));
256288 cameraItem.addActionListener(this);
289
+ }
257290
258291 oe.menuBar.add(menu = new Menu("Object"));
259292 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,14 +301,18 @@
268301 shadowYItem.addActionListener(this);
269302 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270303 shadowZItem.addActionListener(this);
304
+ if (Globals.ADVANCED)
305
+ {
306
+ menu.add("-");
271307 linkerItem = menu.add(new MenuItem("Linker"));
272308 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275309 attributeItem = menu.add(new MenuItem("Attribute"));
276310 attributeItem.addActionListener(this);
311
+ templateItem = menu.add(new MenuItem("Template"));
312
+ templateItem.addActionListener(this);
277313 pointflowItem = menu.add(new MenuItem("Point Flow"));
278314 pointflowItem.addActionListener(this);
315
+ }
279316 menu.add("-");
280317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281318 resetTransformItem.addActionListener(this);
....@@ -293,8 +330,11 @@
293330 genNormalsCADItem.addActionListener(this);
294331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
296335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297336 genNormalsMINEItem.addActionListener(this);
337
+ }
298338 stripifyItem = menu.add(new MenuItem("Stripify"));
299339 stripifyItem.addActionListener(this);
300340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,10 +356,14 @@
316356 reduce34MeshItem.addActionListener(this);
317357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318358 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
323367
324368 oe.menuBar.add(menu = new Menu("Attributes"));
325369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -329,10 +373,13 @@
329373 liveleavesItem.addActionListener(this);
330374 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331375 unliveleavesItem.addActionListener(this);
376
+ if (Globals.ADVANCED)
377
+ {
332378 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333379 supportleavesItem.addActionListener(this);
334380 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335381 unsupportleavesItem.addActionListener(this);
382
+ }
336383 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337384 hideleavesItem.addActionListener(this);
338385 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -375,6 +422,8 @@
375422 sortbysizeItem.addActionListener(this);
376423 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377424 sortbynameItem.addActionListener(this);
425
+ if (Globals.ADVANCED)
426
+ {
378427 menu.add("-");
379428 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380429 extractGeometriesItem.addActionListener(this);
....@@ -384,11 +433,11 @@
384433 shareGeometriesItem.addActionListener(this);
385434 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386435 mergeGeometriesItem.addActionListener(this);
436
+ }
387437
388438 oe.menuBar.add(menu = new Menu("Insert"));
389439 buildCreateMenu(menu);
390440
391
-
392441 oe.menuBar.add(menu = new Menu("Include"));
393442 importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394443 importGFDItem.addActionListener(this);
....@@ -433,153 +482,98 @@
433482 oe.radioPanel.add(dummyButton);
434483 oe.buttonGroup.add(dummyButton);
435484 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
485
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439486
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
487
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
488
+ liveCB.setToolTipText("Enabled animation");
441489 liveCB.addItemListener(this);
442490
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", CameraPane.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);
491
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ oneStepButton.setToolTipText("Animate one step forward");
493
+ oneStepButton.addActionListener(this);
494
+
495
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
496
+ fastCB.setToolTipText("Fast mode");
461497 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);
498
+
499
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
500
+ trackCB.setToolTipText("Enable tracking");
503501 trackCB.addItemListener(this);
504502
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
503
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ screenfitButton.setToolTipText("Screen fit");
507505 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
506
+
509507 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510508 // 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;
515509
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);
510
+ if (Globals.ADVANCED)
511
+ {
512
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
+ snapobjectButton.addActionListener(this);
514
+ snapobjectButton.setToolTipText("Snap Object");
515
+ }
516
+
517
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
518
+ flashSelectionButton.setToolTipText("Show selection");
522519 flashSelectionButton.addActionListener(this);
523520
524
- oe.toolbarPanel.add(new cButton(" ", false));
521
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525522
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);
523
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
524
+ twoButton.setToolTipText("Show center view only");
532525 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534527 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
528
+ fourButton.setToolTipText("Show left panel only");
529
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
530
+ sixButton.setToolTipText("2-column layout left");
536531 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
533
+ threeButton.setToolTipText("2-column layout right");
538534 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
536
+ sevenButton.setToolTipText("3-column layout");
540537 sevenButton.addActionListener(this);
541538 //
542539
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
541
+ rootButton.setToolTipText("Edit selection in new tab");
544542 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
543
+
544
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
545
+ closeButton.setToolTipText("Close tab");
547546 closeButton.addActionListener(this);
548547 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549548 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551549
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
550
+ cGridBag commandsPanel = new cGridBag();
551
+
552
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
553
+ editButton.setToolTipText("Edit selection");
554554 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558555
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
556
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557
+ uneditButton.setToolTipText("Unedit selection");
560558 uneditButton.addActionListener(this);
561559
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);
560
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
561
+ allParamsButton.setToolTipText("Edit all params");
574562 allParamsButton.addActionListener(this);
575563
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);
564
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
565
+ clearPanelButton.setToolTipText("Clear edit panel");
566
+ clearPanelButton.addActionListener(this);
567
+
568
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
569
+ unselectButton.setToolTipText("Unselect");
581570 unselectButton.addActionListener(this);
582571
572
+ commandsPanel.preferredHeight = 1;
573
+
574
+ oe.treePanel.add(commandsPanel);
575
+ oe.treePanel.Return();
576
+
583577 // oe.aConstraints.gridx += 1;
584578 // oe.aConstraints.weighty = 0;
585579 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +585,37 @@
591585 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592586 // gcButton.addActionListener(this);
593587
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;
588
+ cGridBag jSPPanel = new cGridBag();
589
+
590
+ JScrollPane jSP;
605591 //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);
592
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607593 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
594
+
595
+ oe.treePanel.add(jSPPanel);
596
+ oe.treePanel.Return();
612597
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);
598
+ cGridBag copyOptionsPanel = new cGridBag();
599
+
600
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
601
+ colorCB.setToolTipText("Copy color when dropped");
617602 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
603
+
604
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
605
+ materialCB.setToolTipText("Copy material when dropped");
620606 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
607
+
608
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
609
+ textureCB.setToolTipText("Copy texture when dropped");
623610 textureCB.addItemListener(this);
624611
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
612
+ copyOptionsPanel.preferredHeight = 1;
613
+ oe.treePanel.add(copyOptionsPanel);
614
+ oe.treePanel.Return();
627615
616
+// mainPanel.setDividerLocation(0.5); //1.0);
617
+// mainPanel.setResizeWeight(0.5);
618
+
628619 //jList.addListSelectionListener(this);
629620 oe.jTree.addTreeSelectionListener(this);
630621 //jTree.setRootVisible(false);
....@@ -646,6 +637,78 @@
646637 radio.layout = sevenButton;
647638 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648639 }
640
+
641
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
642
+ {
643
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
644
+ boxCB.setToolTipText("Display bounding boxes");
645
+ boxCB.addItemListener(this);
646
+
647
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
648
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
649
+ zoomBoxCB.addItemListener(this);
650
+
651
+ if (Globals.ADVANCED)
652
+ {
653
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
654
+ supportCB.setToolTipText("Enable rigging");
655
+ supportCB.addItemListener(this);
656
+
657
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
658
+ // localCB.addItemListener(this);
659
+
660
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
661
+ crowdCB.setToolTipText("Used for crowds");
662
+ crowdCB.addItemListener(this);
663
+
664
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
665
+ smoothCB.setToolTipText("Snapping delay");
666
+ smoothCB.addItemListener(this);
667
+
668
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
669
+ slowCB.setToolTipText("Smooth interpolation");
670
+ slowCB.addItemListener(this);
671
+
672
+// constraints.gridy += 1;
673
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
674
+// speakerMocapCB.addItemListener(this);
675
+
676
+ if (false)
677
+ {
678
+ // handled in scripts
679
+ //constraints.gridy += 1;
680
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
681
+ speakerCameraCB.addItemListener(this);
682
+
683
+ //constraints.gridy += 1;
684
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
685
+ speakerFocusCB.addItemListener(this);
686
+
687
+ //constraints.gridy += 1;
688
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
689
+ smoothfocusCB.addItemListener(this);
690
+ }
691
+
692
+//constraints.gridx += 1;
693
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
694
+// debugCB.addItemListener(this);
695
+
696
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
697
+ oeilCB.addItemListener(this);
698
+
699
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
700
+ lookAtCB.setToolTipText("Look-at target");
701
+ lookAtCB.addItemListener(this);
702
+
703
+ }
704
+
705
+ cGridBag fill = new cGridBag();
706
+
707
+ fill.preferredHeight = 200;
708
+
709
+ panel.add(fill);
710
+
711
+ }
649712
650713 void EditObject(Object3D obj)
651714 {
....@@ -676,6 +739,7 @@
676739 JCheckBox fastCB;
677740 JCheckBox slowCB;
678741 JCheckBox boxCB;
742
+ JCheckBox zoomBoxCB;
679743 JCheckBox trackCB;
680744 JCheckBox smoothfocusCB;
681745 // JCheckBox speakerMocapCB;
....@@ -755,6 +819,10 @@
755819 Recompile();
756820 cameraView.repaint();
757821 // refreshContents();
822
+ }
823
+ else if(e.getSource() == zoomBoxCB)
824
+ {
825
+ cameraView.ToggleZoomBoxMode();
758826 }
759827 else if(e.getSource() == smoothfocusCB)
760828 {
....@@ -923,11 +991,11 @@
923991 {
924992 loadClipboard(true);
925993 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
994
+ pasteInto(false, false);
927995 } else {
928996 loadClipboard(false);
929997 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
998
+ pasteInto(false, false); // true); // ???
931999 }
9321000 }
9331001 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1117,33 @@
10491117 kleinItem.addActionListener(this);
10501118 particleItem = menu.add(new MenuItem("Particle system"));
10511119 particleItem.addActionListener(this);
1120
+ if (Globals.ADVANCED)
1121
+ {
10521122 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531123 ragdollItem.addActionListener(this);
10541124 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551125 ragdoll2Item.addActionListener(this);
1126
+ }
10561127 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1128
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581129 meshItem.addActionListener(this);
10591130 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601131 // meshGroupItem.addActionListener(this);
1132
+ if (Globals.ADVANCED)
1133
+ {
10611134 springItem = menu.add(new MenuItem("Spring"));
10621135 springItem.addActionListener(this);
10631136 flagItem = menu.add(new MenuItem("Flag"));
10641137 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);
10691138 blobItem = menu.add(new MenuItem("Blob"));
10701139 blobItem.addActionListener(this);
10711140 latheItem = menu.add(new MenuItem("Lathe"));
10721141 latheItem.addActionListener(this);
1142
+ }
1143
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1144
+ bezierItem.addActionListener(this);
1145
+ overlayItem = menu.add(new MenuItem("Overlay"));
1146
+ overlayItem.addActionListener(this);
10731147 lightItem = menu.add(new MenuItem("Light"));
10741148 lightItem.addActionListener(this);
10751149 menu.add("-");
....@@ -1079,34 +1153,39 @@
10791153 loopItem.addActionListener(this);
10801154 doubleItem = menu.add(new MenuItem("Fork"));
10811155 doubleItem.addActionListener(this);
1156
+ if (Globals.ADVANCED)
1157
+ {
10821158 tripleItem = menu.add(new MenuItem("Trident"));
10831159 tripleItem.addActionListener(this);
1160
+ }
10841161 }
10851162
10861163 void buildToolsMenu(Menu menu)
10871164 {
10881165 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891166 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1167
+ animationItem.setState(Globals.ANIMATION);
10911168
10921169 menu.add("-");
10931170 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941171 parseverticesItem.addActionListener(this);
10951172 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961173 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1174
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981175 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011176 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021177 reduceMorphItem.addActionListener(this);
11031178 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041179 reduce34MorphItem.addActionListener(this);
1105
-
1180
+ menu.add("-");
11061181 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071182 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091183
1184
+ if (Globals.ADVANCED)
1185
+ {
1186
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1187
+ mirrorItem.addActionListener(this);
1188
+ menu.add("-");
11101189 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111190 memoryItem.addActionListener(this);
11121191 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1129,6 +1208,7 @@
11291208 menu.add("-");
11301209 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311210 editScriptItem.addActionListener(this);
1211
+ }
11321212 }
11331213
11341214 void ScreenFit()
....@@ -1482,6 +1562,7 @@
14821562 //
14831563 public void actionPerformed(ActionEvent event) // , Object arg)
14841564 {
1565
+ Object source = event.getSource();
14851566 /*
14861567 if (event.getSource() == nameField)
14871568 {
....@@ -1493,11 +1574,11 @@
14931574 }
14941575 else
14951576 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1577
+ if (source == lookAtItem || source == lookFromItem)
14971578 {
14981579 ScreenFit();
14991580 } else
1500
- if (event.getSource() == switchItem)
1581
+ if (source == switchItem)
15011582 {
15021583 cVector v1 = new cVector();
15031584 cVector v2 = new cVector();
....@@ -1506,11 +1587,11 @@
15061587 objEditor.cameraView.renderCamera.setAim(v2, v1);
15071588 objEditor.cameraView.repaint();
15081589 } else
1509
- if (event.getSource() == rectoidItem)
1590
+ if (source == rectoidItem)
15101591 {
15111592 makeSomething(new Box());
15121593 } else
1513
- if (event.getSource() == particleItem)
1594
+ if (source == particleItem)
15141595 {
15151596 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15161597 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +1612,9 @@
15311612 applyExample(particleGeom, "SMOKE");
15321613 makeSomething(particleGeom);
15331614 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1615
+ if (source == ragdollItem || source == ragdoll2Item)
15351616 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1617
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15371618
15381619 ragdoll.toParent = LA.newMatrix();
15391620 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +1632,7 @@
15511632 } else
15521633 /*
15531634 */
1554
- if (event.getSource() == heightFieldItem)
1635
+ if (source == heightFieldItem)
15551636 {
15561637 Object3D obj = new Object3D();
15571638
....@@ -1589,31 +1670,31 @@
15891670
15901671 makeSomething(obj);
15911672 } else
1592
- if (event.getSource() == gridItem)
1673
+ if (source == gridItem)
15931674 {
15941675 makeSomething(new Grid());
15951676 } else
1596
- if (event.getSource() == ellipsoidItem)
1677
+ if (source == ellipsoidItem)
15971678 {
15981679 makeSomething(new Sphere());
15991680 } else
1600
- if (event.getSource() == coneItem)
1681
+ if (source == coneItem)
16011682 {
16021683 makeSomething(new Cone());
16031684 } else
1604
- if (event.getSource() == torusItem)
1685
+ if (source == torusItem)
16051686 {
16061687 makeSomething(new Torus());
16071688 } else
1608
- if (event.getSource() == superItem)
1689
+ if (source == superItem)
16091690 {
16101691 makeSomething(new Superellipsoid());
16111692 } else
1612
- if (event.getSource() == kleinItem)
1693
+ if (source == kleinItem)
16131694 {
16141695 makeSomething(new Klein());
16151696 } else
1616
- if (event.getSource() == blobItem)
1697
+ if (source == blobItem)
16171698 {
16181699 Blob blob = new Blob();
16191700 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +1702,15 @@
16211702 //blob.retile();
16221703 makeSomething(blob);
16231704 } else
1624
- if (event.getSource() == latheItem)
1705
+ if (source == latheItem)
16251706 {
16261707 makeSomething(new Lathe());
16271708 } else
1628
- if (event.getSource() == bezierItem)
1709
+ if (source == bezierItem)
16291710 {
16301711 makeSomething(new BezierSurface());
16311712 } else
1632
- if (event.getSource() == checkerItem)
1713
+ if (source == overlayItem)
16331714 {
16341715 /*
16351716 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +1725,7 @@
16441725 */
16451726 makeSomething(new Checker());
16461727 } else
1647
- if (event.getSource() == meshItem)
1728
+ if (source == meshItem)
16481729 {
16491730 Object3D itemtomake = new Object3D();
16501731 Object3D child;
....@@ -1665,35 +1746,35 @@
16651746 makeSomething(child);
16661747 }
16671748 } else
1668
- if (event.getSource() == springItem)
1749
+ if (source == springItem)
16691750 {
16701751 cSpring s = new cSpring();
16711752 s.setup();
16721753 makeSomething(s);
16731754 } else
1674
- if (event.getSource() == flagItem)
1755
+ if (source == flagItem)
16751756 {
16761757 cSpring s = new cFlag();
16771758 s.setup();
16781759 makeSomething(s);
16791760 } else
1680
- if (event.getSource() == lightItem)
1761
+ if (source == lightItem)
16811762 {
16821763 makeSomething(new Light());
16831764 } else
1684
- if (event.getSource() == csgItem)
1765
+ if (source == csgItem)
16851766 {
16861767 group(new CSG());
16871768 } else
1688
- if (event.getSource() == templateItem)
1769
+ if (source == templateItem)
16891770 {
16901771 group(new cTemplate());
16911772 } else
1692
- if (event.getSource() == attributeItem)
1773
+ if (source == attributeItem)
16931774 {
16941775 makeSomething(new Attribute());
16951776 } else
1696
- if (event.getSource() == pointflowItem)
1777
+ if (source == pointflowItem)
16971778 {
16981779 makeSomething(new PointFlow());
16991780 } else
....@@ -1705,7 +1786,7 @@
17051786 } else
17061787 */
17071788
1708
- if (event.getSource() == superLoopItem)
1789
+ if (source == superLoopItem)
17091790 {
17101791 Composite g = new cGroup();
17111792 for (int i=0; i<15; i++)
....@@ -1727,7 +1808,7 @@
17271808
17281809 group(g);
17291810 } else
1730
- if (event.getSource() == loopItem)
1811
+ if (source == loopItem)
17311812 {
17321813 Composite csg = new GroupLeaf();
17331814 csg.count = 5;
....@@ -1736,7 +1817,7 @@
17361817 csg.addChild(child);
17371818 child.addChild(csg);
17381819 } else
1739
- if (event.getSource() == doubleItem)
1820
+ if (source == doubleItem)
17401821 {
17411822 Composite csg = new GroupLeaf();
17421823 csg.count = 5;
....@@ -1748,7 +1829,7 @@
17481829 csg.addChild(child);
17491830 child.addChild(csg);
17501831 } else
1751
- if (event.getSource() == tripleItem)
1832
+ if (source == tripleItem)
17521833 {
17531834 Composite csg = new GroupLeaf();
17541835 csg.count = 4;
....@@ -1764,70 +1845,75 @@
17641845 child.addChild(csg);
17651846 } else
17661847
1767
- if (event.getSource() == importGFDItem)
1848
+ if (source == importGFDItem)
17681849 {
17691850 ImportGFD();
17701851 } else
1771
- if (event.getSource() == importVRMLX3DItem)
1852
+ if (source == importVRMLX3DItem)
17721853 {
17731854 ImportVRMLX3D();
17741855 } else
1775
- if (event.getSource() == import3DSItem)
1856
+ if (source == import3DSItem)
17761857 {
17771858 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17781859 } else
1779
- if (event.getSource() == importOBJItem)
1860
+ if (source == importOBJItem)
17801861 {
17811862 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17821863 } else
1783
- if (event.getSource() == computeAOItem)
1864
+ if (source == computeAOItem)
17841865 {
1785
- CameraPane.drawMode = CameraPane.OCCLUSION;
1786
- CameraPane.theRenderer.repaint();
1866
+ Globals.drawMode = CameraPane.OCCLUSION;
1867
+ Globals.theRenderer.repaint();
17871868 } else
1788
- if (event.getSource() == recompileItem)
1869
+ if (source == recompileItem)
17891870 {
17901871 Recompile();
17911872 refreshContents();
17921873 } else
1793
- if (event.getSource() == editScriptItem)
1874
+ if (source == editScriptItem)
17941875 {
17951876 OpenDialog();
17961877 refreshContents();
17971878 } else
1798
- if (event.getSource() == invariantsItem)
1879
+ if (source == invariantsItem)
17991880 {
18001881 System.out.println("Invariants:");
18011882 GrafreeD.grafreeD.universe.invariants();
18021883 } else
1803
- if (event.getSource() == memoryItem)
1884
+ if (source == memoryItem)
18041885 {
18051886 //System.out.println("Invariants:");
18061887 PrintMemory();
18071888 } else
1808
- if (event.getSource() == pathItem)
1889
+ if (source == pathItem)
18091890 {
18101891 PrintPath();
18111892 } else
1812
- if (event.getSource() == analyzeItem)
1893
+ if (source == analyzeItem)
18131894 {
18141895 AnalyzeObject();
18151896 } else
1816
- if (event.getSource() == dumpItem)
1897
+ if (source == dumpItem)
18171898 {
18181899 DumpObject();
18191900 } else
1820
- if (event.getSource() == screenfitButton)
1901
+ if (source == oneStepButton)
1902
+ {
1903
+ Globals.ONESTEP = true;
1904
+ cameraView.repaint();
1905
+ } else
1906
+ if (source == screenfitButton)
18211907 {
18221908 //Reload(lastConverter, lastFilename, true);
18231909 ScreenFit();
18241910 } else
1825
- if (event.getSource() == screenfitpointButton)
1911
+ if (source == screenfitpointButton)
18261912 {
18271913 //Reload(lastConverter, lastFilename, true);
18281914 ScreenFitPoint();
18291915 } else
1830
- if (event.getSource() == snapobjectButton)
1916
+ if (source == snapobjectButton)
18311917 {
18321918 //Reload(lastConverter, lastFilename, true);
18331919 SnapObject();
....@@ -1838,13 +1924,13 @@
18381924 // Recompile();
18391925 // refreshContents();
18401926 // } else
1841
- if (event.getSource() == gcButton)
1927
+ if (source == gcButton)
18421928 {
18431929 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441930 System.gc();
18451931 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18461932 } else
1847
- if (event.getSource() == editLeafItem)
1933
+ if (source == editLeafItem)
18481934 {
18491935 Object3D obj;
18501936 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +1944,66 @@
18581944 }
18591945 refreshContents(true);
18601946 } else
1861
- if (event.getSource() == openWindowItem)
1947
+ if (source == openWindowItem)
18621948 {
18631949 EditSelection(true);
18641950 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1951
+ if (source == cutItem || source == clearButton)
18661952 {
18671953 loadClipboard(true);
18681954 } else
1869
- if (event.getSource() == duplicateItem)
1955
+ if (source == duplicateItem)
18701956 {
18711957 Object3D keep = GrafreeD.clipboard;
18721958 loadClipboard(false);
18731959 paste(false);
18741960 GrafreeD.clipboard = keep;
18751961 } else
1876
- if (event.getSource() == cloneItem)
1962
+ if (source == cloneItem)
18771963 {
18781964 CloneSelection(false);
18791965 } else
1880
- if (event.getSource() == cloneSupportItem)
1966
+ if (source == cloneSupportItem)
18811967 {
18821968 CloneSelection(true);
18831969 } else
1884
- if (event.getSource() == copyItem)
1970
+ if (source == copyItem)
18851971 {
18861972 loadClipboard(false);
18871973 } else
1888
- if (event.getSource() == pasteItem)
1974
+ if (source == pasteItem)
18891975 {
18901976 paste(false);
18911977 } else
1892
- if (event.getSource() == pasteLinkItem)
1978
+ if (source == pasteIntoItem)
18931979 {
1894
- pasteInto(false);
1980
+ pasteInto(true, false);
18951981 } else
1896
- if (event.getSource() == pasteCloneItem)
1982
+ if (source == pasteLinkItem)
18971983 {
1898
- pasteInto(true);
1984
+ pasteInto(false, false);
18991985 } else
1900
- if (event.getSource() == pasteExpandItem)
1986
+ if (source == pasteCloneItem)
1987
+ {
1988
+ pasteInto(true, true);
1989
+ } else
1990
+ if (source == pasteExpandItem)
19011991 {
19021992 paste(true);
19031993 } else
1904
- if (event.getSource() == synchronizeItem)
1994
+ if (source == synchronizeItem)
19051995 {
19061996 Overwrite(Object3D.TRANSFORM);
19071997 } else
1908
- if (event.getSource() == overwriteNameItem)
1998
+ if (source == overwriteNameItem)
19091999 {
19102000 Overwrite(Object3D.NAME);
19112001 } else
1912
- if (event.getSource() == overwriteUVItem)
2002
+ if (source == overwriteUVItem)
19132003 {
19142004 Overwrite(Object3D.UV);
19152005 } else
1916
- if (event.getSource() == overwriteMatItem)
2006
+ if (source == overwriteMatItem)
19172007 {
19182008 /* july 2015
19192009 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2023,7 @@
19332023
19342024 Overwrite(dropAttributes);
19352025 }
1936
- if (event.getSource() == overwriteGeoItem)
2026
+ if (source == overwriteGeoItem)
19372027 {
19382028 Overwrite(Object3D.GEOMETRY);
19392029 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2040,7 @@
19502040 // refreshContents();
19512041 // }
19522042 } else
1953
- if (event.getSource() == generateMeshItem)
2043
+ if (source == generateMeshItem)
19542044 {
19552045 //if (group.selection.size() == 1)
19562046 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2051,7 @@
19612051 ResetModel();
19622052 refreshContents();
19632053 } else
1964
- if (event.getSource() == extractGeometriesItem)
2054
+ if (source == extractGeometriesItem)
19652055 {
19662056 boolean one = false;
19672057
....@@ -1988,7 +2078,7 @@
19882078 ResetModel();
19892079 refreshContents();
19902080 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2081
+ if (source == cloneGeometriesItem)
19922082 {
19932083 boolean one = false;
19942084
....@@ -2014,7 +2104,7 @@
20142104 ResetModel();
20152105 refreshContents();
20162106 } else
2017
- if (event.getSource() == shareGeometriesItem)
2107
+ if (source == shareGeometriesItem)
20182108 {
20192109 boolean one = false;
20202110
....@@ -2044,7 +2134,7 @@
20442134 refreshContents();
20452135 }
20462136 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2137
+ if (source == mergeGeometriesItem)
20482138 {
20492139 boolean one = false;
20502140
....@@ -2074,7 +2164,7 @@
20742164 ResetModel();
20752165 refreshContents();
20762166 } else
2077
- if (event.getSource() == linkverticesItem)
2167
+ if (source == linkverticesItem)
20782168 {
20792169 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802170 // {
....@@ -2094,41 +2184,41 @@
20942184 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952185 content = ((cGroup)content).get(0);
20962186
2097
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2187
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982188 for (int i=0; i<group.selection.size(); i++)
20992189 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2190
+ boolean random = CameraPane.SWITCH;
2191
+ CameraPane.SWITCH = false; // parse all random nodes
21022192 group.selection.get(i).linkVerticesThis(content);
21032193 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2194
+ CameraPane.SWITCH = random;
21052195 }
2106
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2196
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072197 refreshContents();
21082198 }
21092199 } else
2110
- if (event.getSource() == resetsupportItem)
2200
+ if (source == resetsupportItem)
21112201 {
21122202 for (int i=0; i<group.selection.size(); i++)
21132203 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2204
+ boolean random = CameraPane.SWITCH;
2205
+ CameraPane.SWITCH = false; // parse all random nodes
21162206 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
21182208 }
21192209
21202210 refreshContents();
21212211 } else
2122
- if (event.getSource() == relinkverticesItem)
2212
+ if (source == relinkverticesItem)
21232213 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2214
+ boolean random = CameraPane.SWITCH;
2215
+ CameraPane.SWITCH = false; // parse all random nodes
21262216 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2217
+ CameraPane.SWITCH = random;
21282218
21292219 refreshContents();
21302220 } else
2131
- if (event.getSource() == resetreferencesItem)
2221
+ if (source == resetreferencesItem)
21322222 {
21332223 for (int i=0; i<group.selection.size(); i++)
21342224 {
....@@ -2137,7 +2227,7 @@
21372227
21382228 refreshContents();
21392229 } else
2140
- if (event.getSource() == setMasterItem)
2230
+ if (source == setMasterItem)
21412231 {
21422232 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21432233 {
....@@ -2150,7 +2240,7 @@
21502240 refreshContents();
21512241 }
21522242 } else
2153
- if (event.getSource() == poseMeshItem)
2243
+ if (source == poseMeshItem)
21542244 {
21552245 if (group.selection.size() == 1)
21562246 {
....@@ -2169,19 +2259,19 @@
21692259 }
21702260
21712261 } else
2172
- if (event.getSource() == revertMeshItem)
2262
+ if (source == revertMeshItem)
21732263 {
21742264 RevertMeshes();
21752265 } else
2176
- if (event.getSource() == resetMeshItem)
2266
+ if (source == resetMeshItem)
21772267 {
21782268 ResetAll();
21792269 } else
2180
- if (event.getSource() == stepAllItem)
2270
+ if (source == stepAllItem)
21812271 {
21822272 StepAll();
21832273 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2274
+ if (source == clearItem) // || event.getSource() == clearButton)
21852275 {
21862276 //int indices[] = jList.getSelectedIndices();
21872277 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2279,46 @@
21892279
21902280 ClearSelection(false);
21912281 } else
2192
- if (event.getSource() == clearAllItem)
2282
+ if (source == clearAllItem)
21932283 {
21942284 ClearSelection(true);
21952285 } else
2196
- if (event.getSource() == grabItem)
2286
+ if (source == grabItem)
21972287 {
21982288 group(new cGroup(), true);
21992289 } else
2200
- if (event.getSource() == hideItem)
2290
+ if (source == hideItem)
22012291 {
22022292 group(new HiddenObject());
22032293 } else
2204
- if (event.getSource() == frontItem)
2294
+ if (source == frontItem)
22052295 {
22062296 front();
22072297 } else
2208
- if (event.getSource() == backItem)
2298
+ if (source == backItem)
22092299 {
22102300 back();
22112301 } else
2212
- if (event.getSource() == cameraItem)
2302
+ if (source == cameraItem)
22132303 {
22142304 makeSomething(new Camera());
22152305 } else
2216
- if (event.getSource() == compositeItem)
2306
+ if (source == compositeItem)
22172307 {
22182308 group(new Composite());
22192309 } else
2220
- if (event.getSource() == randomItem)
2310
+ if (source == randomItem)
22212311 {
22222312 RandomNode random = new RandomNode();
22232313 group(random);
22242314 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
2315
+ random.name = random.get(0).name + "Switch";
22262316 } else
2227
- if (event.getSource() == physicsItem)
2317
+ if (source == physicsItem)
22282318 {
22292319 group(new PhysicsNode());
22302320 } else
2231
- if (event.getSource() == frameselectorItem)
2321
+ if (source == frameselectorItem)
22322322 {
22332323 for (int i=0; i<group.selection.size(); i++)
22342324 {
....@@ -2240,7 +2330,7 @@
22402330 ResetModel();
22412331 refreshContents();
22422332 } else
2243
- if (event.getSource() == switchGeoItem)
2333
+ if (source == switchGeoItem)
22442334 {
22452335 for (int i=0; i<group.selection.size(); i++)
22462336 {
....@@ -2252,7 +2342,7 @@
22522342 ResetModel();
22532343 refreshContents();
22542344 } else
2255
- if (event.getSource() == switchTransfoItem)
2345
+ if (source == switchTransfoItem)
22562346 {
22572347 for (int i=0; i<group.selection.size(); i++)
22582348 {
....@@ -2264,7 +2354,7 @@
22642354 ResetModel();
22652355 refreshContents();
22662356 } else
2267
- if (event.getSource() == morphItem)
2357
+ if (source == morphItem)
22682358 {
22692359 for (int i=0; i<group.selection.size(); i++)
22702360 {
....@@ -2276,7 +2366,7 @@
22762366 ResetModel();
22772367 refreshContents();
22782368 } else
2279
- if (event.getSource() == scriptNodeItem)
2369
+ if (source == scriptNodeItem)
22802370 {
22812371 boolean atleastone = false;
22822372
....@@ -2315,31 +2405,31 @@
23152405 }
23162406 }
23172407 } else
2318
- if (event.getSource() == linkerItem)
2408
+ if (source == linkerItem)
23192409 {
23202410 group(new cLinker());
23212411 } else
2322
- if (event.getSource() == textureItem)
2412
+ if (source == textureItem)
23232413 {
23242414 group(new TextureNode());
23252415 } else
2326
- if (event.getSource() == billboardItem)
2416
+ if (source == billboardItem)
23272417 {
23282418 group(new BillboardNode());
23292419 } else
2330
- if (event.getSource() == shadowXItem)
2420
+ if (source == shadowXItem)
23312421 {
23322422 CastShadow(0);
23332423 } else
2334
- if (event.getSource() == shadowYItem)
2424
+ if (source == shadowYItem)
23352425 {
23362426 CastShadow(1);
23372427 } else
2338
- if (event.getSource() == shadowZItem)
2428
+ if (source == shadowZItem)
23392429 {
23402430 CastShadow(2);
23412431 } else
2342
- if (event.getSource() == ungroupItem)
2432
+ if (source == ungroupItem)
23432433 {
23442434 //ungroup();
23452435 for (int i=0; i<group.selection.size(); i++)
....@@ -2351,179 +2441,179 @@
23512441
23522442 refreshContents();
23532443 } else
2354
- if (event.getSource() == genUVItem)
2444
+ if (source == genUVItem)
23552445 {
23562446 GenUV();
23572447 } else
2358
- if (event.getSource() == genNormalsCADItem)
2448
+ if (source == genNormalsCADItem)
23592449 {
23602450 GenNormals(true);
23612451 } else
2362
- if (event.getSource() == genNormalsMESHItem)
2452
+ if (source == genNormalsMESHItem)
23632453 {
23642454 GenNormals(true); // TODO
23652455 } else
2366
- if (event.getSource() == genNormalsORGANItem)
2456
+ if (source == genNormalsORGANItem)
23672457 {
23682458 GenNormals(false);
23692459 } else
2370
- if (event.getSource() == genNormalsMINEItem)
2460
+ if (source == genNormalsMINEItem)
23712461 {
23722462 GenNormalsMINE();
23732463 } else
2374
- if (event.getSource() == stripifyItem)
2464
+ if (source == stripifyItem)
23752465 {
23762466 Stripify();
23772467 } else
2378
- if (event.getSource() == unstripifyItem)
2468
+ if (source == unstripifyItem)
23792469 {
23802470 Unstripify();
23812471 } else
2382
- if (event.getSource() == trimItem)
2472
+ if (source == trimItem)
23832473 {
23842474 Trim();
23852475 } else
2386
- if (event.getSource() == untrimItem)
2476
+ if (source == untrimItem)
23872477 {
23882478 Untrim();
23892479 } else
2390
- if (event.getSource() == clearColorsItem)
2480
+ if (source == clearColorsItem)
23912481 {
23922482 ClearColors();
23932483 } else
2394
- if (event.getSource() == clearMaterialsItem)
2484
+ if (source == clearMaterialsItem)
23952485 {
23962486 ClearMaterials();
23972487 } else
2398
- if (event.getSource() == liveleavesItem)
2488
+ if (source == liveleavesItem)
23992489 {
24002490 LiveLeaves(true);
24012491 } else
2402
- if (event.getSource() == unliveleavesItem)
2492
+ if (source == unliveleavesItem)
24032493 {
24042494 LiveLeaves(false);
24052495 } else
2406
- if (event.getSource() == supportleavesItem)
2496
+ if (source == supportleavesItem)
24072497 {
24082498 SupportLeaves(true);
24092499 } else
2410
- if (event.getSource() == unsupportleavesItem)
2500
+ if (source == unsupportleavesItem)
24112501 {
24122502 SupportLeaves(false);
24132503 } else
2414
- if (event.getSource() == hideleavesItem)
2504
+ if (source == hideleavesItem)
24152505 {
24162506 HideLeaves(true);
24172507 } else
2418
- if (event.getSource() == showleavesItem)
2508
+ if (source == showleavesItem)
24192509 {
24202510 HideLeaves(false);
24212511 } else
2422
- if (event.getSource() == markleavesItem)
2512
+ if (source == markleavesItem)
24232513 {
24242514 MarkLeaves(true);
24252515 } else
2426
- if (event.getSource() == unmarkleavesItem)
2516
+ if (source == unmarkleavesItem)
24272517 {
24282518 MarkLeaves(false);
24292519 } else
2430
- if (event.getSource() == flipVItem)
2520
+ if (source == flipVItem)
24312521 {
24322522 FlipV(true);
24332523 } else
2434
- if (event.getSource() == unflipVItem)
2524
+ if (source == unflipVItem)
24352525 {
24362526 FlipV(false);
24372527 } else
2438
- if (event.getSource() == lowTexturesItem)
2528
+ if (source == lowTexturesItem)
24392529 {
24402530 SetTexRes(0);
24412531 } else
2442
- if (event.getSource() == normalTexturesItem)
2532
+ if (source == normalTexturesItem)
24432533 {
24442534 SetTexRes(1);
24452535 } else
2446
- if (event.getSource() == highTexturesItem)
2536
+ if (source == highTexturesItem)
24472537 {
24482538 SetTexRes(2);
24492539 } else
2450
- if (event.getSource() == veryhighTexturesItem)
2540
+ if (source == veryhighTexturesItem)
24512541 {
24522542 SetTexRes(3);
24532543 } else
2454
- if (event.getSource() == maxTexturesItem)
2544
+ if (source == maxTexturesItem)
24552545 {
24562546 SetTexRes(4);
24572547 } else
2458
- if (event.getSource() == panoTexturesItem)
2548
+ if (source == panoTexturesItem)
24592549 {
24602550 SetTexRes(5);
24612551 } else
2462
- if (event.getSource() == reverseNormalsItem)
2552
+ if (source == reverseNormalsItem)
24632553 {
24642554 ReverseNormals();
24652555 } else
2466
- if (event.getSource() == parseverticesItem)
2556
+ if (source == parseverticesItem)
24672557 {
24682558 ParseVertices();
24692559 } else
2470
- if (event.getSource() == textureFieldItem)
2560
+ if (source == textureFieldItem)
24712561 {
24722562 TextureVertices();
24732563 } else
2474
- if (event.getSource() == alignItem)
2564
+ if (source == alignItem)
24752565 {
24762566 Align();
24772567 } else
2478
- if (event.getSource() == mirrorItem)
2568
+ if (source == mirrorItem)
24792569 {
24802570 MirrorPoses();
24812571 } else
2482
- if (event.getSource() == reduceMorphItem)
2572
+ if (source == reduceMorphItem)
24832573 {
24842574 MeshReduction(false);
24852575 } else
2486
- if (event.getSource() == reduce34MorphItem)
2576
+ if (source == reduce34MorphItem)
24872577 {
24882578 MeshReduction(true);
24892579 } else
2490
- if (event.getSource() == reverseTrianglesItem)
2580
+ if (source == reverseTrianglesItem)
24912581 {
24922582 ReverseTriangles();
24932583 } else
2494
- if (event.getSource() == reduceMeshItem)
2584
+ if (source == reduceMeshItem)
24952585 {
24962586 ReduceMesh(false);
24972587 } else
2498
- if (event.getSource() == reduce34MeshItem)
2588
+ if (source == reduce34MeshItem)
24992589 {
25002590 ReduceMesh(true);
25012591 } else
2502
- if (event.getSource() == increaseMeshItem)
2592
+ if (source == increaseMeshItem)
25032593 {
25042594 IncreaseMesh();
25052595 } else
2506
- if (event.getSource() == clipMeshItem)
2596
+ if (source == clipMeshItem)
25072597 {
25082598 ClipMesh();
25092599 } else
2510
- if (event.getSource() == smoothMeshItem)
2600
+ if (source == smoothMeshItem)
25112601 {
25122602 SmoothMesh();
25132603 } else
2514
- if (event.getSource() == transformgeometryItem)
2604
+ if (source == transformgeometryItem)
25152605 {
25162606 TransformGeometry();
25172607 } else
2518
- if (event.getSource() == resetTransformItem)
2608
+ if (source == resetTransformItem)
25192609 {
25202610 ResetTransform();
25212611 } else
2522
- if (event.getSource() == resetCentroidItem)
2612
+ if (source == resetCentroidItem)
25232613 {
25242614 ResetCentroid();
25252615 } else
2526
- if (event.getSource() == resetParentItem)
2616
+ if (source == resetParentItem)
25272617 {
25282618 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25292619 {
....@@ -2533,7 +2623,7 @@
25332623
25342624 refreshContents();
25352625 } else
2536
- if (event.getSource() == repairParentItem)
2626
+ if (source == repairParentItem)
25372627 {
25382628 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25392629 {
....@@ -2547,7 +2637,7 @@
25472637
25482638 refreshContents();
25492639 } else
2550
- if (event.getSource() == repairShadowItem)
2640
+ if (source == repairShadowItem)
25512641 {
25522642 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25532643 {
....@@ -2561,7 +2651,7 @@
25612651
25622652 refreshContents();
25632653 } else
2564
- if (event.getSource() == sortbysizeItem)
2654
+ if (source == sortbysizeItem)
25652655 {
25662656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672657 {
....@@ -2573,7 +2663,7 @@
25732663 ResetModel();
25742664 refreshContents();
25752665 } else
2576
- if (event.getSource() == sortbynameItem)
2666
+ if (source == sortbynameItem)
25772667 {
25782668 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25792669 {
....@@ -2585,7 +2675,7 @@
25852675 ResetModel();
25862676 refreshContents();
25872677 } else
2588
- if (event.getSource() == attachPigmentItem)
2678
+ if (source == attachPigmentItem)
25892679 {
25902680 String texture = GetFile("Attach pigment");
25912681 Object3D obj;
....@@ -2597,7 +2687,7 @@
25972687
25982688 refreshContents();
25992689 } else
2600
- if (event.getSource() == detachPigmentItem)
2690
+ if (source == detachPigmentItem)
26012691 {
26022692 Object3D obj;
26032693 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +2698,7 @@
26082698
26092699 refreshContents();
26102700 } else
2611
- if (event.getSource() == attachBumpItem)
2701
+ if (source == attachBumpItem)
26122702 {
26132703 String texture = GetFile("Attach bump");
26142704 Object3D obj;
....@@ -2620,7 +2710,7 @@
26202710
26212711 refreshContents();
26222712 } else
2623
- if (event.getSource() == detachBumpItem)
2713
+ if (source == detachBumpItem)
26242714 {
26252715 Object3D obj;
26262716 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2631,7 +2721,7 @@
26312721
26322722 refreshContents();
26332723 } else
2634
- if (event.getSource() == pigmentBumpItem)
2724
+ if (source == pigmentBumpItem)
26352725 {
26362726 Object3D obj;
26372727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +2732,195 @@
26422732
26432733 refreshContents();
26442734 } else
2645
- if (event.getSource() == flashSelectionButton)
2735
+ if (source == flashSelectionButton)
26462736 {
26472737 CameraPane.flash = true;
26482738 refreshContents();
26492739 } else
2650
- if (event.getSource() == oneButton)
2740
+ if (source == oneButton)
26512741 {
26522742 } else
2653
- if (event.getSource() == twoButton)
2743
+ if (source == twoButton)
26542744 {
26552745 radio.layout = twoButton;
26562746 // bug
26572747 //gridPanel.setDividerLocation(1.0);
26582748 //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();
2749
+// bigThree.remove(scenePanel);
2750
+// bigThree.remove(centralPanel);
2751
+// bigThree.remove(XYZPanel);
2752
+// aWindowConstraints.gridx = 0;
2753
+// aWindowConstraints.gridy = 0;
2754
+// aWindowConstraints.gridwidth = 1;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2757
+// aWindowConstraints.weightx = 0;
2758
+// aWindowConstraints.weighty = 1;
2759
+// //bigThree.add(jtp, aWindowConstraints);
2760
+// aWindowConstraints.weightx = 1;
2761
+// aWindowConstraints.gridwidth = 3;
2762
+// // aConstraints.gridheight = 3;
2763
+// aWindowConstraints.gridx = 1;
2764
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2765
+// bigThree.add(centralPanel, aWindowConstraints);
2766
+// aWindowConstraints.weightx = 0;
2767
+// aWindowConstraints.gridx = 4;
2768
+// aWindowConstraints.gridwidth = 1;
2769
+// // aConstraints.gridheight = 3;
2770
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2771
+// //bigThree.add(XYZPanel, aWindowConstraints);
2772
+// scenePanel.setVisible(false);
2773
+// centralPanel.setVisible(true);
2774
+// XYZPanel.setVisible(false);
2775
+ bigThree.ClearUI();
2776
+ bigThree.add(centralPanel);
2777
+ bigThree.FlushUI();
26832778 } else
2684
- if (event.getSource() == threeButton)
2779
+ if (source == threeButton)
26852780 {
26862781 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();
2782
+
2783
+// bigThree.remove(scenePanel);
2784
+// bigThree.remove(centralPanel);
2785
+// bigThree.remove(XYZPanel);
2786
+// aWindowConstraints.gridx = 0;
2787
+// aWindowConstraints.gridy = 0;
2788
+// aWindowConstraints.gridwidth = 1;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2791
+// aWindowConstraints.weightx = 0;
2792
+// aWindowConstraints.weighty = 1;
2793
+// //bigThree.add(jtp, aWindowConstraints);
2794
+// aWindowConstraints.weightx = 1;
2795
+// aWindowConstraints.gridwidth = 3;
2796
+// // aConstraints.gridheight = 3;
2797
+// aWindowConstraints.gridx = 1;
2798
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2799
+// bigThree.add(centralPanel, aWindowConstraints);
2800
+// aWindowConstraints.weightx = 0;
2801
+// aWindowConstraints.gridx = 4;
2802
+// aWindowConstraints.gridwidth = 1;
2803
+// // aConstraints.gridheight = 3;
2804
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2805
+// bigThree.add(XYZPanel, aWindowConstraints);
2806
+// bigThree.validate();
2807
+// scenePanel.setVisible(false);
2808
+// centralPanel.setVisible(true);
2809
+// XYZPanel.setVisible(true);
2810
+ bigThree.ClearUI();
2811
+ bigThree.add(centralPanel);
2812
+ bigThree.add(XYZPanel);
2813
+ bigThree.FlushUI();
27112814 } else
2712
- if (event.getSource() == fourButton)
2815
+ if (source == fourButton)
27132816 {
27142817 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();
2818
+
2819
+// bigThree.remove(scenePanel);
2820
+// bigThree.remove(centralPanel);
2821
+// bigThree.remove(XYZPanel);
2822
+// aWindowConstraints.gridx = 0;
2823
+// aWindowConstraints.gridy = 0;
2824
+// aWindowConstraints.gridwidth = 1;
2825
+// // aWindowConstraints.gridheight = 3;
2826
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2827
+// aWindowConstraints.weightx = 1;
2828
+// aWindowConstraints.weighty = 1;
2829
+// bigThree.add(scenePanel, aWindowConstraints);
2830
+// aWindowConstraints.weightx = 1;
2831
+// aWindowConstraints.gridwidth = 3;
2832
+// // aConstraints.gridheight = 3;
2833
+// aWindowConstraints.gridx = 1;
2834
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2835
+// //bigThree.add(cameraPanel, aWindowConstraints);
2836
+// aWindowConstraints.weightx = 0;
2837
+// aWindowConstraints.gridx = 4;
2838
+// aWindowConstraints.gridwidth = 1;
2839
+// // aWindowConstraints.gridheight = 3;
2840
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2841
+// //bigThree.add(XYZPanel, aWindowConstraints);
2842
+// bigThree.validate();
2843
+// scenePanel.setVisible(true);
2844
+// centralPanel.setVisible(false);
2845
+// XYZPanel.setVisible(false);
2846
+ bigThree.ClearUI();
2847
+ bigThree.add(scenePanel);
2848
+ bigThree.FlushUI();
27392849 } else
2740
- if (event.getSource() == sixButton)
2850
+ if (source == sixButton)
27412851 {
27422852 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();
2853
+
2854
+// bigThree.remove(scenePanel);
2855
+// bigThree.remove(centralPanel);
2856
+// bigThree.remove(XYZPanel);
2857
+// aWindowConstraints.gridx = 0;
2858
+// aWindowConstraints.gridy = 0;
2859
+// aWindowConstraints.gridwidth = 1;
2860
+// // aConstraints.gridheight = 3;
2861
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2862
+// aWindowConstraints.weightx = 0;
2863
+// aWindowConstraints.weighty = 1;
2864
+// bigThree.add(scenePanel, aWindowConstraints);
2865
+// aWindowConstraints.weightx = 1;
2866
+// aWindowConstraints.gridwidth = 3;
2867
+// // aWindowConstraints.gridheight = 3;
2868
+// aWindowConstraints.gridx = 1;
2869
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2870
+// bigThree.add(centralPanel, aWindowConstraints);
2871
+// aWindowConstraints.weightx = 0;
2872
+// aWindowConstraints.gridx = 4;
2873
+// aWindowConstraints.gridwidth = 1;
2874
+// // aWindowConstraints.gridheight = 3;
2875
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2876
+// //bigThree.add(XYZPanel, aConstraints);
2877
+// bigThree.validate();
2878
+// scenePanel.setVisible(true);
2879
+// centralPanel.setVisible(true);
2880
+// XYZPanel.setVisible(false);
2881
+ bigThree.ClearUI();
2882
+ bigThree.add(scenePanel);
2883
+ bigThree.add(centralPanel);
2884
+ bigThree.FlushUI();
27672885 } else
2768
- if (event.getSource() == sevenButton)
2886
+ if (source == sevenButton)
27692887 {
27702888 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();
2889
+
2890
+// bigThree.remove(scenePanel);
2891
+// bigThree.remove(centralPanel);
2892
+// bigThree.remove(XYZPanel);
2893
+// aWindowConstraints.gridx = 0;
2894
+// aWindowConstraints.gridy = 0;
2895
+// aWindowConstraints.gridwidth = 1;
2896
+// // aWindowConstraints.gridheight = 3;
2897
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2898
+// aWindowConstraints.weightx = 0;
2899
+// aWindowConstraints.weighty = 1;
2900
+// bigThree.add(scenePanel, aWindowConstraints);
2901
+// aWindowConstraints.weightx = 1;
2902
+// aWindowConstraints.gridwidth = 3;
2903
+// // aWindowConstraints.gridheight = 3;
2904
+// aWindowConstraints.gridx = 1;
2905
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2906
+// bigThree.add(centralPanel, aWindowConstraints);
2907
+// aWindowConstraints.weightx = 0;
2908
+// aWindowConstraints.gridx = 4;
2909
+// aWindowConstraints.gridwidth = 1;
2910
+// // aConstraints.gridheight = 3;
2911
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2912
+// bigThree.add(XYZPanel, aWindowConstraints);
2913
+// bigThree.validate();
2914
+// scenePanel.setVisible(true);
2915
+// centralPanel.setVisible(true);
2916
+// XYZPanel.setVisible(true);
2917
+ bigThree.ClearUI();
2918
+ bigThree.add(scenePanel);
2919
+ bigThree.add(centralPanel);
2920
+ bigThree.add(XYZPanel);
2921
+ bigThree.FlushUI();
27952922 } else
2796
- if (event.getSource() == rootButton)
2923
+ if (source == rootButton)
27972924 {
27982925 Object3D obj;
27992926 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2805,7 +2932,7 @@
28052932
28062933 refreshContents(true);
28072934 } else
2808
- if (event.getSource() == closeButton)
2935
+ if (source == closeButton)
28092936 {
28102937 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28112938 cRadio ab;
....@@ -2826,11 +2953,11 @@
28262953 }
28272954 refreshContents(true);
28282955 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
2956
+ if (source == editItem || source == editButton)
28302957 {
28312958 EditSelection(false);
28322959 } else
2833
- if (event.getSource() == uneditButton)
2960
+ if (source == uneditButton)
28342961 {
28352962 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28362963 {
....@@ -2842,12 +2969,12 @@
28422969
28432970 child.editWindow = null; // ???????????
28442971 }
2845
- objEditor.ctrlPanel.revalidate();
2972
+ objEditor.ctrlPanel.FlushUI();
28462973 //objEditor.jTree.clearSelection();
28472974 //objEditor.ResetSliders();
28482975 refreshContents(true);
28492976 } else
2850
- if (event.getSource() == clearPanelButton)
2977
+ if (source == clearPanelButton)
28512978 {
28522979 assert(copy == group);
28532980 //copy.ClearUI();
....@@ -2858,7 +2985,7 @@
28582985 listUI.clear();
28592986 refreshContents(true);
28602987 } else
2861
- if (event.getSource() == allParamsButton)
2988
+ if (source == allParamsButton)
28622989 {
28632990 assert(copy == group);
28642991
....@@ -2879,19 +3006,19 @@
28793006
28803007 refreshContents(true);
28813008 } else
2882
- if (event.getSource() == unselectButton)
3009
+ if (source == unselectButton)
28833010 {
28843011 objEditor.jTree.clearSelection();
28853012 // ?? oct 2012 GrafreeD.clipboard.clear();
28863013 objEditor.ResetSliders();
28873014 refreshContents(true);
28883015 } else
2889
- if(event.getSource() instanceof cRadio)
3016
+ if(source instanceof cRadio)
28903017 {
28913018 group.parent = keepparent;
28923019 group.attributes = 0;
28933020 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3021
+ /*cRadio*/ radio = (cRadio)source;
28953022 Object3D obj = radio.GetObject();
28963023 System.out.println("Edit " + obj);
28973024 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2911,7 +3038,7 @@
29113038 }
29123039
29133040 copy = group;
2914
- //CameraPane.theRenderer.object = group;
3041
+ //Globals.theRenderer.object = group;
29153042 if(!useclient)
29163043 {
29173044 cameraView.renderCamera = radio.camera;
....@@ -2920,7 +3047,8 @@
29203047 cameraView.cameras[cameraView.cameracount] = radio.camera;
29213048 cameraView.targetLookAt.set(radio.camera.lookAt);
29223049 cameraView.object = group;
2923
- cameraView.lighttouched = true;
3050
+ //cameraView.lighttouched = true;
3051
+ Globals.lighttouched = true;
29243052 topView.object = group;
29253053 frontView.object = group;
29263054 sideView.object = group;
....@@ -2956,7 +3084,7 @@
29563084 if (useclient)
29573085 {
29583086 cameraView.object = client;
2959
- cameraView.lighttouched = true;
3087
+ Globals.lighttouched = true;
29603088 //topView.object = client;
29613089 //frontView.object = client;
29623090 //sideView.object = client;
....@@ -2964,7 +3092,7 @@
29643092 else
29653093 {
29663094 cameraView.object = group;
2967
- cameraView.lighttouched = true;
3095
+ Globals.lighttouched = true;
29683096 //topView.object = group;
29693097 //frontView.object = group;
29703098 //sideView.object = group;
....@@ -3472,7 +3600,7 @@
34723600 String pigment = Object3D.GetPigment(tex);
34733601 //String bump = Object3D.GetBump(tex);
34743602
3475
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3603
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34763604
34773605 double s = v.s;
34783606
....@@ -3560,11 +3688,11 @@
35603688
35613689 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35623690
3563
- boolean random = CameraPane.RANDOM;
3564
- CameraPane.RANDOM = false; // parse all random nodes
3691
+ boolean random = CameraPane.SWITCH;
3692
+ CameraPane.SWITCH = false; // parse all random nodes
35653693 lowres.linkVerticesThis(null);
35663694 lowres.linkVerticesThis(sn);
3567
- CameraPane.RANDOM = random;
3695
+ CameraPane.SWITCH = random;
35683696
35693697 System.err.flush();
35703698
....@@ -3773,7 +3901,7 @@
37733901 group.selection.RelinkToSupport(); // july 2014
37743902 System.out.println("DONE.");
37753903 refreshContents();
3776
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3904
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37773905 }
37783906
37793907 void ReduceMesh(boolean reduction34)
....@@ -4049,25 +4177,25 @@
40494177 System.err.println("info : " + child.GetPath());
40504178 }
40514179 }
4052
- else
4053
- {
4054
- objEditor.SetMaterial(group); // .GetMaterial());
4055
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4056
- System.err.println("info : " + group.GetPath());
4057
- }
4180
+// else
4181
+// {
4182
+// objEditor.SetMaterial(group); // .GetMaterial());
4183
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4184
+// System.err.println("info : " + group.GetPath());
4185
+// }
40584186
40594187 objEditor.SetText(); // jan 2014
40604188
4061
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4189
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40624190 CameraPane.flash = true;
40634191
40644192 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40654193 // a camera
40664194 {
40674195 CameraPane.camerachangeframe = 0; // don't refuse it
4068
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4069
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4070
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4196
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4197
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4198
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40714199 }
40724200
40734201 refreshContents();
....@@ -4322,7 +4450,7 @@
43224450 refreshContents();
43234451 }
43244452
4325
- void pasteInto(boolean copyit)
4453
+ void pasteInto(boolean copyit, boolean clone)
43264454 {
43274455 // if (GrafreeD.clipboard == null)
43284456 // return;
....@@ -4351,7 +4479,14 @@
43514479 if (copyit)
43524480 {
43534481 // paste(false);
4354
- CloneClipboard(false); // sept 2014
4482
+ if (clone)
4483
+ {
4484
+ CloneClipboard(false); // sept 2014
4485
+ }
4486
+ else
4487
+ {
4488
+ paste(false);
4489
+ }
43554490 }
43564491 else
43574492 {
....@@ -4895,10 +5030,12 @@
48955030 cButton flashSelectionButton;
48965031 cButton editButton;
48975032 cButton uneditButton;
5033
+ JCheckBox allParamsButton;
48985034 cButton clearpanelButton;
4899
- cButton allParamsButton;
49005035 cButton unselectButton;
49015036
5037
+ cButton oneStepButton;
5038
+
49025039 cButton screenfitButton;
49035040 cButton screenfitpointButton;
49045041 cButton snapobjectButton;
....@@ -4953,6 +5090,7 @@
49535090 private MenuItem mergeGeometriesItem;
49545091 private MenuItem copyItem;
49555092 private MenuItem pasteItem;
5093
+ private MenuItem pasteIntoItem;
49565094 private MenuItem pasteLinkItem;
49575095 private MenuItem pasteCloneItem;
49585096 private MenuItem pasteExpandItem;
....@@ -5050,7 +5188,7 @@
50505188 private MenuItem blobItem;
50515189 private MenuItem latheItem;
50525190 private MenuItem bezierItem;
5053
- private MenuItem checkerItem;
5191
+ private MenuItem overlayItem;
50545192 private MenuItem meshItem;
50555193 // private MenuItem meshGroupItem;
50565194 private MenuItem springItem;