Normand Briere
2019-05-05 1e3de699b037989e8deded5c7830139f97c64136
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,17 +163,21 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,18 +185,31 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
208
+ }
191209
192210 oe.menuBar.add(menu = new Menu("Setting"));
211
+ if (Globals.ADVANCED)
212
+ {
193213 resetMeshItem = menu.add(new MenuItem("Reset All"));
194214 resetMeshItem.addActionListener(this);
195215 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -199,6 +219,7 @@
199219 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200220 resetreferencesItem.addActionListener(this);
201221 menu.add("-");
222
+ }
202223 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203224 overwriteGeoItem.addActionListener(this);
204225 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +231,26 @@
210231 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211232 overwriteUVItem.addActionListener(this);
212233 menu.add("-");
234
+ if (Globals.ADVANCED)
235
+ {
213236 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214237 generateMeshItem.addActionListener(this);
215238 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216239 poseMeshItem.addActionListener(this);
217240 menu.add("-");
241
+ }
218242 resetsupportItem = menu.add(new MenuItem("Reset support"));
219243 resetsupportItem.addActionListener(this);
220244 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221245 linkverticesItem.addActionListener(this);
222246 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223247 relinkverticesItem.addActionListener(this);
248
+
249
+ if (Globals.ADVANCED)
250
+ {
224251 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225252 setMasterItem.addActionListener(this);
253
+ }
226254
227255 oe.menuBar.add(menu = new Menu("Group"));
228256 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +261,32 @@
233261 frontItem.addActionListener(this);
234262 compositeItem = menu.add(new MenuItem("Composite"));
235263 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
264
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237265 hideItem.addActionListener(this);
238266 ungroupItem = menu.add(new MenuItem("Ungroup"));
239267 ungroupItem.addActionListener(this);
240268 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
269
+ randomItem = menu.add(new MenuItem("Switch node"));
242270 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247271 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248272 switchGeoItem.addActionListener(this);
249273 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250274 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
275
+ morphItem = menu.add(new MenuItem("Morph Group"));
252276 morphItem.addActionListener(this);
277
+
278
+ if (Globals.ADVANCED)
279
+ {
280
+ menu.add("-");
281
+ physicsItem = menu.add(new MenuItem("Physics"));
282
+ physicsItem.addActionListener(this);
283
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
284
+ frameselectorItem.addActionListener(this);
253285 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254286 scriptNodeItem.addActionListener(this);
255287 cameraItem = menu.add(new MenuItem("Camera"));
256288 cameraItem.addActionListener(this);
289
+ }
257290
258291 oe.menuBar.add(menu = new Menu("Object"));
259292 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,14 +301,18 @@
268301 shadowYItem.addActionListener(this);
269302 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270303 shadowZItem.addActionListener(this);
304
+ if (Globals.ADVANCED)
305
+ {
306
+ menu.add("-");
271307 linkerItem = menu.add(new MenuItem("Linker"));
272308 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275309 attributeItem = menu.add(new MenuItem("Attribute"));
276310 attributeItem.addActionListener(this);
311
+ templateItem = menu.add(new MenuItem("Template"));
312
+ templateItem.addActionListener(this);
277313 pointflowItem = menu.add(new MenuItem("Point Flow"));
278314 pointflowItem.addActionListener(this);
315
+ }
279316 menu.add("-");
280317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281318 resetTransformItem.addActionListener(this);
....@@ -293,8 +330,11 @@
293330 genNormalsCADItem.addActionListener(this);
294331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
296335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297336 genNormalsMINEItem.addActionListener(this);
337
+ }
298338 stripifyItem = menu.add(new MenuItem("Stripify"));
299339 stripifyItem.addActionListener(this);
300340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,10 +356,14 @@
316356 reduce34MeshItem.addActionListener(this);
317357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318358 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
323367
324368 oe.menuBar.add(menu = new Menu("Attributes"));
325369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -329,10 +373,13 @@
329373 liveleavesItem.addActionListener(this);
330374 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331375 unliveleavesItem.addActionListener(this);
376
+ if (Globals.ADVANCED)
377
+ {
332378 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333379 supportleavesItem.addActionListener(this);
334380 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335381 unsupportleavesItem.addActionListener(this);
382
+ }
336383 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337384 hideleavesItem.addActionListener(this);
338385 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -375,6 +422,8 @@
375422 sortbysizeItem.addActionListener(this);
376423 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377424 sortbynameItem.addActionListener(this);
425
+ if (Globals.ADVANCED)
426
+ {
378427 menu.add("-");
379428 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380429 extractGeometriesItem.addActionListener(this);
....@@ -384,20 +433,23 @@
384433 shareGeometriesItem.addActionListener(this);
385434 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386435 mergeGeometriesItem.addActionListener(this);
436
+ }
387437
388438 oe.menuBar.add(menu = new Menu("Insert"));
389439 buildCreateMenu(menu);
390440
391
-
392441 oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
442
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
398443 importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
444
+ menu.add("-");
445
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
400446 import3DSItem.addActionListener(this);
447
+ menu.add("-");
448
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
+ importVRMLX3DItem.addActionListener(this);
450
+ menu.add("-");
451
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
+ importGFDItem.addActionListener(this);
401453
402454 oe.menuBar.add(menu = new Menu("Tools"));
403455 buildToolsMenu(menu);
....@@ -433,110 +485,98 @@
433485 oe.radioPanel.add(dummyButton);
434486 oe.buttonGroup.add(dummyButton);
435487 */
436
- aConstraints.gridy += 1;
437
-
438488 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439489
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
442
-
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
490
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
444491 liveCB.setToolTipText("Enabled animation");
445492 liveCB.addItemListener(this);
446493
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
494
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
495
+ oneStepButton.setToolTipText("Animate one step forward");
496
+ oneStepButton.addActionListener(this);
497
+
498
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
499
+ fastCB.setToolTipText("Fast mode");
500
+ fastCB.addItemListener(this);
501
+
502
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449503 trackCB.setToolTipText("Enable tracking");
450504 trackCB.addItemListener(this);
451505
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
506
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
454507 screenfitButton.setToolTipText("Screen fit");
455508 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
509
+
457510 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458511 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464512
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
513
+ if (Globals.ADVANCED)
514
+ {
515
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ snapobjectButton.addActionListener(this);
517
+ snapobjectButton.setToolTipText("Snap Object");
518
+ }
519
+
520
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471521 flashSelectionButton.setToolTipText("Show selection");
472522 flashSelectionButton.addActionListener(this);
473523
474
- oe.toolbarPanel.add(new cButton(" ", false));
524
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475525
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
482527 twoButton.setToolTipText("Show center view only");
483528 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485530 fourButton.addActionListener(this);
486531 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488533 sixButton.setToolTipText("2-column layout left");
489534 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
491536 threeButton.setToolTipText("2-column layout right");
492537 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
538
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494539 sevenButton.setToolTipText("3-column layout");
495540 sevenButton.addActionListener(this);
496541 //
497542
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
543
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
544
+ rootButton.setToolTipText("Edit selection in new tab");
500545 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
546
+
547
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503548 closeButton.setToolTipText("Close tab");
504549 closeButton.addActionListener(this);
505550 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506551 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508552
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
553
+ cGridBag commandsPanel = new cGridBag();
554
+
555
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
556
+ editButton.setToolTipText("Edit selection");
511557 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515558
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
559
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ uneditButton.setToolTipText("Unedit selection");
517561 uneditButton.addActionListener(this);
518562
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
563
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
564
+ allParamsButton.setToolTipText("Edit all params");
531565 allParamsButton.addActionListener(this);
532566
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
567
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
568
+ clearPanelButton.setToolTipText("Clear edit panel");
569
+ clearPanelButton.addActionListener(this);
570
+
571
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
572
+ unselectButton.setToolTipText("Unselect");
538573 unselectButton.addActionListener(this);
539574
575
+ commandsPanel.preferredHeight = 1;
576
+
577
+ oe.treePanel.add(commandsPanel);
578
+ oe.treePanel.Return();
579
+
540580 // oe.aConstraints.gridx += 1;
541581 // oe.aConstraints.weighty = 0;
542582 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +588,37 @@
548588 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549589 // gcButton.addActionListener(this);
550590
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
591
+ cGridBag jSPPanel = new cGridBag();
592
+
593
+ JScrollPane jSP;
562594 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
595
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564596 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
597
+
598
+ oe.treePanel.add(jSPPanel);
599
+ oe.treePanel.Return();
569600
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
601
+ cGridBag copyOptionsPanel = new cGridBag();
602
+
603
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
604
+ colorCB.setToolTipText("Copy color when dropped");
574605 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
606
+
607
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
608
+ materialCB.setToolTipText("Copy material when dropped");
577609 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
+
611
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
612
+ textureCB.setToolTipText("Copy texture when dropped");
580613 textureCB.addItemListener(this);
581614
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
615
+ copyOptionsPanel.preferredHeight = 1;
616
+ oe.treePanel.add(copyOptionsPanel);
617
+ oe.treePanel.Return();
584618
619
+// mainPanel.setDividerLocation(0.5); //1.0);
620
+// mainPanel.setResizeWeight(0.5);
621
+
585622 //jList.addListSelectionListener(this);
586623 oe.jTree.addTreeSelectionListener(this);
587624 //jTree.setRootVisible(false);
....@@ -604,45 +641,37 @@
604641 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605642 }
606643
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
644
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608645 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
618
-
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // localCB.addItemListener(this);
622
-
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
625
- crowdCB.setToolTipText("Used for crowds");
626
- crowdCB.addItemListener(this);
627
-
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
630
- smoothCB.setToolTipText("Snapping delay");
631
- smoothCB.addItemListener(this);
632
-
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
646
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639647 boxCB.setToolTipText("Display bounding boxes");
640648 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
649
+
650
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643651 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644652 zoomBoxCB.addItemListener(this);
645653
654
+ if (Globals.ADVANCED)
655
+ {
656
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
657
+ supportCB.setToolTipText("Enable rigging");
658
+ supportCB.addItemListener(this);
659
+
660
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
661
+ // localCB.addItemListener(this);
662
+
663
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
664
+ crowdCB.setToolTipText("Used for crowds");
665
+ crowdCB.addItemListener(this);
666
+
667
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
668
+ smoothCB.setToolTipText("Snapping delay");
669
+ smoothCB.addItemListener(this);
670
+
671
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
672
+ slowCB.setToolTipText("Smooth interpolation");
673
+ slowCB.addItemListener(this);
674
+
646675 // constraints.gridy += 1;
647676 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648677 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +679,16 @@
650679 if (false)
651680 {
652681 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
682
+ //constraints.gridy += 1;
683
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655684 speakerCameraCB.addItemListener(this);
656685
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
686
+ //constraints.gridy += 1;
687
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659688 speakerFocusCB.addItemListener(this);
660689
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
690
+ //constraints.gridy += 1;
691
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663692 smoothfocusCB.addItemListener(this);
664693 }
665694
....@@ -667,14 +696,20 @@
667696 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668697 // debugCB.addItemListener(this);
669698
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
699
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672700 oeilCB.addItemListener(this);
673701
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
702
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676703 lookAtCB.setToolTipText("Look-at target");
677704 lookAtCB.addItemListener(this);
705
+
706
+ }
707
+
708
+ cGridBag fill = new cGridBag();
709
+
710
+ fill.preferredHeight = 200;
711
+
712
+ panel.add(fill);
678713
679714 }
680715
....@@ -905,7 +940,9 @@
905940 // objEditor.DropFile((java.io.File[]) object, true);
906941 // return;
907942 // }
908
- if (string.charAt(0) == '/')
943
+
944
+ // File path for Mac and Windows
945
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
909946 {
910947 // file(s)
911948 String[] names = string.split("\n");
....@@ -959,11 +996,11 @@
959996 {
960997 loadClipboard(true);
961998 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
999
+ pasteInto(false, false);
9631000 } else {
9641001 loadClipboard(false);
9651002 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
1003
+ pasteInto(false, false); // true); // ???
9671004 }
9681005 }
9691006 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1122,33 @@
10851122 kleinItem.addActionListener(this);
10861123 particleItem = menu.add(new MenuItem("Particle system"));
10871124 particleItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10881127 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891128 ragdollItem.addActionListener(this);
10901129 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911130 ragdoll2Item.addActionListener(this);
1131
+ }
10921132 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1133
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941134 meshItem.addActionListener(this);
10951135 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961136 // meshGroupItem.addActionListener(this);
1137
+ if (Globals.ADVANCED)
1138
+ {
10971139 springItem = menu.add(new MenuItem("Spring"));
10981140 springItem.addActionListener(this);
10991141 flagItem = menu.add(new MenuItem("Flag"));
11001142 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);
11051143 blobItem = menu.add(new MenuItem("Blob"));
11061144 blobItem.addActionListener(this);
11071145 latheItem = menu.add(new MenuItem("Lathe"));
11081146 latheItem.addActionListener(this);
1147
+ }
1148
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1149
+ bezierItem.addActionListener(this);
1150
+ overlayItem = menu.add(new MenuItem("Overlay"));
1151
+ overlayItem.addActionListener(this);
11091152 lightItem = menu.add(new MenuItem("Light"));
11101153 lightItem.addActionListener(this);
11111154 menu.add("-");
....@@ -1115,34 +1158,39 @@
11151158 loopItem.addActionListener(this);
11161159 doubleItem = menu.add(new MenuItem("Fork"));
11171160 doubleItem.addActionListener(this);
1161
+ if (Globals.ADVANCED)
1162
+ {
11181163 tripleItem = menu.add(new MenuItem("Trident"));
11191164 tripleItem.addActionListener(this);
1165
+ }
11201166 }
11211167
11221168 void buildToolsMenu(Menu menu)
11231169 {
11241170 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251171 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1172
+ animationItem.setState(Globals.ANIMATION);
11271173
11281174 menu.add("-");
11291175 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301176 parseverticesItem.addActionListener(this);
11311177 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321178 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1179
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341180 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371181 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381182 reduceMorphItem.addActionListener(this);
11391183 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401184 reduce34MorphItem.addActionListener(this);
1141
-
1185
+ menu.add("-");
11421186 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431187 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451188
1189
+ if (Globals.ADVANCED)
1190
+ {
1191
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1192
+ mirrorItem.addActionListener(this);
1193
+ menu.add("-");
11461194 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471195 memoryItem.addActionListener(this);
11481196 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1165,6 +1213,7 @@
11651213 menu.add("-");
11661214 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671215 editScriptItem.addActionListener(this);
1216
+ }
11681217 }
11691218
11701219 void ScreenFit()
....@@ -1518,6 +1567,7 @@
15181567 //
15191568 public void actionPerformed(ActionEvent event) // , Object arg)
15201569 {
1570
+ Object source = event.getSource();
15211571 /*
15221572 if (event.getSource() == nameField)
15231573 {
....@@ -1529,11 +1579,11 @@
15291579 }
15301580 else
15311581 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1582
+ if (source == lookAtItem || source == lookFromItem)
15331583 {
15341584 ScreenFit();
15351585 } else
1536
- if (event.getSource() == switchItem)
1586
+ if (source == switchItem)
15371587 {
15381588 cVector v1 = new cVector();
15391589 cVector v2 = new cVector();
....@@ -1542,11 +1592,11 @@
15421592 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431593 objEditor.cameraView.repaint();
15441594 } else
1545
- if (event.getSource() == rectoidItem)
1595
+ if (source == rectoidItem)
15461596 {
15471597 makeSomething(new Box());
15481598 } else
1549
- if (event.getSource() == particleItem)
1599
+ if (source == particleItem)
15501600 {
15511601 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521602 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1617,9 @@
15671617 applyExample(particleGeom, "SMOKE");
15681618 makeSomething(particleGeom);
15691619 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1620
+ if (source == ragdollItem || source == ragdoll2Item)
15711621 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1622
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731623
15741624 ragdoll.toParent = LA.newMatrix();
15751625 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1637,7 @@
15871637 } else
15881638 /*
15891639 */
1590
- if (event.getSource() == heightFieldItem)
1640
+ if (source == heightFieldItem)
15911641 {
15921642 Object3D obj = new Object3D();
15931643
....@@ -1625,31 +1675,31 @@
16251675
16261676 makeSomething(obj);
16271677 } else
1628
- if (event.getSource() == gridItem)
1678
+ if (source == gridItem)
16291679 {
16301680 makeSomething(new Grid());
16311681 } else
1632
- if (event.getSource() == ellipsoidItem)
1682
+ if (source == ellipsoidItem)
16331683 {
16341684 makeSomething(new Sphere());
16351685 } else
1636
- if (event.getSource() == coneItem)
1686
+ if (source == coneItem)
16371687 {
16381688 makeSomething(new Cone());
16391689 } else
1640
- if (event.getSource() == torusItem)
1690
+ if (source == torusItem)
16411691 {
16421692 makeSomething(new Torus());
16431693 } else
1644
- if (event.getSource() == superItem)
1694
+ if (source == superItem)
16451695 {
16461696 makeSomething(new Superellipsoid());
16471697 } else
1648
- if (event.getSource() == kleinItem)
1698
+ if (source == kleinItem)
16491699 {
16501700 makeSomething(new Klein());
16511701 } else
1652
- if (event.getSource() == blobItem)
1702
+ if (source == blobItem)
16531703 {
16541704 Blob blob = new Blob();
16551705 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1707,15 @@
16571707 //blob.retile();
16581708 makeSomething(blob);
16591709 } else
1660
- if (event.getSource() == latheItem)
1710
+ if (source == latheItem)
16611711 {
16621712 makeSomething(new Lathe());
16631713 } else
1664
- if (event.getSource() == bezierItem)
1714
+ if (source == bezierItem)
16651715 {
16661716 makeSomething(new BezierSurface());
16671717 } else
1668
- if (event.getSource() == checkerItem)
1718
+ if (source == overlayItem)
16691719 {
16701720 /*
16711721 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1730,7 @@
16801730 */
16811731 makeSomething(new Checker());
16821732 } else
1683
- if (event.getSource() == meshItem)
1733
+ if (source == meshItem)
16841734 {
16851735 Object3D itemtomake = new Object3D();
16861736 Object3D child;
....@@ -1701,35 +1751,35 @@
17011751 makeSomething(child);
17021752 }
17031753 } else
1704
- if (event.getSource() == springItem)
1754
+ if (source == springItem)
17051755 {
17061756 cSpring s = new cSpring();
17071757 s.setup();
17081758 makeSomething(s);
17091759 } else
1710
- if (event.getSource() == flagItem)
1760
+ if (source == flagItem)
17111761 {
17121762 cSpring s = new cFlag();
17131763 s.setup();
17141764 makeSomething(s);
17151765 } else
1716
- if (event.getSource() == lightItem)
1766
+ if (source == lightItem)
17171767 {
17181768 makeSomething(new Light());
17191769 } else
1720
- if (event.getSource() == csgItem)
1770
+ if (source == csgItem)
17211771 {
17221772 group(new CSG());
17231773 } else
1724
- if (event.getSource() == templateItem)
1774
+ if (source == templateItem)
17251775 {
17261776 group(new cTemplate());
17271777 } else
1728
- if (event.getSource() == attributeItem)
1778
+ if (source == attributeItem)
17291779 {
17301780 makeSomething(new Attribute());
17311781 } else
1732
- if (event.getSource() == pointflowItem)
1782
+ if (source == pointflowItem)
17331783 {
17341784 makeSomething(new PointFlow());
17351785 } else
....@@ -1741,7 +1791,7 @@
17411791 } else
17421792 */
17431793
1744
- if (event.getSource() == superLoopItem)
1794
+ if (source == superLoopItem)
17451795 {
17461796 Composite g = new cGroup();
17471797 for (int i=0; i<15; i++)
....@@ -1763,7 +1813,7 @@
17631813
17641814 group(g);
17651815 } else
1766
- if (event.getSource() == loopItem)
1816
+ if (source == loopItem)
17671817 {
17681818 Composite csg = new GroupLeaf();
17691819 csg.count = 5;
....@@ -1772,7 +1822,7 @@
17721822 csg.addChild(child);
17731823 child.addChild(csg);
17741824 } else
1775
- if (event.getSource() == doubleItem)
1825
+ if (source == doubleItem)
17761826 {
17771827 Composite csg = new GroupLeaf();
17781828 csg.count = 5;
....@@ -1784,7 +1834,7 @@
17841834 csg.addChild(child);
17851835 child.addChild(csg);
17861836 } else
1787
- if (event.getSource() == tripleItem)
1837
+ if (source == tripleItem)
17881838 {
17891839 Composite csg = new GroupLeaf();
17901840 csg.count = 4;
....@@ -1800,70 +1850,83 @@
18001850 child.addChild(csg);
18011851 } else
18021852
1803
- if (event.getSource() == importGFDItem)
1853
+ if (source == importGFDItem)
18041854 {
18051855 ImportGFD();
18061856 } else
1807
- if (event.getSource() == importVRMLX3DItem)
1857
+ if (source == importVRMLX3DItem)
18081858 {
18091859 ImportVRMLX3D();
18101860 } else
1811
- if (event.getSource() == import3DSItem)
1861
+ if (source == import3DSItem)
18121862 {
18131863 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18141864 } else
1815
- if (event.getSource() == importOBJItem)
1865
+ if (source == importOBJItem)
18161866 {
1817
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1867
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1868
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1869
+ browser.setVisible(true);
1870
+ String filename = browser.getFile();
1871
+ if (filename != null && filename.length() > 0)
1872
+ {
1873
+ String fullname = browser.getDirectory() + filename;
1874
+ makeSomething(ReadOBJ(fullname), true);
1875
+ }
18181876 } else
1819
- if (event.getSource() == computeAOItem)
1877
+ if (source == computeAOItem)
18201878 {
18211879 Globals.drawMode = CameraPane.OCCLUSION;
18221880 Globals.theRenderer.repaint();
18231881 } else
1824
- if (event.getSource() == recompileItem)
1882
+ if (source == recompileItem)
18251883 {
18261884 Recompile();
18271885 refreshContents();
18281886 } else
1829
- if (event.getSource() == editScriptItem)
1887
+ if (source == editScriptItem)
18301888 {
18311889 OpenDialog();
18321890 refreshContents();
18331891 } else
1834
- if (event.getSource() == invariantsItem)
1892
+ if (source == invariantsItem)
18351893 {
18361894 System.out.println("Invariants:");
18371895 GrafreeD.grafreeD.universe.invariants();
18381896 } else
1839
- if (event.getSource() == memoryItem)
1897
+ if (source == memoryItem)
18401898 {
18411899 //System.out.println("Invariants:");
18421900 PrintMemory();
18431901 } else
1844
- if (event.getSource() == pathItem)
1902
+ if (source == pathItem)
18451903 {
18461904 PrintPath();
18471905 } else
1848
- if (event.getSource() == analyzeItem)
1906
+ if (source == analyzeItem)
18491907 {
18501908 AnalyzeObject();
18511909 } else
1852
- if (event.getSource() == dumpItem)
1910
+ if (source == dumpItem)
18531911 {
18541912 DumpObject();
18551913 } else
1856
- if (event.getSource() == screenfitButton)
1914
+ if (source == oneStepButton)
1915
+ {
1916
+ Globals.ONESTEP = true;
1917
+ cameraView.repaint();
1918
+ } else
1919
+ if (source == screenfitButton)
18571920 {
18581921 //Reload(lastConverter, lastFilename, true);
18591922 ScreenFit();
18601923 } else
1861
- if (event.getSource() == screenfitpointButton)
1924
+ if (source == screenfitpointButton)
18621925 {
18631926 //Reload(lastConverter, lastFilename, true);
18641927 ScreenFitPoint();
18651928 } else
1866
- if (event.getSource() == snapobjectButton)
1929
+ if (source == snapobjectButton)
18671930 {
18681931 //Reload(lastConverter, lastFilename, true);
18691932 SnapObject();
....@@ -1874,13 +1937,13 @@
18741937 // Recompile();
18751938 // refreshContents();
18761939 // } else
1877
- if (event.getSource() == gcButton)
1940
+ if (source == gcButton)
18781941 {
18791942 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18801943 System.gc();
18811944 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18821945 } else
1883
- if (event.getSource() == editLeafItem)
1946
+ if (source == editLeafItem)
18841947 {
18851948 Object3D obj;
18861949 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +1957,66 @@
18941957 }
18951958 refreshContents(true);
18961959 } else
1897
- if (event.getSource() == openWindowItem)
1960
+ if (source == openWindowItem)
18981961 {
18991962 EditSelection(true);
19001963 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1964
+ if (source == cutItem || source == clearButton)
19021965 {
19031966 loadClipboard(true);
19041967 } else
1905
- if (event.getSource() == duplicateItem)
1968
+ if (source == duplicateItem)
19061969 {
19071970 Object3D keep = GrafreeD.clipboard;
19081971 loadClipboard(false);
19091972 paste(false);
19101973 GrafreeD.clipboard = keep;
19111974 } else
1912
- if (event.getSource() == cloneItem)
1975
+ if (source == cloneItem)
19131976 {
19141977 CloneSelection(false);
19151978 } else
1916
- if (event.getSource() == cloneSupportItem)
1979
+ if (source == cloneSupportItem)
19171980 {
19181981 CloneSelection(true);
19191982 } else
1920
- if (event.getSource() == copyItem)
1983
+ if (source == copyItem)
19211984 {
19221985 loadClipboard(false);
19231986 } else
1924
- if (event.getSource() == pasteItem)
1987
+ if (source == pasteItem)
19251988 {
19261989 paste(false);
19271990 } else
1928
- if (event.getSource() == pasteLinkItem)
1991
+ if (source == pasteIntoItem)
19291992 {
1930
- pasteInto(false);
1993
+ pasteInto(true, false);
19311994 } else
1932
- if (event.getSource() == pasteCloneItem)
1995
+ if (source == pasteLinkItem)
19331996 {
1934
- pasteInto(true);
1997
+ pasteInto(false, false);
19351998 } else
1936
- if (event.getSource() == pasteExpandItem)
1999
+ if (source == pasteCloneItem)
2000
+ {
2001
+ pasteInto(true, true);
2002
+ } else
2003
+ if (source == pasteExpandItem)
19372004 {
19382005 paste(true);
19392006 } else
1940
- if (event.getSource() == synchronizeItem)
2007
+ if (source == synchronizeItem)
19412008 {
19422009 Overwrite(Object3D.TRANSFORM);
19432010 } else
1944
- if (event.getSource() == overwriteNameItem)
2011
+ if (source == overwriteNameItem)
19452012 {
19462013 Overwrite(Object3D.NAME);
19472014 } else
1948
- if (event.getSource() == overwriteUVItem)
2015
+ if (source == overwriteUVItem)
19492016 {
19502017 Overwrite(Object3D.UV);
19512018 } else
1952
- if (event.getSource() == overwriteMatItem)
2019
+ if (source == overwriteMatItem)
19532020 {
19542021 /* july 2015
19552022 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2036,7 @@
19692036
19702037 Overwrite(dropAttributes);
19712038 }
1972
- if (event.getSource() == overwriteGeoItem)
2039
+ if (source == overwriteGeoItem)
19732040 {
19742041 Overwrite(Object3D.GEOMETRY);
19752042 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2053,7 @@
19862053 // refreshContents();
19872054 // }
19882055 } else
1989
- if (event.getSource() == generateMeshItem)
2056
+ if (source == generateMeshItem)
19902057 {
19912058 //if (group.selection.size() == 1)
19922059 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2064,7 @@
19972064 ResetModel();
19982065 refreshContents();
19992066 } else
2000
- if (event.getSource() == extractGeometriesItem)
2067
+ if (source == extractGeometriesItem)
20012068 {
20022069 boolean one = false;
20032070
....@@ -2024,7 +2091,7 @@
20242091 ResetModel();
20252092 refreshContents();
20262093 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2094
+ if (source == cloneGeometriesItem)
20282095 {
20292096 boolean one = false;
20302097
....@@ -2050,7 +2117,7 @@
20502117 ResetModel();
20512118 refreshContents();
20522119 } else
2053
- if (event.getSource() == shareGeometriesItem)
2120
+ if (source == shareGeometriesItem)
20542121 {
20552122 boolean one = false;
20562123
....@@ -2080,7 +2147,7 @@
20802147 refreshContents();
20812148 }
20822149 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2150
+ if (source == mergeGeometriesItem)
20842151 {
20852152 boolean one = false;
20862153
....@@ -2110,7 +2177,7 @@
21102177 ResetModel();
21112178 refreshContents();
21122179 } else
2113
- if (event.getSource() == linkverticesItem)
2180
+ if (source == linkverticesItem)
21142181 {
21152182 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162183 // {
....@@ -2133,38 +2200,38 @@
21332200 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342201 for (int i=0; i<group.selection.size(); i++)
21352202 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2203
+ boolean random = CameraPane.SWITCH;
2204
+ CameraPane.SWITCH = false; // parse all random nodes
21382205 group.selection.get(i).linkVerticesThis(content);
21392206 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
21412208 }
21422209 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432210 refreshContents();
21442211 }
21452212 } else
2146
- if (event.getSource() == resetsupportItem)
2213
+ if (source == resetsupportItem)
21472214 {
21482215 for (int i=0; i<group.selection.size(); i++)
21492216 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2217
+ boolean random = CameraPane.SWITCH;
2218
+ CameraPane.SWITCH = false; // parse all random nodes
21522219 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2220
+ CameraPane.SWITCH = random;
21542221 }
21552222
21562223 refreshContents();
21572224 } else
2158
- if (event.getSource() == relinkverticesItem)
2225
+ if (source == relinkverticesItem)
21592226 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2227
+ boolean random = CameraPane.SWITCH;
2228
+ CameraPane.SWITCH = false; // parse all random nodes
21622229 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2230
+ CameraPane.SWITCH = random;
21642231
21652232 refreshContents();
21662233 } else
2167
- if (event.getSource() == resetreferencesItem)
2234
+ if (source == resetreferencesItem)
21682235 {
21692236 for (int i=0; i<group.selection.size(); i++)
21702237 {
....@@ -2173,7 +2240,7 @@
21732240
21742241 refreshContents();
21752242 } else
2176
- if (event.getSource() == setMasterItem)
2243
+ if (source == setMasterItem)
21772244 {
21782245 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21792246 {
....@@ -2186,7 +2253,7 @@
21862253 refreshContents();
21872254 }
21882255 } else
2189
- if (event.getSource() == poseMeshItem)
2256
+ if (source == poseMeshItem)
21902257 {
21912258 if (group.selection.size() == 1)
21922259 {
....@@ -2205,19 +2272,19 @@
22052272 }
22062273
22072274 } else
2208
- if (event.getSource() == revertMeshItem)
2275
+ if (source == revertMeshItem)
22092276 {
22102277 RevertMeshes();
22112278 } else
2212
- if (event.getSource() == resetMeshItem)
2279
+ if (source == resetMeshItem)
22132280 {
22142281 ResetAll();
22152282 } else
2216
- if (event.getSource() == stepAllItem)
2283
+ if (source == stepAllItem)
22172284 {
22182285 StepAll();
22192286 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2287
+ if (source == clearItem) // || event.getSource() == clearButton)
22212288 {
22222289 //int indices[] = jList.getSelectedIndices();
22232290 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2292,46 @@
22252292
22262293 ClearSelection(false);
22272294 } else
2228
- if (event.getSource() == clearAllItem)
2295
+ if (source == clearAllItem)
22292296 {
22302297 ClearSelection(true);
22312298 } else
2232
- if (event.getSource() == grabItem)
2299
+ if (source == grabItem)
22332300 {
22342301 group(new cGroup(), true);
22352302 } else
2236
- if (event.getSource() == hideItem)
2303
+ if (source == hideItem)
22372304 {
22382305 group(new HiddenObject());
22392306 } else
2240
- if (event.getSource() == frontItem)
2307
+ if (source == frontItem)
22412308 {
22422309 front();
22432310 } else
2244
- if (event.getSource() == backItem)
2311
+ if (source == backItem)
22452312 {
22462313 back();
22472314 } else
2248
- if (event.getSource() == cameraItem)
2315
+ if (source == cameraItem)
22492316 {
22502317 makeSomething(new Camera());
22512318 } else
2252
- if (event.getSource() == compositeItem)
2319
+ if (source == compositeItem)
22532320 {
22542321 group(new Composite());
22552322 } else
2256
- if (event.getSource() == randomItem)
2323
+ if (source == randomItem)
22572324 {
22582325 RandomNode random = new RandomNode();
22592326 group(random);
22602327 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2328
+ random.name = random.get(0).name + "Switch";
22622329 } else
2263
- if (event.getSource() == physicsItem)
2330
+ if (source == physicsItem)
22642331 {
22652332 group(new PhysicsNode());
22662333 } else
2267
- if (event.getSource() == frameselectorItem)
2334
+ if (source == frameselectorItem)
22682335 {
22692336 for (int i=0; i<group.selection.size(); i++)
22702337 {
....@@ -2276,7 +2343,7 @@
22762343 ResetModel();
22772344 refreshContents();
22782345 } else
2279
- if (event.getSource() == switchGeoItem)
2346
+ if (source == switchGeoItem)
22802347 {
22812348 for (int i=0; i<group.selection.size(); i++)
22822349 {
....@@ -2288,7 +2355,7 @@
22882355 ResetModel();
22892356 refreshContents();
22902357 } else
2291
- if (event.getSource() == switchTransfoItem)
2358
+ if (source == switchTransfoItem)
22922359 {
22932360 for (int i=0; i<group.selection.size(); i++)
22942361 {
....@@ -2300,7 +2367,7 @@
23002367 ResetModel();
23012368 refreshContents();
23022369 } else
2303
- if (event.getSource() == morphItem)
2370
+ if (source == morphItem)
23042371 {
23052372 for (int i=0; i<group.selection.size(); i++)
23062373 {
....@@ -2312,7 +2379,7 @@
23122379 ResetModel();
23132380 refreshContents();
23142381 } else
2315
- if (event.getSource() == scriptNodeItem)
2382
+ if (source == scriptNodeItem)
23162383 {
23172384 boolean atleastone = false;
23182385
....@@ -2351,31 +2418,31 @@
23512418 }
23522419 }
23532420 } else
2354
- if (event.getSource() == linkerItem)
2421
+ if (source == linkerItem)
23552422 {
23562423 group(new cLinker());
23572424 } else
2358
- if (event.getSource() == textureItem)
2425
+ if (source == textureItem)
23592426 {
23602427 group(new TextureNode());
23612428 } else
2362
- if (event.getSource() == billboardItem)
2429
+ if (source == billboardItem)
23632430 {
23642431 group(new BillboardNode());
23652432 } else
2366
- if (event.getSource() == shadowXItem)
2433
+ if (source == shadowXItem)
23672434 {
23682435 CastShadow(0);
23692436 } else
2370
- if (event.getSource() == shadowYItem)
2437
+ if (source == shadowYItem)
23712438 {
23722439 CastShadow(1);
23732440 } else
2374
- if (event.getSource() == shadowZItem)
2441
+ if (source == shadowZItem)
23752442 {
23762443 CastShadow(2);
23772444 } else
2378
- if (event.getSource() == ungroupItem)
2445
+ if (source == ungroupItem)
23792446 {
23802447 //ungroup();
23812448 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2454,179 @@
23872454
23882455 refreshContents();
23892456 } else
2390
- if (event.getSource() == genUVItem)
2457
+ if (source == genUVItem)
23912458 {
23922459 GenUV();
23932460 } else
2394
- if (event.getSource() == genNormalsCADItem)
2461
+ if (source == genNormalsCADItem)
23952462 {
23962463 GenNormals(true);
23972464 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2465
+ if (source == genNormalsMESHItem)
23992466 {
24002467 GenNormals(true); // TODO
24012468 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2469
+ if (source == genNormalsORGANItem)
24032470 {
24042471 GenNormals(false);
24052472 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2473
+ if (source == genNormalsMINEItem)
24072474 {
24082475 GenNormalsMINE();
24092476 } else
2410
- if (event.getSource() == stripifyItem)
2477
+ if (source == stripifyItem)
24112478 {
24122479 Stripify();
24132480 } else
2414
- if (event.getSource() == unstripifyItem)
2481
+ if (source == unstripifyItem)
24152482 {
24162483 Unstripify();
24172484 } else
2418
- if (event.getSource() == trimItem)
2485
+ if (source == trimItem)
24192486 {
24202487 Trim();
24212488 } else
2422
- if (event.getSource() == untrimItem)
2489
+ if (source == untrimItem)
24232490 {
24242491 Untrim();
24252492 } else
2426
- if (event.getSource() == clearColorsItem)
2493
+ if (source == clearColorsItem)
24272494 {
24282495 ClearColors();
24292496 } else
2430
- if (event.getSource() == clearMaterialsItem)
2497
+ if (source == clearMaterialsItem)
24312498 {
24322499 ClearMaterials();
24332500 } else
2434
- if (event.getSource() == liveleavesItem)
2501
+ if (source == liveleavesItem)
24352502 {
24362503 LiveLeaves(true);
24372504 } else
2438
- if (event.getSource() == unliveleavesItem)
2505
+ if (source == unliveleavesItem)
24392506 {
24402507 LiveLeaves(false);
24412508 } else
2442
- if (event.getSource() == supportleavesItem)
2509
+ if (source == supportleavesItem)
24432510 {
24442511 SupportLeaves(true);
24452512 } else
2446
- if (event.getSource() == unsupportleavesItem)
2513
+ if (source == unsupportleavesItem)
24472514 {
24482515 SupportLeaves(false);
24492516 } else
2450
- if (event.getSource() == hideleavesItem)
2517
+ if (source == hideleavesItem)
24512518 {
24522519 HideLeaves(true);
24532520 } else
2454
- if (event.getSource() == showleavesItem)
2521
+ if (source == showleavesItem)
24552522 {
24562523 HideLeaves(false);
24572524 } else
2458
- if (event.getSource() == markleavesItem)
2525
+ if (source == markleavesItem)
24592526 {
24602527 MarkLeaves(true);
24612528 } else
2462
- if (event.getSource() == unmarkleavesItem)
2529
+ if (source == unmarkleavesItem)
24632530 {
24642531 MarkLeaves(false);
24652532 } else
2466
- if (event.getSource() == flipVItem)
2533
+ if (source == flipVItem)
24672534 {
24682535 FlipV(true);
24692536 } else
2470
- if (event.getSource() == unflipVItem)
2537
+ if (source == unflipVItem)
24712538 {
24722539 FlipV(false);
24732540 } else
2474
- if (event.getSource() == lowTexturesItem)
2541
+ if (source == lowTexturesItem)
24752542 {
24762543 SetTexRes(0);
24772544 } else
2478
- if (event.getSource() == normalTexturesItem)
2545
+ if (source == normalTexturesItem)
24792546 {
24802547 SetTexRes(1);
24812548 } else
2482
- if (event.getSource() == highTexturesItem)
2549
+ if (source == highTexturesItem)
24832550 {
24842551 SetTexRes(2);
24852552 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2553
+ if (source == veryhighTexturesItem)
24872554 {
24882555 SetTexRes(3);
24892556 } else
2490
- if (event.getSource() == maxTexturesItem)
2557
+ if (source == maxTexturesItem)
24912558 {
24922559 SetTexRes(4);
24932560 } else
2494
- if (event.getSource() == panoTexturesItem)
2561
+ if (source == panoTexturesItem)
24952562 {
24962563 SetTexRes(5);
24972564 } else
2498
- if (event.getSource() == reverseNormalsItem)
2565
+ if (source == reverseNormalsItem)
24992566 {
25002567 ReverseNormals();
25012568 } else
2502
- if (event.getSource() == parseverticesItem)
2569
+ if (source == parseverticesItem)
25032570 {
25042571 ParseVertices();
25052572 } else
2506
- if (event.getSource() == textureFieldItem)
2573
+ if (source == textureFieldItem)
25072574 {
25082575 TextureVertices();
25092576 } else
2510
- if (event.getSource() == alignItem)
2577
+ if (source == alignItem)
25112578 {
25122579 Align();
25132580 } else
2514
- if (event.getSource() == mirrorItem)
2581
+ if (source == mirrorItem)
25152582 {
25162583 MirrorPoses();
25172584 } else
2518
- if (event.getSource() == reduceMorphItem)
2585
+ if (source == reduceMorphItem)
25192586 {
25202587 MeshReduction(false);
25212588 } else
2522
- if (event.getSource() == reduce34MorphItem)
2589
+ if (source == reduce34MorphItem)
25232590 {
25242591 MeshReduction(true);
25252592 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2593
+ if (source == reverseTrianglesItem)
25272594 {
25282595 ReverseTriangles();
25292596 } else
2530
- if (event.getSource() == reduceMeshItem)
2597
+ if (source == reduceMeshItem)
25312598 {
25322599 ReduceMesh(false);
25332600 } else
2534
- if (event.getSource() == reduce34MeshItem)
2601
+ if (source == reduce34MeshItem)
25352602 {
25362603 ReduceMesh(true);
25372604 } else
2538
- if (event.getSource() == increaseMeshItem)
2605
+ if (source == increaseMeshItem)
25392606 {
25402607 IncreaseMesh();
25412608 } else
2542
- if (event.getSource() == clipMeshItem)
2609
+ if (source == clipMeshItem)
25432610 {
25442611 ClipMesh();
25452612 } else
2546
- if (event.getSource() == smoothMeshItem)
2613
+ if (source == smoothMeshItem)
25472614 {
25482615 SmoothMesh();
25492616 } else
2550
- if (event.getSource() == transformgeometryItem)
2617
+ if (source == transformgeometryItem)
25512618 {
25522619 TransformGeometry();
25532620 } else
2554
- if (event.getSource() == resetTransformItem)
2621
+ if (source == resetTransformItem)
25552622 {
25562623 ResetTransform();
25572624 } else
2558
- if (event.getSource() == resetCentroidItem)
2625
+ if (source == resetCentroidItem)
25592626 {
25602627 ResetCentroid();
25612628 } else
2562
- if (event.getSource() == resetParentItem)
2629
+ if (source == resetParentItem)
25632630 {
25642631 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652632 {
....@@ -2569,7 +2636,7 @@
25692636
25702637 refreshContents();
25712638 } else
2572
- if (event.getSource() == repairParentItem)
2639
+ if (source == repairParentItem)
25732640 {
25742641 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752642 {
....@@ -2583,7 +2650,7 @@
25832650
25842651 refreshContents();
25852652 } else
2586
- if (event.getSource() == repairShadowItem)
2653
+ if (source == repairShadowItem)
25872654 {
25882655 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892656 {
....@@ -2597,7 +2664,7 @@
25972664
25982665 refreshContents();
25992666 } else
2600
- if (event.getSource() == sortbysizeItem)
2667
+ if (source == sortbysizeItem)
26012668 {
26022669 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032670 {
....@@ -2609,7 +2676,7 @@
26092676 ResetModel();
26102677 refreshContents();
26112678 } else
2612
- if (event.getSource() == sortbynameItem)
2679
+ if (source == sortbynameItem)
26132680 {
26142681 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152682 {
....@@ -2621,7 +2688,7 @@
26212688 ResetModel();
26222689 refreshContents();
26232690 } else
2624
- if (event.getSource() == attachPigmentItem)
2691
+ if (source == attachPigmentItem)
26252692 {
26262693 String texture = GetFile("Attach pigment");
26272694 Object3D obj;
....@@ -2633,7 +2700,7 @@
26332700
26342701 refreshContents();
26352702 } else
2636
- if (event.getSource() == detachPigmentItem)
2703
+ if (source == detachPigmentItem)
26372704 {
26382705 Object3D obj;
26392706 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2711,7 @@
26442711
26452712 refreshContents();
26462713 } else
2647
- if (event.getSource() == attachBumpItem)
2714
+ if (source == attachBumpItem)
26482715 {
26492716 String texture = GetFile("Attach bump");
26502717 Object3D obj;
....@@ -2656,7 +2723,7 @@
26562723
26572724 refreshContents();
26582725 } else
2659
- if (event.getSource() == detachBumpItem)
2726
+ if (source == detachBumpItem)
26602727 {
26612728 Object3D obj;
26622729 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2734,7 @@
26672734
26682735 refreshContents();
26692736 } else
2670
- if (event.getSource() == pigmentBumpItem)
2737
+ if (source == pigmentBumpItem)
26712738 {
26722739 Object3D obj;
26732740 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2745,195 @@
26782745
26792746 refreshContents();
26802747 } else
2681
- if (event.getSource() == flashSelectionButton)
2748
+ if (source == flashSelectionButton)
26822749 {
26832750 CameraPane.flash = true;
26842751 refreshContents();
26852752 } else
2686
- if (event.getSource() == oneButton)
2753
+ if (source == oneButton)
26872754 {
26882755 } else
2689
- if (event.getSource() == twoButton)
2756
+ if (source == twoButton)
26902757 {
26912758 radio.layout = twoButton;
26922759 // bug
26932760 //gridPanel.setDividerLocation(1.0);
26942761 //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();
2762
+// bigThree.remove(scenePanel);
2763
+// bigThree.remove(centralPanel);
2764
+// bigThree.remove(XYZPanel);
2765
+// aWindowConstraints.gridx = 0;
2766
+// aWindowConstraints.gridy = 0;
2767
+// aWindowConstraints.gridwidth = 1;
2768
+// // aConstraints.gridheight = 3;
2769
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2770
+// aWindowConstraints.weightx = 0;
2771
+// aWindowConstraints.weighty = 1;
2772
+// //bigThree.add(jtp, aWindowConstraints);
2773
+// aWindowConstraints.weightx = 1;
2774
+// aWindowConstraints.gridwidth = 3;
2775
+// // aConstraints.gridheight = 3;
2776
+// aWindowConstraints.gridx = 1;
2777
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2778
+// bigThree.add(centralPanel, aWindowConstraints);
2779
+// aWindowConstraints.weightx = 0;
2780
+// aWindowConstraints.gridx = 4;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// //bigThree.add(XYZPanel, aWindowConstraints);
2785
+// scenePanel.setVisible(false);
2786
+// centralPanel.setVisible(true);
2787
+// XYZPanel.setVisible(false);
2788
+ bigThree.ClearUI();
2789
+ bigThree.add(centralPanel);
2790
+ bigThree.FlushUI();
27192791 } else
2720
- if (event.getSource() == threeButton)
2792
+ if (source == threeButton)
27212793 {
27222794 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();
2795
+
2796
+// bigThree.remove(scenePanel);
2797
+// bigThree.remove(centralPanel);
2798
+// bigThree.remove(XYZPanel);
2799
+// aWindowConstraints.gridx = 0;
2800
+// aWindowConstraints.gridy = 0;
2801
+// aWindowConstraints.gridwidth = 1;
2802
+// // aConstraints.gridheight = 3;
2803
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2804
+// aWindowConstraints.weightx = 0;
2805
+// aWindowConstraints.weighty = 1;
2806
+// //bigThree.add(jtp, aWindowConstraints);
2807
+// aWindowConstraints.weightx = 1;
2808
+// aWindowConstraints.gridwidth = 3;
2809
+// // aConstraints.gridheight = 3;
2810
+// aWindowConstraints.gridx = 1;
2811
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2812
+// bigThree.add(centralPanel, aWindowConstraints);
2813
+// aWindowConstraints.weightx = 0;
2814
+// aWindowConstraints.gridx = 4;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// bigThree.add(XYZPanel, aWindowConstraints);
2819
+// bigThree.validate();
2820
+// scenePanel.setVisible(false);
2821
+// centralPanel.setVisible(true);
2822
+// XYZPanel.setVisible(true);
2823
+ bigThree.ClearUI();
2824
+ bigThree.add(centralPanel);
2825
+ bigThree.add(XYZPanel);
2826
+ bigThree.FlushUI();
27472827 } else
2748
- if (event.getSource() == fourButton)
2828
+ if (source == fourButton)
27492829 {
27502830 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();
2831
+
2832
+// bigThree.remove(scenePanel);
2833
+// bigThree.remove(centralPanel);
2834
+// bigThree.remove(XYZPanel);
2835
+// aWindowConstraints.gridx = 0;
2836
+// aWindowConstraints.gridy = 0;
2837
+// aWindowConstraints.gridwidth = 1;
2838
+// // aWindowConstraints.gridheight = 3;
2839
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2840
+// aWindowConstraints.weightx = 1;
2841
+// aWindowConstraints.weighty = 1;
2842
+// bigThree.add(scenePanel, aWindowConstraints);
2843
+// aWindowConstraints.weightx = 1;
2844
+// aWindowConstraints.gridwidth = 3;
2845
+// // aConstraints.gridheight = 3;
2846
+// aWindowConstraints.gridx = 1;
2847
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2848
+// //bigThree.add(cameraPanel, aWindowConstraints);
2849
+// aWindowConstraints.weightx = 0;
2850
+// aWindowConstraints.gridx = 4;
2851
+// aWindowConstraints.gridwidth = 1;
2852
+// // aWindowConstraints.gridheight = 3;
2853
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2854
+// //bigThree.add(XYZPanel, aWindowConstraints);
2855
+// bigThree.validate();
2856
+// scenePanel.setVisible(true);
2857
+// centralPanel.setVisible(false);
2858
+// XYZPanel.setVisible(false);
2859
+ bigThree.ClearUI();
2860
+ bigThree.add(scenePanel);
2861
+ bigThree.FlushUI();
27752862 } else
2776
- if (event.getSource() == sixButton)
2863
+ if (source == sixButton)
27772864 {
27782865 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();
2866
+
2867
+// bigThree.remove(scenePanel);
2868
+// bigThree.remove(centralPanel);
2869
+// bigThree.remove(XYZPanel);
2870
+// aWindowConstraints.gridx = 0;
2871
+// aWindowConstraints.gridy = 0;
2872
+// aWindowConstraints.gridwidth = 1;
2873
+// // aConstraints.gridheight = 3;
2874
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2875
+// aWindowConstraints.weightx = 0;
2876
+// aWindowConstraints.weighty = 1;
2877
+// bigThree.add(scenePanel, aWindowConstraints);
2878
+// aWindowConstraints.weightx = 1;
2879
+// aWindowConstraints.gridwidth = 3;
2880
+// // aWindowConstraints.gridheight = 3;
2881
+// aWindowConstraints.gridx = 1;
2882
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2883
+// bigThree.add(centralPanel, aWindowConstraints);
2884
+// aWindowConstraints.weightx = 0;
2885
+// aWindowConstraints.gridx = 4;
2886
+// aWindowConstraints.gridwidth = 1;
2887
+// // aWindowConstraints.gridheight = 3;
2888
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2889
+// //bigThree.add(XYZPanel, aConstraints);
2890
+// bigThree.validate();
2891
+// scenePanel.setVisible(true);
2892
+// centralPanel.setVisible(true);
2893
+// XYZPanel.setVisible(false);
2894
+ bigThree.ClearUI();
2895
+ bigThree.add(scenePanel);
2896
+ bigThree.add(centralPanel);
2897
+ bigThree.FlushUI();
28032898 } else
2804
- if (event.getSource() == sevenButton)
2899
+ if (source == sevenButton)
28052900 {
28062901 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();
2902
+
2903
+// bigThree.remove(scenePanel);
2904
+// bigThree.remove(centralPanel);
2905
+// bigThree.remove(XYZPanel);
2906
+// aWindowConstraints.gridx = 0;
2907
+// aWindowConstraints.gridy = 0;
2908
+// aWindowConstraints.gridwidth = 1;
2909
+// // aWindowConstraints.gridheight = 3;
2910
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2911
+// aWindowConstraints.weightx = 0;
2912
+// aWindowConstraints.weighty = 1;
2913
+// bigThree.add(scenePanel, aWindowConstraints);
2914
+// aWindowConstraints.weightx = 1;
2915
+// aWindowConstraints.gridwidth = 3;
2916
+// // aWindowConstraints.gridheight = 3;
2917
+// aWindowConstraints.gridx = 1;
2918
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2919
+// bigThree.add(centralPanel, aWindowConstraints);
2920
+// aWindowConstraints.weightx = 0;
2921
+// aWindowConstraints.gridx = 4;
2922
+// aWindowConstraints.gridwidth = 1;
2923
+// // aConstraints.gridheight = 3;
2924
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2925
+// bigThree.add(XYZPanel, aWindowConstraints);
2926
+// bigThree.validate();
2927
+// scenePanel.setVisible(true);
2928
+// centralPanel.setVisible(true);
2929
+// XYZPanel.setVisible(true);
2930
+ bigThree.ClearUI();
2931
+ bigThree.add(scenePanel);
2932
+ bigThree.add(centralPanel);
2933
+ bigThree.add(XYZPanel);
2934
+ bigThree.FlushUI();
28312935 } else
2832
- if (event.getSource() == rootButton)
2936
+ if (source == rootButton)
28332937 {
28342938 Object3D obj;
28352939 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2841,7 +2945,7 @@
28412945
28422946 refreshContents(true);
28432947 } else
2844
- if (event.getSource() == closeButton)
2948
+ if (source == closeButton)
28452949 {
28462950 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28472951 cRadio ab;
....@@ -2862,11 +2966,11 @@
28622966 }
28632967 refreshContents(true);
28642968 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
2969
+ if (source == editItem || source == editButton)
28662970 {
28672971 EditSelection(false);
28682972 } else
2869
- if (event.getSource() == uneditButton)
2973
+ if (source == uneditButton)
28702974 {
28712975 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28722976 {
....@@ -2878,12 +2982,12 @@
28782982
28792983 child.editWindow = null; // ???????????
28802984 }
2881
- objEditor.ctrlPanel.revalidate();
2985
+ objEditor.ctrlPanel.FlushUI();
28822986 //objEditor.jTree.clearSelection();
28832987 //objEditor.ResetSliders();
28842988 refreshContents(true);
28852989 } else
2886
- if (event.getSource() == clearPanelButton)
2990
+ if (source == clearPanelButton)
28872991 {
28882992 assert(copy == group);
28892993 //copy.ClearUI();
....@@ -2894,7 +2998,7 @@
28942998 listUI.clear();
28952999 refreshContents(true);
28963000 } else
2897
- if (event.getSource() == allParamsButton)
3001
+ if (source == allParamsButton)
28983002 {
28993003 assert(copy == group);
29003004
....@@ -2915,19 +3019,19 @@
29153019
29163020 refreshContents(true);
29173021 } else
2918
- if (event.getSource() == unselectButton)
3022
+ if (source == unselectButton)
29193023 {
29203024 objEditor.jTree.clearSelection();
29213025 // ?? oct 2012 GrafreeD.clipboard.clear();
29223026 objEditor.ResetSliders();
29233027 refreshContents(true);
29243028 } else
2925
- if(event.getSource() instanceof cRadio)
3029
+ if(source instanceof cRadio)
29263030 {
29273031 group.parent = keepparent;
29283032 group.attributes = 0;
29293033 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3034
+ /*cRadio*/ radio = (cRadio)source;
29313035 Object3D obj = radio.GetObject();
29323036 System.out.println("Edit " + obj);
29333037 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -3597,11 +3701,11 @@
35973701
35983702 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993703
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3704
+ boolean random = CameraPane.SWITCH;
3705
+ CameraPane.SWITCH = false; // parse all random nodes
36023706 lowres.linkVerticesThis(null);
36033707 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3708
+ CameraPane.SWITCH = random;
36053709
36063710 System.err.flush();
36073711
....@@ -4086,12 +4190,12 @@
40864190 System.err.println("info : " + child.GetPath());
40874191 }
40884192 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4193
+// else
4194
+// {
4195
+// objEditor.SetMaterial(group); // .GetMaterial());
4196
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4197
+// System.err.println("info : " + group.GetPath());
4198
+// }
40954199
40964200 objEditor.SetText(); // jan 2014
40974201
....@@ -4359,7 +4463,7 @@
43594463 refreshContents();
43604464 }
43614465
4362
- void pasteInto(boolean copyit)
4466
+ void pasteInto(boolean copyit, boolean clone)
43634467 {
43644468 // if (GrafreeD.clipboard == null)
43654469 // return;
....@@ -4388,7 +4492,14 @@
43884492 if (copyit)
43894493 {
43904494 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4495
+ if (clone)
4496
+ {
4497
+ CloneClipboard(false); // sept 2014
4498
+ }
4499
+ else
4500
+ {
4501
+ paste(false);
4502
+ }
43924503 }
43934504 else
43944505 {
....@@ -4932,10 +5043,12 @@
49325043 cButton flashSelectionButton;
49335044 cButton editButton;
49345045 cButton uneditButton;
5046
+ JCheckBox allParamsButton;
49355047 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375048 cButton unselectButton;
49385049
5050
+ cButton oneStepButton;
5051
+
49395052 cButton screenfitButton;
49405053 cButton screenfitpointButton;
49415054 cButton snapobjectButton;
....@@ -4990,6 +5103,7 @@
49905103 private MenuItem mergeGeometriesItem;
49915104 private MenuItem copyItem;
49925105 private MenuItem pasteItem;
5106
+ private MenuItem pasteIntoItem;
49935107 private MenuItem pasteLinkItem;
49945108 private MenuItem pasteCloneItem;
49955109 private MenuItem pasteExpandItem;
....@@ -5087,7 +5201,7 @@
50875201 private MenuItem blobItem;
50885202 private MenuItem latheItem;
50895203 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5204
+ private MenuItem overlayItem;
50915205 private MenuItem meshItem;
50925206 // private MenuItem meshGroupItem;
50935207 private MenuItem springItem;