Normand Briere
2019-05-05 1e1c7fcdb3d0f8be350c5f6c32b6afa6705168ea
GroupEditor.java
....@@ -150,6 +150,8 @@
150150
151151 void SetupMenu2(ObjEditor oe)
152152 {
153
+ if (Globals.ADVANCED)
154
+ {
153155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -161,17 +163,21 @@
161163 lookAtItem.addActionListener(this);
162164 //lookFromItem.addActinoListener(this);
163165 //switchItem.addActionListener(this);
166
+ }
167
+
164168 Menu menu;
165169 oe.menuBar.add(menu = new Menu("Edit"));
166170 //editItem = menu.add(new MenuItem("Edit"));
167171 //editItem.addActionListener(this);
168172 duplicateItem = menu.add(new MenuItem("Duplicate"));
169173 duplicateItem.addActionListener(this);
170
- menu.add("-");
171174 cloneItem = menu.add(new MenuItem("Clone"));
172175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
173178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174179 cloneSupportItem.addActionListener(this);
180
+ }
175181 menu.add("-");
176182 cutItem = menu.add(new MenuItem("Cut"));
177183 cutItem.addActionListener(this);
....@@ -179,18 +185,31 @@
179185 copyItem.addActionListener(this);
180186 pasteItem = menu.add(new MenuItem("Paste"));
181187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
182193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183194 pasteLinkItem.addActionListener(this);
184195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185196 pasteCloneItem.addActionListener(this);
186197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
188200 clearItem = menu.add(new MenuItem("Clear"));
189201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
190206 clearAllItem = menu.add(new MenuItem("Clear All"));
191207 clearAllItem.addActionListener(this);
208
+ }
192209
193210 oe.menuBar.add(menu = new Menu("Setting"));
211
+ if (Globals.ADVANCED)
212
+ {
194213 resetMeshItem = menu.add(new MenuItem("Reset All"));
195214 resetMeshItem.addActionListener(this);
196215 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -200,6 +219,7 @@
200219 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201220 resetreferencesItem.addActionListener(this);
202221 menu.add("-");
222
+ }
203223 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204224 overwriteGeoItem.addActionListener(this);
205225 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,19 +231,26 @@
211231 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212232 overwriteUVItem.addActionListener(this);
213233 menu.add("-");
234
+ if (Globals.ADVANCED)
235
+ {
214236 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215237 generateMeshItem.addActionListener(this);
216238 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217239 poseMeshItem.addActionListener(this);
218240 menu.add("-");
241
+ }
219242 resetsupportItem = menu.add(new MenuItem("Reset support"));
220243 resetsupportItem.addActionListener(this);
221244 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222245 linkverticesItem.addActionListener(this);
223246 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224247 relinkverticesItem.addActionListener(this);
248
+
249
+ if (Globals.ADVANCED)
250
+ {
225251 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226252 setMasterItem.addActionListener(this);
253
+ }
227254
228255 oe.menuBar.add(menu = new Menu("Group"));
229256 grabItem = menu.add(new MenuItem("Grab"));
....@@ -234,27 +261,32 @@
234261 frontItem.addActionListener(this);
235262 compositeItem = menu.add(new MenuItem("Composite"));
236263 compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
264
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238265 hideItem.addActionListener(this);
239266 ungroupItem = menu.add(new MenuItem("Ungroup"));
240267 ungroupItem.addActionListener(this);
241268 menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
269
+ randomItem = menu.add(new MenuItem("Switch node"));
243270 randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
248271 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249272 switchGeoItem.addActionListener(this);
250273 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251274 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
275
+ morphItem = menu.add(new MenuItem("Morph Group"));
253276 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);
254285 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255286 scriptNodeItem.addActionListener(this);
256287 cameraItem = menu.add(new MenuItem("Camera"));
257288 cameraItem.addActionListener(this);
289
+ }
258290
259291 oe.menuBar.add(menu = new Menu("Object"));
260292 textureItem = menu.add(new MenuItem("Texture"));
....@@ -269,14 +301,18 @@
269301 shadowYItem.addActionListener(this);
270302 shadowZItem = menu.add(new MenuItem("Shadow Z"));
271303 shadowZItem.addActionListener(this);
304
+ if (Globals.ADVANCED)
305
+ {
306
+ menu.add("-");
272307 linkerItem = menu.add(new MenuItem("Linker"));
273308 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276309 attributeItem = menu.add(new MenuItem("Attribute"));
277310 attributeItem.addActionListener(this);
311
+ templateItem = menu.add(new MenuItem("Template"));
312
+ templateItem.addActionListener(this);
278313 pointflowItem = menu.add(new MenuItem("Point Flow"));
279314 pointflowItem.addActionListener(this);
315
+ }
280316 menu.add("-");
281317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282318 resetTransformItem.addActionListener(this);
....@@ -294,8 +330,11 @@
294330 genNormalsCADItem.addActionListener(this);
295331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
297335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298336 genNormalsMINEItem.addActionListener(this);
337
+ }
299338 stripifyItem = menu.add(new MenuItem("Stripify"));
300339 stripifyItem.addActionListener(this);
301340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,10 +356,14 @@
317356 reduce34MeshItem.addActionListener(this);
318357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319358 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
324367
325368 oe.menuBar.add(menu = new Menu("Attributes"));
326369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
....@@ -330,10 +373,13 @@
330373 liveleavesItem.addActionListener(this);
331374 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332375 unliveleavesItem.addActionListener(this);
376
+ if (Globals.ADVANCED)
377
+ {
333378 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334379 supportleavesItem.addActionListener(this);
335380 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336381 unsupportleavesItem.addActionListener(this);
382
+ }
337383 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338384 hideleavesItem.addActionListener(this);
339385 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,6 +422,8 @@
376422 sortbysizeItem.addActionListener(this);
377423 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378424 sortbynameItem.addActionListener(this);
425
+ if (Globals.ADVANCED)
426
+ {
379427 menu.add("-");
380428 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381429 extractGeometriesItem.addActionListener(this);
....@@ -385,20 +433,23 @@
385433 shareGeometriesItem.addActionListener(this);
386434 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387435 mergeGeometriesItem.addActionListener(this);
436
+ }
388437
389438 oe.menuBar.add(menu = new Menu("Insert"));
390439 buildCreateMenu(menu);
391440
392
-
393441 oe.menuBar.add(menu = new Menu("Include"));
394
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
- importGFDItem.addActionListener(this);
396
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
- importVRMLX3DItem.addActionListener(this);
398
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
442
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
399443 importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
444
+ menu.add("-");
445
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
401446 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);
402453
403454 oe.menuBar.add(menu = new Menu("Tools"));
404455 buildToolsMenu(menu);
....@@ -434,110 +485,98 @@
434485 oe.radioPanel.add(dummyButton);
435486 oe.buttonGroup.add(dummyButton);
436487 */
437
- aConstraints.gridy += 1;
438
-
439488 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
440489
441
- oe.aConstraints.gridwidth = 1;
442
- oe.aConstraints.gridx = 0;
443
-
444
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
490
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
445491 liveCB.setToolTipText("Enabled animation");
446492 liveCB.addItemListener(this);
447493
448
- oe.aConstraints.gridx += 1;
449
- 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);
450503 trackCB.setToolTipText("Enable tracking");
451504 trackCB.addItemListener(this);
452505
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
506
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
455507 screenfitButton.setToolTipText("Screen fit");
456508 screenfitButton.addActionListener(this);
457
- oe.aConstraints.gridx += 1;
509
+
458510 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
459511 // screenfitpointButton.addActionListener(this);
460
-// oe.aConstraints.gridx += 1;
461
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
462
- snapobjectButton.addActionListener(this);
463
- snapobjectButton.setToolTipText("Snap Object");
464
- oe.aConstraints.gridx += 1;
465512
466
- //aConstraints.gridx = 0;
467
- //aConstraints.gridy += 1;
468
- oe.aConstraints.weighty = 0;
469
- oe.aConstraints.gridwidth = 1;
470
-
471
- 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);
472521 flashSelectionButton.setToolTipText("Show selection");
473522 flashSelectionButton.addActionListener(this);
474523
475
- oe.toolbarPanel.add(new cButton(" ", false));
524
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
476525
477
- oe.aConstraints.gridx += 1;
478
- oe.aConstraints.weighty = 0;
479
- oe.aConstraints.gridwidth = 1;
480
-
481
- //
482
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
483527 twoButton.setToolTipText("Show center view only");
484528 twoButton.addActionListener(this);
485
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
486530 fourButton.addActionListener(this);
487531 fourButton.setToolTipText("Show left panel only");
488
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
489533 sixButton.setToolTipText("2-column layout left");
490534 sixButton.addActionListener(this);
491
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492536 threeButton.setToolTipText("2-column layout right");
493537 threeButton.addActionListener(this);
494
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
538
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
495539 sevenButton.setToolTipText("3-column layout");
496540 sevenButton.addActionListener(this);
497541 //
498542
499
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
500
- 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");
501545 rootButton.addActionListener(this);
502
- oe.aConstraints.gridx += 1;
503
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
546
+
547
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504548 closeButton.setToolTipText("Close tab");
505549 closeButton.addActionListener(this);
506550 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
507551 //clearButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509552
510
- oe.aConstraints.gridx = 1; //
511
- 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");
512557 editButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516558
517
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
559
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ uneditButton.setToolTipText("Unedit selection");
518561 uneditButton.addActionListener(this);
519562
520
- oe.aConstraints.gridx += 1;
521
- oe.aConstraints.weighty = 0;
522
- oe.aConstraints.gridwidth = 1;
523
-
524
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
525
- clearPanelButton.addActionListener(this);
526
-
527
- oe.aConstraints.gridx += 1;
528
- oe.aConstraints.weighty = 0;
529
- oe.aConstraints.gridwidth = 1;
530
-
531
- 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");
532565 allParamsButton.addActionListener(this);
533566
534
- oe.aConstraints.gridx += 1;
535
- oe.aConstraints.weighty = 0;
536
- oe.aConstraints.gridwidth = 1;
537
-
538
- 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");
539573 unselectButton.addActionListener(this);
540574
575
+ commandsPanel.preferredHeight = 1;
576
+
577
+ oe.treePanel.add(commandsPanel);
578
+ oe.treePanel.Return();
579
+
541580 // oe.aConstraints.gridx += 1;
542581 // oe.aConstraints.weighty = 0;
543582 // oe.aConstraints.gridwidth = 1;
....@@ -549,40 +588,37 @@
549588 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
550589 // gcButton.addActionListener(this);
551590
552
- oe.aConstraints.gridx = 0;
553
- oe.aConstraints.gridy += 1;
554
-
555
- //ctrlPanel.add(objList = new List(5, true));
556
- oe.aConstraints.gridwidth = 100;
557
- // oe.aConstraints.gridheight = 100;
558
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
559
- oe.aConstraints.gridheight = 1;
560
- oe.aConstraints.weighty = 0.5;
561
- oe.aConstraints.gridx = 0;
562
- JScrollPane jSP;
591
+ cGridBag jSPPanel = new cGridBag();
592
+
593
+ JScrollPane jSP;
563594 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
564
- 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);
565596 ResetModel();
566
- oe.aConstraints.weighty = 0.5;
567
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
568
- oe.aConstraints.gridy += 1;
569
- oe.aConstraints.gridwidth = 1;
597
+
598
+ oe.treePanel.add(jSPPanel);
599
+ oe.treePanel.Return();
570600
571
- oe.aConstraints.weighty = 0;
572
- oe.aConstraints.gridwidth = 2;
573
-
574
- 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");
575605 colorCB.addItemListener(this);
576
- oe.aConstraints.gridx += 2;
577
- 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");
578609 materialCB.addItemListener(this);
579
- oe.aConstraints.gridx += 2;
580
- 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");
581613 textureCB.addItemListener(this);
582614
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
615
+ copyOptionsPanel.preferredHeight = 1;
616
+ oe.treePanel.add(copyOptionsPanel);
617
+ oe.treePanel.Return();
585618
619
+// mainPanel.setDividerLocation(0.5); //1.0);
620
+// mainPanel.setResizeWeight(0.5);
621
+
586622 //jList.addListSelectionListener(this);
587623 oe.jTree.addTreeSelectionListener(this);
588624 //jTree.setRootVisible(false);
....@@ -607,43 +643,35 @@
607643
608644 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
609645 {
610
- //constraints.gridx = 0;
611
- //constraints.gridy = 0;
612
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
613
- fastCB.setToolTipText("Fast mode");
614
- fastCB.addItemListener(this);
615
- //constraints.gridy += 1;
616
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
617
- supportCB.setToolTipText("Enabled rigging");
618
- supportCB.addItemListener(this);
619
-
620
- // constraints.gridy += 1;
621
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
622
- // localCB.addItemListener(this);
623
-
624
- //constraints.gridy += 1;
625
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
626
- crowdCB.setToolTipText("Used for crowds");
627
- crowdCB.addItemListener(this);
628
-
629
- //constraints.gridy += 1;
630
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
631
- smoothCB.setToolTipText("Snapping delay");
632
- smoothCB.addItemListener(this);
633
-
634
- //constraints.gridy += 1;
635
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
636
- slowCB.setToolTipText("Smooth interpolation");
637
- slowCB.addItemListener(this);
638
- //constraints.gridy += 1;
639646 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
640647 boxCB.setToolTipText("Display bounding boxes");
641648 boxCB.addItemListener(this);
642
- //constraints.gridy += 1;
649
+
643650 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
644651 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
645652 zoomBoxCB.addItemListener(this);
646653
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
+
647675 // constraints.gridy += 1;
648676 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
649677 // speakerMocapCB.addItemListener(this);
....@@ -668,14 +696,20 @@
668696 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
669697 // debugCB.addItemListener(this);
670698
671
- //constraints.gridy += 1;
672699 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
673700 oeilCB.addItemListener(this);
674701
675
- //constraints.gridy += 1;
676702 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
677703 lookAtCB.setToolTipText("Look-at target");
678704 lookAtCB.addItemListener(this);
705
+
706
+ }
707
+
708
+ cGridBag fill = new cGridBag();
709
+
710
+ fill.preferredHeight = 200;
711
+
712
+ panel.add(fill);
679713
680714 }
681715
....@@ -960,11 +994,11 @@
960994 {
961995 loadClipboard(true);
962996 objEditor.jTree.setSelectionPath(destinationPath);
963
- pasteInto(false);
997
+ pasteInto(false, false);
964998 } else {
965999 loadClipboard(false);
9661000 objEditor.jTree.setSelectionPath(destinationPath);
967
- pasteInto(false); // true); // ???
1001
+ pasteInto(false, false); // true); // ???
9681002 }
9691003 }
9701004 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1086,27 +1120,33 @@
10861120 kleinItem.addActionListener(this);
10871121 particleItem = menu.add(new MenuItem("Particle system"));
10881122 particleItem.addActionListener(this);
1123
+ if (Globals.ADVANCED)
1124
+ {
10891125 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10901126 ragdollItem.addActionListener(this);
10911127 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10921128 ragdoll2Item.addActionListener(this);
1129
+ }
10931130 menu.add("-");
1094
- meshItem = menu.add(new MenuItem("Mesh"));
1131
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10951132 meshItem.addActionListener(this);
10961133 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10971134 // meshGroupItem.addActionListener(this);
1135
+ if (Globals.ADVANCED)
1136
+ {
10981137 springItem = menu.add(new MenuItem("Spring"));
10991138 springItem.addActionListener(this);
11001139 flagItem = menu.add(new MenuItem("Flag"));
11011140 flagItem.addActionListener(this);
1102
- bezierItem = menu.add(new MenuItem("Patch"));
1103
- bezierItem.addActionListener(this);
1104
- checkerItem = menu.add(new MenuItem("Checker"));
1105
- checkerItem.addActionListener(this);
11061141 blobItem = menu.add(new MenuItem("Blob"));
11071142 blobItem.addActionListener(this);
11081143 latheItem = menu.add(new MenuItem("Lathe"));
11091144 latheItem.addActionListener(this);
1145
+ }
1146
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1147
+ bezierItem.addActionListener(this);
1148
+ overlayItem = menu.add(new MenuItem("Overlay"));
1149
+ overlayItem.addActionListener(this);
11101150 lightItem = menu.add(new MenuItem("Light"));
11111151 lightItem.addActionListener(this);
11121152 menu.add("-");
....@@ -1116,34 +1156,39 @@
11161156 loopItem.addActionListener(this);
11171157 doubleItem = menu.add(new MenuItem("Fork"));
11181158 doubleItem.addActionListener(this);
1159
+ if (Globals.ADVANCED)
1160
+ {
11191161 tripleItem = menu.add(new MenuItem("Trident"));
11201162 tripleItem.addActionListener(this);
1163
+ }
11211164 }
11221165
11231166 void buildToolsMenu(Menu menu)
11241167 {
11251168 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11261169 animationItem.addItemListener(this);
1127
- animationItem.setState(CameraPane.ANIMATION);
1170
+ animationItem.setState(Globals.ANIMATION);
11281171
11291172 menu.add("-");
11301173 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11311174 parseverticesItem.addActionListener(this);
11321175 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11331176 textureFieldItem.addActionListener(this);
1134
- alignItem = menu.add(new MenuItem("Align"));
1177
+ alignItem = menu.add(new MenuItem("Align Objects"));
11351178 alignItem.addActionListener(this);
1136
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1137
- mirrorItem.addActionListener(this);
11381179 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11391180 reduceMorphItem.addActionListener(this);
11401181 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11411182 reduce34MorphItem.addActionListener(this);
1142
-
1183
+ menu.add("-");
11431184 menu.add(computeAOItem = new MenuItem("Compute AO"));
11441185 computeAOItem.addActionListener(this);
1145
- menu.add("-");
11461186
1187
+ if (Globals.ADVANCED)
1188
+ {
1189
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1190
+ mirrorItem.addActionListener(this);
1191
+ menu.add("-");
11471192 menu.add(memoryItem = new MenuItem("Memory Usage"));
11481193 memoryItem.addActionListener(this);
11491194 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1166,6 +1211,7 @@
11661211 menu.add("-");
11671212 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11681213 editScriptItem.addActionListener(this);
1214
+ }
11691215 }
11701216
11711217 void ScreenFit()
....@@ -1667,7 +1713,7 @@
16671713 {
16681714 makeSomething(new BezierSurface());
16691715 } else
1670
- if (source == checkerItem)
1716
+ if (source == overlayItem)
16711717 {
16721718 /*
16731719 Object3D obj = new BezierSurface(5,8);
....@@ -1816,7 +1862,15 @@
18161862 } else
18171863 if (source == importOBJItem)
18181864 {
1819
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1865
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1866
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1867
+ browser.setVisible(true);
1868
+ String filename = browser.getFile();
1869
+ if (filename != null && filename.length() > 0)
1870
+ {
1871
+ String fullname = browser.getDirectory() + filename;
1872
+ makeSomething(ReadOBJ(fullname), true);
1873
+ }
18201874 } else
18211875 if (source == computeAOItem)
18221876 {
....@@ -1854,6 +1908,11 @@
18541908 if (source == dumpItem)
18551909 {
18561910 DumpObject();
1911
+ } else
1912
+ if (source == oneStepButton)
1913
+ {
1914
+ Globals.ONESTEP = true;
1915
+ cameraView.repaint();
18571916 } else
18581917 if (source == screenfitButton)
18591918 {
....@@ -1927,13 +1986,17 @@
19271986 {
19281987 paste(false);
19291988 } else
1989
+ if (source == pasteIntoItem)
1990
+ {
1991
+ pasteInto(true, false);
1992
+ } else
19301993 if (source == pasteLinkItem)
19311994 {
1932
- pasteInto(false);
1995
+ pasteInto(false, false);
19331996 } else
19341997 if (source == pasteCloneItem)
19351998 {
1936
- pasteInto(true);
1999
+ pasteInto(true, true);
19372000 } else
19382001 if (source == pasteExpandItem)
19392002 {
....@@ -2135,11 +2198,11 @@
21352198 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21362199 for (int i=0; i<group.selection.size(); i++)
21372200 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2201
+ boolean random = CameraPane.SWITCH;
2202
+ CameraPane.SWITCH = false; // parse all random nodes
21402203 group.selection.get(i).linkVerticesThis(content);
21412204 // group.selection.get(i).setMasterThis(content); // should be identity
2142
- CameraPane.RANDOM = random;
2205
+ CameraPane.SWITCH = random;
21432206 }
21442207 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21452208 refreshContents();
....@@ -2149,20 +2212,20 @@
21492212 {
21502213 for (int i=0; i<group.selection.size(); i++)
21512214 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2215
+ boolean random = CameraPane.SWITCH;
2216
+ CameraPane.SWITCH = false; // parse all random nodes
21542217 group.selection.get(i).linkVerticesThis(null);
2155
- CameraPane.RANDOM = random;
2218
+ CameraPane.SWITCH = random;
21562219 }
21572220
21582221 refreshContents();
21592222 } else
21602223 if (source == relinkverticesItem)
21612224 {
2162
- boolean random = CameraPane.RANDOM;
2163
- CameraPane.RANDOM = false; // parse all random nodes
2225
+ boolean random = CameraPane.SWITCH;
2226
+ CameraPane.SWITCH = false; // parse all random nodes
21642227 group.selection.RelinkToSupport();
2165
- CameraPane.RANDOM = random;
2228
+ CameraPane.SWITCH = random;
21662229
21672230 refreshContents();
21682231 } else
....@@ -2260,7 +2323,7 @@
22602323 RandomNode random = new RandomNode();
22612324 group(random);
22622325 if (random.size() > 0)
2263
- random.name = random.get(0).name + "Rnd";
2326
+ random.name = random.get(0).name + "Switch";
22642327 } else
22652328 if (source == physicsItem)
22662329 {
....@@ -2917,7 +2980,7 @@
29172980
29182981 child.editWindow = null; // ???????????
29192982 }
2920
- objEditor.ctrlPanel.validate();
2983
+ objEditor.ctrlPanel.FlushUI();
29212984 //objEditor.jTree.clearSelection();
29222985 //objEditor.ResetSliders();
29232986 refreshContents(true);
....@@ -3636,11 +3699,11 @@
36363699
36373700 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36383701
3639
- boolean random = CameraPane.RANDOM;
3640
- CameraPane.RANDOM = false; // parse all random nodes
3702
+ boolean random = CameraPane.SWITCH;
3703
+ CameraPane.SWITCH = false; // parse all random nodes
36413704 lowres.linkVerticesThis(null);
36423705 lowres.linkVerticesThis(sn);
3643
- CameraPane.RANDOM = random;
3706
+ CameraPane.SWITCH = random;
36443707
36453708 System.err.flush();
36463709
....@@ -4125,12 +4188,12 @@
41254188 System.err.println("info : " + child.GetPath());
41264189 }
41274190 }
4128
- else
4129
- {
4130
- objEditor.SetMaterial(group); // .GetMaterial());
4131
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4132
- System.err.println("info : " + group.GetPath());
4133
- }
4191
+// else
4192
+// {
4193
+// objEditor.SetMaterial(group); // .GetMaterial());
4194
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4195
+// System.err.println("info : " + group.GetPath());
4196
+// }
41344197
41354198 objEditor.SetText(); // jan 2014
41364199
....@@ -4398,7 +4461,7 @@
43984461 refreshContents();
43994462 }
44004463
4401
- void pasteInto(boolean copyit)
4464
+ void pasteInto(boolean copyit, boolean clone)
44024465 {
44034466 // if (GrafreeD.clipboard == null)
44044467 // return;
....@@ -4427,7 +4490,14 @@
44274490 if (copyit)
44284491 {
44294492 // paste(false);
4430
- CloneClipboard(false); // sept 2014
4493
+ if (clone)
4494
+ {
4495
+ CloneClipboard(false); // sept 2014
4496
+ }
4497
+ else
4498
+ {
4499
+ paste(false);
4500
+ }
44314501 }
44324502 else
44334503 {
....@@ -4971,10 +5041,12 @@
49715041 cButton flashSelectionButton;
49725042 cButton editButton;
49735043 cButton uneditButton;
5044
+ JCheckBox allParamsButton;
49745045 cButton clearpanelButton;
4975
- cButton allParamsButton;
49765046 cButton unselectButton;
49775047
5048
+ cButton oneStepButton;
5049
+
49785050 cButton screenfitButton;
49795051 cButton screenfitpointButton;
49805052 cButton snapobjectButton;
....@@ -5029,6 +5101,7 @@
50295101 private MenuItem mergeGeometriesItem;
50305102 private MenuItem copyItem;
50315103 private MenuItem pasteItem;
5104
+ private MenuItem pasteIntoItem;
50325105 private MenuItem pasteLinkItem;
50335106 private MenuItem pasteCloneItem;
50345107 private MenuItem pasteExpandItem;
....@@ -5126,7 +5199,7 @@
51265199 private MenuItem blobItem;
51275200 private MenuItem latheItem;
51285201 private MenuItem bezierItem;
5129
- private MenuItem checkerItem;
5202
+ private MenuItem overlayItem;
51305203 private MenuItem meshItem;
51315204 // private MenuItem meshGroupItem;
51325205 private MenuItem springItem;