Normand Briere
2019-05-05 44b1501b5c4cd60ea67cc3d0971ed53f53b594e6
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");
....@@ -932,7 +969,7 @@
932969
933970 flashIt = false;
934971 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
972
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
936973 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
937974
938975 if (group.selection.size() == 1)
....@@ -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()
....@@ -1666,7 +1715,7 @@
16661715 {
16671716 makeSomething(new BezierSurface());
16681717 } else
1669
- if (source == checkerItem)
1718
+ if (source == overlayItem)
16701719 {
16711720 /*
16721721 Object3D obj = new BezierSurface(5,8);
....@@ -1815,7 +1864,15 @@
18151864 } else
18161865 if (source == importOBJItem)
18171866 {
1818
- 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
+ }
18191876 } else
18201877 if (source == computeAOItem)
18211878 {
....@@ -1853,6 +1910,11 @@
18531910 if (source == dumpItem)
18541911 {
18551912 DumpObject();
1913
+ } else
1914
+ if (source == oneStepButton)
1915
+ {
1916
+ Globals.ONESTEP = true;
1917
+ cameraView.repaint();
18561918 } else
18571919 if (source == screenfitButton)
18581920 {
....@@ -1926,13 +1988,17 @@
19261988 {
19271989 paste(false);
19281990 } else
1991
+ if (source == pasteIntoItem)
1992
+ {
1993
+ pasteInto(true, false);
1994
+ } else
19291995 if (source == pasteLinkItem)
19301996 {
1931
- pasteInto(false);
1997
+ pasteInto(false, false);
19321998 } else
19331999 if (source == pasteCloneItem)
19342000 {
1935
- pasteInto(true);
2001
+ pasteInto(true, true);
19362002 } else
19372003 if (source == pasteExpandItem)
19382004 {
....@@ -2134,11 +2200,11 @@
21342200 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21352201 for (int i=0; i<group.selection.size(); i++)
21362202 {
2137
- boolean random = CameraPane.RANDOM;
2138
- CameraPane.RANDOM = false; // parse all random nodes
2203
+ boolean random = CameraPane.SWITCH;
2204
+ CameraPane.SWITCH = false; // parse all random nodes
21392205 group.selection.get(i).linkVerticesThis(content);
21402206 // group.selection.get(i).setMasterThis(content); // should be identity
2141
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
21422208 }
21432209 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21442210 refreshContents();
....@@ -2148,20 +2214,20 @@
21482214 {
21492215 for (int i=0; i<group.selection.size(); i++)
21502216 {
2151
- boolean random = CameraPane.RANDOM;
2152
- CameraPane.RANDOM = false; // parse all random nodes
2217
+ boolean random = CameraPane.SWITCH;
2218
+ CameraPane.SWITCH = false; // parse all random nodes
21532219 group.selection.get(i).linkVerticesThis(null);
2154
- CameraPane.RANDOM = random;
2220
+ CameraPane.SWITCH = random;
21552221 }
21562222
21572223 refreshContents();
21582224 } else
21592225 if (source == relinkverticesItem)
21602226 {
2161
- boolean random = CameraPane.RANDOM;
2162
- CameraPane.RANDOM = false; // parse all random nodes
2227
+ boolean random = CameraPane.SWITCH;
2228
+ CameraPane.SWITCH = false; // parse all random nodes
21632229 group.selection.RelinkToSupport();
2164
- CameraPane.RANDOM = random;
2230
+ CameraPane.SWITCH = random;
21652231
21662232 refreshContents();
21672233 } else
....@@ -2259,7 +2325,7 @@
22592325 RandomNode random = new RandomNode();
22602326 group(random);
22612327 if (random.size() > 0)
2262
- random.name = random.get(0).name + "Rnd";
2328
+ random.name = random.get(0).name + "Switch";
22632329 } else
22642330 if (source == physicsItem)
22652331 {
....@@ -2720,7 +2786,7 @@
27202786 // centralPanel.setVisible(true);
27212787 // XYZPanel.setVisible(false);
27222788 bigThree.ClearUI();
2723
- bigThree.addComponent(centralPanel);
2789
+ bigThree.add(centralPanel);
27242790 bigThree.FlushUI();
27252791 } else
27262792 if (source == threeButton)
....@@ -2755,8 +2821,8 @@
27552821 // centralPanel.setVisible(true);
27562822 // XYZPanel.setVisible(true);
27572823 bigThree.ClearUI();
2758
- bigThree.addComponent(centralPanel);
2759
- bigThree.addComponent(XYZPanel);
2824
+ bigThree.add(centralPanel);
2825
+ bigThree.add(XYZPanel);
27602826 bigThree.FlushUI();
27612827 } else
27622828 if (source == fourButton)
....@@ -2791,7 +2857,7 @@
27912857 // centralPanel.setVisible(false);
27922858 // XYZPanel.setVisible(false);
27932859 bigThree.ClearUI();
2794
- bigThree.addComponent(scenePanel);
2860
+ bigThree.add(scenePanel);
27952861 bigThree.FlushUI();
27962862 } else
27972863 if (source == sixButton)
....@@ -2826,8 +2892,8 @@
28262892 // centralPanel.setVisible(true);
28272893 // XYZPanel.setVisible(false);
28282894 bigThree.ClearUI();
2829
- bigThree.addComponent(scenePanel);
2830
- bigThree.addComponent(centralPanel);
2895
+ bigThree.add(scenePanel);
2896
+ bigThree.add(centralPanel);
28312897 bigThree.FlushUI();
28322898 } else
28332899 if (source == sevenButton)
....@@ -2862,9 +2928,9 @@
28622928 // centralPanel.setVisible(true);
28632929 // XYZPanel.setVisible(true);
28642930 bigThree.ClearUI();
2865
- bigThree.addComponent(scenePanel);
2866
- bigThree.addComponent(centralPanel);
2867
- bigThree.addComponent(XYZPanel);
2931
+ bigThree.add(scenePanel);
2932
+ bigThree.add(centralPanel);
2933
+ bigThree.add(XYZPanel);
28682934 bigThree.FlushUI();
28692935 } else
28702936 if (source == rootButton)
....@@ -2916,7 +2982,7 @@
29162982
29172983 child.editWindow = null; // ???????????
29182984 }
2919
- objEditor.ctrlPanel.revalidate();
2985
+ objEditor.ctrlPanel.FlushUI();
29202986 //objEditor.jTree.clearSelection();
29212987 //objEditor.ResetSliders();
29222988 refreshContents(true);
....@@ -3635,11 +3701,11 @@
36353701
36363702 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36373703
3638
- boolean random = CameraPane.RANDOM;
3639
- CameraPane.RANDOM = false; // parse all random nodes
3704
+ boolean random = CameraPane.SWITCH;
3705
+ CameraPane.SWITCH = false; // parse all random nodes
36403706 lowres.linkVerticesThis(null);
36413707 lowres.linkVerticesThis(sn);
3642
- CameraPane.RANDOM = random;
3708
+ CameraPane.SWITCH = random;
36433709
36443710 System.err.flush();
36453711
....@@ -4124,12 +4190,12 @@
41244190 System.err.println("info : " + child.GetPath());
41254191 }
41264192 }
4127
- else
4128
- {
4129
- objEditor.SetMaterial(group); // .GetMaterial());
4130
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4131
- System.err.println("info : " + group.GetPath());
4132
- }
4193
+// else
4194
+// {
4195
+// objEditor.SetMaterial(group); // .GetMaterial());
4196
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4197
+// System.err.println("info : " + group.GetPath());
4198
+// }
41334199
41344200 objEditor.SetText(); // jan 2014
41354201
....@@ -4397,7 +4463,7 @@
43974463 refreshContents();
43984464 }
43994465
4400
- void pasteInto(boolean copyit)
4466
+ void pasteInto(boolean copyit, boolean clone)
44014467 {
44024468 // if (GrafreeD.clipboard == null)
44034469 // return;
....@@ -4426,7 +4492,14 @@
44264492 if (copyit)
44274493 {
44284494 // paste(false);
4429
- CloneClipboard(false); // sept 2014
4495
+ if (clone)
4496
+ {
4497
+ CloneClipboard(false); // sept 2014
4498
+ }
4499
+ else
4500
+ {
4501
+ paste(false);
4502
+ }
44304503 }
44314504 else
44324505 {
....@@ -4970,10 +5043,12 @@
49705043 cButton flashSelectionButton;
49715044 cButton editButton;
49725045 cButton uneditButton;
5046
+ JCheckBox allParamsButton;
49735047 cButton clearpanelButton;
4974
- cButton allParamsButton;
49755048 cButton unselectButton;
49765049
5050
+ cButton oneStepButton;
5051
+
49775052 cButton screenfitButton;
49785053 cButton screenfitpointButton;
49795054 cButton snapobjectButton;
....@@ -5028,6 +5103,7 @@
50285103 private MenuItem mergeGeometriesItem;
50295104 private MenuItem copyItem;
50305105 private MenuItem pasteItem;
5106
+ private MenuItem pasteIntoItem;
50315107 private MenuItem pasteLinkItem;
50325108 private MenuItem pasteCloneItem;
50335109 private MenuItem pasteExpandItem;
....@@ -5125,7 +5201,7 @@
51255201 private MenuItem blobItem;
51265202 private MenuItem latheItem;
51275203 private MenuItem bezierItem;
5128
- private MenuItem checkerItem;
5204
+ private MenuItem overlayItem;
51295205 private MenuItem meshItem;
51305206 // private MenuItem meshGroupItem;
51315207 private MenuItem springItem;