Normand Briere
2019-07-01 6600d22461ccc1cb602f238a9ffa83cf07dd830e
GroupEditor.java
....@@ -74,7 +74,7 @@
7474 this.copy = this.group = copy;
7575 //selectees = this.group.selectees;
7676
77
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7878 SetupUI2(objEditor);
7979 objEditor.SetupUI(true);
8080 SetupViews(objEditor);
....@@ -148,28 +148,21 @@
148148
149149 //JTextField nameField;
150150
151
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
152152 {
153
- if (Globals.ADVANCED)
154
- {
155
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
156
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
157
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
158
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
159
- oe.cameraMenu.add("-");
160
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
161
- openWindowItem.addActionListener(this);
162
- editLeafItem.addActionListener(this);
163
- lookAtItem.addActionListener(this);
164
- //lookFromItem.addActinoListener(this);
165
- //switchItem.addActionListener(this);
166
- }
167
-
153
+ oe.jTree = new cTree();
154
+
168155 Menu menu;
169156 oe.menuBar.add(menu = new Menu("Edit"));
170157 //editItem = menu.add(new MenuItem("Edit"));
171158 //editItem.addActionListener(this);
172
- duplicateItem = menu.add(new MenuItem("Duplicate"));
159
+
160
+// undoItem = menu.add(new MenuItem("Undo"));
161
+// undoItem.addActionListener(this);
162
+// redoItem = menu.add(new MenuItem("Redo"));
163
+// redoItem.addActionListener(this);
164
+// menu.add("-");
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
173166 duplicateItem.addActionListener(this);
174167 cloneItem = menu.add(new MenuItem("Clone"));
175168 cloneItem.addActionListener(this);
....@@ -185,7 +178,6 @@
185178 copyItem.addActionListener(this);
186179 pasteItem = menu.add(new MenuItem("Paste"));
187180 pasteItem.addActionListener(this);
188
- menu.add("-");
189181
190182 menu.add("-");
191183 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -206,7 +198,94 @@
206198 clearAllItem = menu.add(new MenuItem("Clear All"));
207199 clearAllItem.addActionListener(this);
208200 }
201
+
202
+ menuBar.add(cameraMenu = new Menu("View"));
203
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
204
+ //zBufferItem.addActionListener(this);
205
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206
+ //normalLensItem.addActionListener(this);
207
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.addActionListener(this);
209
+
210
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+// toggleFullScreenItem.addItemListener(this);
212
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+// cameraMenu.add("-");
214
+//
215
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+// toggleTextureItem.addItemListener(this);
217
+// toggleTextureItem.setState(CameraPane.textureon);
218
+//
219
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+// toggleSwitchItem.addItemListener(this);
221
+// toggleSwitchItem.setState(CameraPane.SWITCH);
222
+
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
209237
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280
+ oe.cameraMenu.add("-");
281
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
282
+ openWindowItem.addActionListener(this);
283
+ editLeafItem.addActionListener(this);
284
+ lookAtItem.addActionListener(this);
285
+ //lookFromItem.addActinoListener(this);
286
+ //switchViewItem.addActionListener(this);
287
+ }
288
+
210289 oe.menuBar.add(menu = new Menu("Setting"));
211290 if (Globals.ADVANCED)
212291 {
....@@ -249,21 +328,29 @@
249328 }
250329
251330 oe.menuBar.add(menu = new Menu("Group"));
252
- grabItem = menu.add(new MenuItem("Grab"));
253
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
254333 backItem = menu.add(new MenuItem("Back"));
255334 backItem.addActionListener(this);
256335 frontItem = menu.add(new MenuItem("Front"));
257336 frontItem.addActionListener(this);
258
- compositeItem = menu.add(new MenuItem("Composite"));
259
- compositeItem.addActionListener(this);
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
260342 hideItem = menu.add(new MenuItem("Hidden Group"));
261343 hideItem.addActionListener(this);
344
+ }
262345 ungroupItem = menu.add(new MenuItem("Ungroup"));
263346 ungroupItem.addActionListener(this);
264
- menu.add("-");
265
- randomItem = menu.add(new MenuItem("Switch node"));
266
- randomItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
267354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
268355 switchGeoItem.addActionListener(this);
269356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -271,8 +358,6 @@
271358 morphItem = menu.add(new MenuItem("Morph Group"));
272359 morphItem.addActionListener(this);
273360
274
- if (Globals.ADVANCED)
275
- {
276361 menu.add("-");
277362 physicsItem = menu.add(new MenuItem("Physics"));
278363 physicsItem.addActionListener(this);
....@@ -280,22 +365,20 @@
280365 frameselectorItem.addActionListener(this);
281366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
282367 scriptNodeItem.addActionListener(this);
283
- cameraItem = menu.add(new MenuItem("Camera"));
284
- cameraItem.addActionListener(this);
285368 }
286369
287370 oe.menuBar.add(menu = new Menu("Object"));
288
- textureItem = menu.add(new MenuItem("Texture"));
289
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
290373 billboardItem = menu.add(new MenuItem("Billboard"));
291374 billboardItem.addActionListener(this);
292375 csgItem = menu.add(new MenuItem("CSG"));
293376 csgItem.addActionListener(this);
294
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
295378 shadowXItem.addActionListener(this);
296
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
297380 shadowYItem.addActionListener(this);
298
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
299382 shadowZItem.addActionListener(this);
300383 if (Globals.ADVANCED)
301384 {
....@@ -392,6 +475,14 @@
392475 markleavesItem.addActionListener(this);
393476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
394477 unmarkleavesItem.addActionListener(this);
478
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
479
+ rewindleavesItem.addActionListener(this);
480
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
481
+ unrewindleavesItem.addActionListener(this);
482
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
483
+ randomleavesItem.addActionListener(this);
484
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
485
+ unrandomleavesItem.addActionListener(this);
395486 menu.add("-");
396487 flipVItem = menu.add(new MenuItem("Flip V"));
397488 flipVItem.addActionListener(this);
....@@ -443,25 +534,24 @@
443534 oe.menuBar.add(menu = new Menu("Insert"));
444535 buildCreateMenu(menu);
445536
446
- oe.menuBar.add(menu = new Menu("Include"));
447
- importOBJItem = menu.add(new MenuItem("OBJ file..."));
448
- importOBJItem.addActionListener(this);
449
- menu.add("-");
450
- import3DSItem = menu.add(new MenuItem("3DS file..."));
451
- import3DSItem.addActionListener(this);
452
- menu.add("-");
453
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
454
- importVRMLX3DItem.addActionListener(this);
455
- menu.add("-");
456
- importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
457
- importGFDItem.addActionListener(this);
458
-
459537 oe.menuBar.add(menu = new Menu("Tools"));
460538 buildToolsMenu(menu);
461539 }
462540
463541 void SetupUI2(ObjEditor oe)
464542 {
543
+ // June 2019
544
+ if (oe == null)
545
+ {
546
+ //super.SetupUI2(this);
547
+ //return;
548
+ }
549
+
550
+ if (copy != group)
551
+ {
552
+ //super.SetupUI2(this);
553
+ }
554
+
465555 //new Exception().printStackTrace();
466556
467557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -490,27 +580,66 @@
490580 oe.radioPanel.add(dummyButton);
491581 oe.buttonGroup.add(dummyButton);
492582 */
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 1;
586
+
493587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
494588
495
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
592
+
593
+ if (Globals.ADVANCED)
594
+ {
595
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ maxButton.setToolTipText("Maximize window");
597
+ maxButton.addActionListener(this);
598
+ }
599
+
600
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
601
+ fullButton.setToolTipText("Full-screen window");
602
+ fullButton.addActionListener(this);
603
+
604
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605
+ restoreCameraButton.setToolTipText("Restore viewpoint");
606
+ restoreCameraButton.addActionListener(this);
607
+
608
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ undoButton.setToolTipText("Undo changes");
610
+ undoButton.addActionListener(this);
611
+ undoButton.setEnabled(false);
612
+
613
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
+ redoButton.setToolTipText("Redo changes");
615
+ redoButton.addActionListener(this);
616
+ redoButton.setEnabled(false);
617
+
618
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
+ saveButton.setToolTipText("Save changes");
620
+ saveButton.addActionListener(this);
621
+
622
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
496623 liveCB.setToolTipText("Enable animation");
497624 liveCB.addItemListener(this);
498625
499
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500627 oneStepButton.setToolTipText("Animate one step forward");
501628 oneStepButton.addActionListener(this);
502629
503
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
630
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
504631 fastCB.setToolTipText("Fast mode");
505632 fastCB.addItemListener(this);
506633
507
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
508
- trackCB.setToolTipText("Enable tracking");
509
- trackCB.addItemListener(this);
510
-
511
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ //oe.toolboxPanel.Return();
635
+
636
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
512637 screenfitButton.setToolTipText("Screen fit");
513638 screenfitButton.addActionListener(this);
639
+
640
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
641
+// trackCB.setToolTipText("Enable tracking");
642
+// trackCB.addItemListener(this);
514643
515644 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
516645 // screenfitpointButton.addActionListener(this);
....@@ -522,65 +651,145 @@
522651 snapobjectButton.setToolTipText("Snap Object");
523652 }
524653
525
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
526
- flashSelectionButton.setToolTipText("Show selection");
527
- flashSelectionButton.addActionListener(this);
654
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
528655
529
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
530
-
531
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
532657 twoButton.setToolTipText("Show center view only");
533658 twoButton.addActionListener(this);
534
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
659
+ this.fullscreenLayout = twoButton;
660
+
661
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
535662 fourButton.addActionListener(this);
536663 fourButton.setToolTipText("Show left panel only");
537
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
664
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
538665 sixButton.setToolTipText("2-column layout left");
539666 sixButton.addActionListener(this);
540
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
541668 threeButton.setToolTipText("2-column layout right");
542669 threeButton.addActionListener(this);
543
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
544671 sevenButton.setToolTipText("3-column layout");
545672 sevenButton.addActionListener(this);
546673 //
547674
548
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
675
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
549676 rootButton.setToolTipText("Edit selection in new tab");
550677 rootButton.addActionListener(this);
551678
552
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
553680 closeButton.setToolTipText("Close tab");
554681 closeButton.addActionListener(this);
555682 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
556683 //clearButton.addActionListener(this);
557
-
558
- cGridBag commandsPanel = new cGridBag();
684
+
685
+ // INSERT
686
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
687
+ gridButton.setToolTipText("Create grid");
688
+ gridButton.addActionListener(this);
689
+
690
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
691
+ boxButton.setToolTipText("Create box");
692
+ boxButton.addActionListener(this);
693
+
694
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
695
+ sphereButton.setToolTipText("Create sphere");
696
+ sphereButton.addActionListener(this);
697
+
698
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
699
+ coneButton.setToolTipText("Create cone");
700
+ coneButton.addActionListener(this);
701
+
702
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
+ torusButton.setToolTipText("Create torus");
704
+ torusButton.addActionListener(this);
705
+
706
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
707
+ superButton.setToolTipText("Create superellipsoid");
708
+ superButton.addActionListener(this);
709
+
710
+ if (Globals.ADVANCED)
711
+ {
712
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ kleinButton.setToolTipText("Create Klein bottle");
714
+ kleinButton.addActionListener(this);
715
+ }
559716
560
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
- editButton.setToolTipText("Edit selection");
717
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
718
+ particlesButton.setToolTipText("Create particle system");
719
+ particlesButton.addActionListener(this);
720
+
721
+ oe.toolboxPanel.Return();
722
+
723
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
724
+ groupButton.setToolTipText("Create group");
725
+ groupButton.addActionListener(this);
726
+
727
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
728
+ compositeButton.setToolTipText("Create composite");
729
+ compositeButton.addActionListener(this);
730
+
731
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
732
+ switchButton.setToolTipText("Create item switcher");
733
+ switchButton.addActionListener(this);
734
+
735
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
736
+ loopButton.setToolTipText("Create loop");
737
+ loopButton.addActionListener(this);
738
+
739
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
740
+ textureButton.setToolTipText("Create texture");
741
+ textureButton.addActionListener(this);
742
+
743
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
744
+ overlayButton.setToolTipText("Create overlay");
745
+ overlayButton.addActionListener(this);
746
+
747
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ lightButton.setToolTipText("Create light");
749
+ lightButton.addActionListener(this);
750
+
751
+ for (int i=6; --i>=0;)
752
+ {
753
+ oe.toolboxPanel.Return();
754
+ oe.toolboxPanel.add(new cGridBag());
755
+ oe.toolboxPanel.add(new cGridBag());
756
+ oe.toolboxPanel.add(new cGridBag());
757
+ oe.toolboxPanel.add(new cGridBag());
758
+ oe.toolboxPanel.add(new cGridBag());
759
+ oe.toolboxPanel.add(new cGridBag());
760
+ oe.toolboxPanel.add(new cGridBag());
761
+ }
762
+
763
+ // EDIT panel
764
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
765
+ editButton.setToolTipText("Pin selection controls");
562766 editButton.addActionListener(this);
563767
564
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
- uneditButton.setToolTipText("Unedit selection");
768
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
769
+ uneditButton.setToolTipText("Remove selection controls");
566770 uneditButton.addActionListener(this);
567771
568
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
569
- allParamsButton.setToolTipText("Edit all params");
772
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
773
+ allParamsButton.setToolTipText("Show all controle");
570774 allParamsButton.addActionListener(this);
571775
572
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
776
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573777 clearPanelButton.setToolTipText("Clear edit panel");
574778 clearPanelButton.addActionListener(this);
575779
576
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577781 unselectButton.setToolTipText("Unselect");
578782 unselectButton.addActionListener(this);
579783
580
- commandsPanel.preferredHeight = 1;
784
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
785
+ flashSelectionButton.setToolTipText("Highlight selection");
786
+ flashSelectionButton.addActionListener(this);
581787
582
- oe.treePanel.add(commandsPanel);
583
- oe.treePanel.Return();
788
+ editCommandsPanel.preferredHeight = 1;
789
+
790
+ SetPinStates(false);
791
+// oe.treePanel.add(commandsPanel);
792
+// oe.treePanel.Return();
584793
585794 // oe.aConstraints.gridx += 1;
586795 // oe.aConstraints.weighty = 0;
....@@ -597,27 +806,12 @@
597806
598807 JScrollPane jSP;
599808 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
600
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
809
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
601810 ResetModel();
602811
603812 oe.treePanel.add(jSPPanel);
604813 oe.treePanel.Return();
605814
606
- cGridBag copyOptionsPanel = new cGridBag();
607
-
608
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
609
- colorCB.setToolTipText("Copy color when dropped");
610
- colorCB.addItemListener(this);
611
-
612
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
613
- materialCB.setToolTipText("Copy material when dropped");
614
- materialCB.addItemListener(this);
615
-
616
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
617
- textureCB.setToolTipText("Copy texture when dropped");
618
- textureCB.addItemListener(this);
619
-
620
- copyOptionsPanel.preferredHeight = 1;
621815 oe.treePanel.add(copyOptionsPanel);
622816 oe.treePanel.Return();
623817
....@@ -648,23 +842,43 @@
648842
649843 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
650844 {
845
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
846
+ colorCB.setToolTipText("Copy color when dropped");
847
+ colorCB.addItemListener(this);
848
+
849
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
850
+ materialCB.setToolTipText("Copy material when dropped");
851
+ materialCB.addItemListener(this);
852
+
853
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
854
+ textureCB.setToolTipText("Copy texture when dropped");
855
+ textureCB.addItemListener(this);
856
+
857
+ panel.Return();
858
+
651859 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
652860 boxCB.setToolTipText("Display bounding boxes");
653861 boxCB.addItemListener(this);
654862
655863 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
656
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
864
+ zoomBoxCB.setToolTipText("Display only for wheel");
657865 zoomBoxCB.addItemListener(this);
658866
659867 if (true) // Globals.ADVANCED)
660868 {
661
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
662
- supportCB.setToolTipText("Enable rigging");
663
- supportCB.addItemListener(this);
869
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
870
+// supportCB.setToolTipText("Enable rigging");
871
+// supportCB.addItemListener(this);
872
+
873
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
874
+ freezeCB.setToolTipText("Fast moving camera");
875
+ freezeCB.addItemListener(this);
664876
665877 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
666878 // localCB.addItemListener(this);
667879
880
+ panel.Return();
881
+
668882 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
669883 crowdCB.setToolTipText("Used for crowds");
670884 crowdCB.addItemListener(this);
....@@ -681,6 +895,8 @@
681895 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
682896 // speakerMocapCB.addItemListener(this);
683897
898
+ panel.Return();
899
+
684900 if (false)
685901 {
686902 // handled in scripts
....@@ -695,32 +911,72 @@
695911 //constraints.gridy += 1;
696912 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
697913 smoothfocusCB.addItemListener(this);
914
+ panel.Return();
698915 }
699916
700917 //constraints.gridx += 1;
701918 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
702919 // debugCB.addItemListener(this);
703920
921
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
922
+ trackCB.setToolTipText("Enable tracking target");
923
+ trackCB.addItemListener(this);
924
+
704925 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
926
+ oeilCB.setToolTipText("Move camera when tracking");
705927 oeilCB.addItemListener(this);
706928
929
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
930
+ shadowCB.setToolTipText("When live compute shadows");
931
+ shadowCB.addItemListener(this);
932
+
933
+ panel.Return();
934
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
935
+ toggleTextureCB.setToolTipText("Load textures");
936
+ toggleTextureCB.addItemListener(this);
937
+
938
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
939
+ toggleSwitchCB.setToolTipText("Choose a single item");
940
+ toggleSwitchCB.addItemListener(this);
941
+
942
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
943
+ autosaveCB.setToolTipText("On structure change");
944
+ autosaveCB.addItemListener(this);
945
+
946
+ panel.Return();
947
+ if (Globals.ADVANCED)
948
+ {
707949 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
708950 lookAtCB.setToolTipText("Look-at target");
709951 lookAtCB.addItemListener(this);
952
+ }
710953
711954 }
712955
713956 cGridBag fill = new cGridBag();
714
-
715957 fill.preferredHeight = 200;
958
+ cGridBag fill2 = new cGridBag();
959
+ fill2.preferredHeight = 200;
960
+ cGridBag fill3 = new cGridBag();
961
+ fill3.preferredHeight = 200;
716962
717963 panel.add(fill);
964
+ panel.add(fill2);
965
+ panel.add(fill3);
718966
719967 }
720968
721969 void EditObject(Object3D obj)
722970 {
723971 cRadio radioButton = new cRadio(obj.name);
972
+
973
+ // Patch to avoid bug with transparency.
974
+ radioButton.hadMaterial = obj.material != null;
975
+ if (!radioButton.hadMaterial)
976
+ {
977
+ obj.material = new cMaterial();
978
+ }
979
+
724980 radioButton.SetObject(obj);
725981 radioButton.layout = sevenButton;
726982 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -729,8 +985,11 @@
729985 buttonGroup.add(radioButton);
730986 radioButton.doClick();
731987 }
988
+
732989 void SetupViews(ObjEditor oe)
733990 {
991
+ theFrame = this;
992
+
734993 oe.SetupViews();
735994
736995 System.out.println("SetupViews");
....@@ -739,23 +998,28 @@
739998 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
740999 }
7411000
742
- JCheckBox liveCB;
743
- JCheckBox supportCB;
744
- JCheckBox localCB;
745
- JCheckBox crowdCB;
746
- JCheckBox smoothCB;
747
- JCheckBox fastCB;
748
- JCheckBox slowCB;
749
- JCheckBox boxCB;
750
- JCheckBox zoomBoxCB;
751
- JCheckBox trackCB;
752
- JCheckBox smoothfocusCB;
1001
+ cToggleButton liveCB;
1002
+ cCheckBox supportCB;
1003
+ cCheckBox localCB;
1004
+ cCheckBox crowdCB;
1005
+ cCheckBox smoothCB;
1006
+ cToggleButton fastCB;
1007
+ cCheckBox slowCB;
1008
+ cCheckBox boxCB;
1009
+ cCheckBox zoomBoxCB;
1010
+ cCheckBox freezeCB;
1011
+ //cToggleButton trackCB;
1012
+ cCheckBox trackCB;
1013
+ cCheckBox smoothfocusCB;
7531014 // JCheckBox speakerMocapCB;
754
- JCheckBox speakerCameraCB;
755
- JCheckBox speakerFocusCB;
756
- JCheckBox debugCB;
757
- JCheckBox oeilCB;
758
- JCheckBox lookAtCB;
1015
+ cCheckBox speakerCameraCB;
1016
+ cCheckBox speakerFocusCB;
1017
+ cCheckBox debugCB;
1018
+
1019
+ cCheckBox oeilCB;
1020
+ cCheckBox shadowCB;
1021
+ cCheckBox autosaveCB;
1022
+ cCheckBox lookAtCB;
7591023
7601024 // static int COLOR = 1;
7611025 // static int MATERIAL = 2;
....@@ -763,9 +1027,9 @@
7631027
7641028 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7651029
766
- JCheckBox colorCB;
767
- JCheckBox materialCB;
768
- JCheckBox textureCB;
1030
+ cCheckBox colorCB;
1031
+ cCheckBox materialCB;
1032
+ cCheckBox textureCB;
7691033
7701034 public void itemStateChanged(ItemEvent e)
7711035 {
....@@ -793,6 +1057,7 @@
7931057 } else if(e.getSource() == liveCB)
7941058 {
7951059 cameraView.ToggleLive();
1060
+ refreshContents(false);
7961061 }
7971062 else if(e.getSource() == supportCB)
7981063 {
....@@ -857,6 +1122,18 @@
8571122 {
8581123 cameraView.ToggleOeil();
8591124 }
1125
+ else if(e.getSource() == shadowCB)
1126
+ {
1127
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1128
+ }
1129
+ else if(e.getSource() == freezeCB)
1130
+ {
1131
+ Globals.FREEZEONMOVE ^= true;
1132
+ }
1133
+ else if(e.getSource() == autosaveCB)
1134
+ {
1135
+ Globals.SAVEONMAKE ^= true;
1136
+ }
8601137 else if(e.getSource() == lookAtCB)
8611138 {
8621139 cameraView.ToggleLookAt();
....@@ -873,7 +1150,8 @@
8731150
8741151 /**/
8751152 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
876
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1153
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1154
+ TreePath path = objEditor.jTree.getSelectionPath();
8771155 if ((path == null) || (path.getPathCount() <= 1)) {
8781156 // We can't move the root node or an empty selection
8791157 return;
....@@ -990,23 +1268,33 @@
9901268
9911269 assert target == objEditor.jTree;
9921270 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1271
+ Object3D destinationLeaf;
9931272 try {
994
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1273
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9951274 } catch (Exception e) {
9961275 System.out.println("destinationPath : " + destinationPath);
9971276 return;
9981277 }
9991278
1000
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1279
+ for (int i=group.selection.size(); --i>=0;)
10011280 {
1281
+ Object3D child = (Object3D)group.selection.elementAt(i);
1282
+
1283
+ // Cannot move into itself
1284
+ if (child == destinationLeaf)
1285
+ return;
1286
+ }
1287
+
1288
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1289
+// {
10021290 loadClipboard(true);
10031291 objEditor.jTree.setSelectionPath(destinationPath);
10041292 pasteInto(false, false);
1005
- } else {
1006
- loadClipboard(false);
1007
- objEditor.jTree.setSelectionPath(destinationPath);
1008
- pasteInto(false, false); // true); // ???
1009
- }
1293
+// } else {
1294
+// loadClipboard(false);
1295
+// objEditor.jTree.setSelectionPath(destinationPath);
1296
+// pasteInto(false, false); // true); // ???
1297
+// }
10101298 }
10111299 public void dropActionChanged(DropTargetDragEvent dtde)
10121300 // Called if the user has modified the current drop gesture
....@@ -1111,22 +1399,30 @@
11111399 {
11121400 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11131401 //heightFieldItem.addActionListener(this);
1114
- gridItem = menu.add(new MenuItem("Grid"));
1115
- gridItem.addActionListener(this);
1116
- rectoidItem = menu.add(new MenuItem("Box"));
1117
- rectoidItem.addActionListener(this);
1118
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1119
- ellipsoidItem.addActionListener(this);
1120
- coneItem = menu.add(new MenuItem("Cone"));
1121
- coneItem.addActionListener(this);
1122
- torusItem = menu.add(new MenuItem("Torus"));
1123
- torusItem.addActionListener(this);
1124
- superItem = menu.add(new MenuItem("Superellipsoid"));
1125
- superItem.addActionListener(this);
1402
+// gridItem = menu.add(new MenuItem("Grid"));
1403
+// gridItem.addActionListener(this);
1404
+// rectoidItem = menu.add(new MenuItem("Box"));
1405
+// rectoidItem.addActionListener(this);
1406
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1407
+// ellipsoidItem.addActionListener(this);
1408
+// coneItem = menu.add(new MenuItem("Cone"));
1409
+// coneItem.addActionListener(this);
1410
+// torusItem = menu.add(new MenuItem("Torus"));
1411
+// torusItem.addActionListener(this);
1412
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1413
+// superItem.addActionListener(this);
1414
+
1415
+ cameraItem = menu.add(new MenuItem("Camera"));
1416
+ cameraItem.addActionListener(this);
1417
+
1418
+ if (!Globals.ADVANCED)
1419
+ {
11261420 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11271421 kleinItem.addActionListener(this);
1128
- particleItem = menu.add(new MenuItem("Particle system"));
1129
- particleItem.addActionListener(this);
1422
+ }
1423
+
1424
+// particleItem = menu.add(new MenuItem("Particle system"));
1425
+// particleItem.addActionListener(this);
11301426 if (Globals.ADVANCED)
11311427 {
11321428 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1152,15 +1448,15 @@
11521448 }
11531449 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11541450 bezierItem.addActionListener(this);
1155
- overlayItem = menu.add(new MenuItem("Overlay"));
1156
- overlayItem.addActionListener(this);
1157
- lightItem = menu.add(new MenuItem("Light"));
1158
- lightItem.addActionListener(this);
1451
+// overlayItem = menu.add(new MenuItem("Overlay"));
1452
+// overlayItem.addActionListener(this);
1453
+// lightItem = menu.add(new MenuItem("Light"));
1454
+// lightItem.addActionListener(this);
11591455 menu.add("-");
11601456 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11611457 //superLoopItem.addActionListener(this);
1162
- loopItem = menu.add(new MenuItem("Loop"));
1163
- loopItem.addActionListener(this);
1458
+// loopItem = menu.add(new MenuItem("Loop"));
1459
+// loopItem.addActionListener(this);
11641460 doubleItem = menu.add(new MenuItem("Fork"));
11651461 doubleItem.addActionListener(this);
11661462 if (Globals.ADVANCED)
....@@ -1175,6 +1471,9 @@
11751471 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11761472 animationItem.addItemListener(this);
11771473 animationItem.setState(Globals.ANIMATION);
1474
+
1475
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1476
+ archiveItem.addActionListener(this);
11781477
11791478 menu.add("-");
11801479 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -1200,7 +1499,7 @@
12001499 memoryItem.addActionListener(this);
12011500 menu.add(analyzeItem = new MenuItem("Analyze"));
12021501 analyzeItem.addActionListener(this);
1203
- menu.add(dumpItem = new MenuItem("Dump"));
1502
+ menu.add(dumpItem = new MenuItem("Print"));
12041503 dumpItem.addActionListener(this);
12051504 // menu.add(pathItem = new MenuItem("From-to path"));
12061505 // pathItem.addActionListener(this);
....@@ -1341,9 +1640,24 @@
13411640 shadow.material = new cMaterial(obj.material);
13421641 shadow.material.diffuse = 0.0001f;
13431642 shadow.material.specular = 0.0001f;
1643
+ //shadow.projectedVertices[1].x = 300;
13441644
13451645 makeSomething(shadow);
13461646 }
1647
+
1648
+ private void ClearUnpinned()
1649
+ {
1650
+ //for (Object3D obj : listUI)
1651
+ for (int i=listUI.size(); --i>=0;)
1652
+ {
1653
+ Object3D obj = listUI.elementAt(i);
1654
+ if (!obj.pinned)
1655
+ {
1656
+ obj.CloseUI();
1657
+ listUI.remove(i);
1658
+ }
1659
+ }
1660
+ }
13471661
13481662 /**
13491663 * applyExample
....@@ -1588,7 +1902,7 @@
15881902 {
15891903 ScreenFit();
15901904 } else
1591
- if (source == switchItem)
1905
+ if (source == switchViewItem)
15921906 {
15931907 cVector v1 = new cVector();
15941908 cVector v2 = new cVector();
....@@ -1597,11 +1911,11 @@
15971911 objEditor.cameraView.renderCamera.setAim(v2, v1);
15981912 objEditor.cameraView.repaint();
15991913 } else
1600
- if (source == rectoidItem)
1914
+ if (source == rectoidItem || source == boxButton)
16011915 {
16021916 makeSomething(new Box());
16031917 } else
1604
- if (source == particleItem)
1918
+ if (source == particleItem || source == particlesButton)
16051919 {
16061920 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16071921 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1680,27 +1994,27 @@
16801994
16811995 makeSomething(obj);
16821996 } else
1683
- if (source == gridItem)
1997
+ if (source == gridItem || source == gridButton)
16841998 {
16851999 makeSomething(new Grid());
16862000 } else
1687
- if (source == ellipsoidItem)
2001
+ if (source == ellipsoidItem || source == sphereButton)
16882002 {
16892003 makeSomething(new Sphere());
16902004 } else
1691
- if (source == coneItem)
2005
+ if (source == coneItem || source == coneButton)
16922006 {
16932007 makeSomething(new Cone());
16942008 } else
1695
- if (source == torusItem)
2009
+ if (source == torusItem || source == torusButton)
16962010 {
16972011 makeSomething(new Torus());
16982012 } else
1699
- if (source == superItem)
2013
+ if (source == superItem || source == superButton)
17002014 {
17012015 makeSomething(new Superellipsoid());
17022016 } else
1703
- if (source == kleinItem)
2017
+ if (source == kleinItem || source == kleinButton)
17042018 {
17052019 makeSomething(new Klein());
17062020 } else
....@@ -1720,7 +2034,7 @@
17202034 {
17212035 makeSomething(new BezierSurface());
17222036 } else
1723
- if (source == overlayItem)
2037
+ if (source == overlayItem || source == overlayButton)
17242038 {
17252039 /*
17262040 Object3D obj = new BezierSurface(5,8);
....@@ -1768,7 +2082,7 @@
17682082 s.setup();
17692083 makeSomething(s);
17702084 } else
1771
- if (source == lightItem)
2085
+ if (source == lightItem || source == lightButton)
17722086 {
17732087 makeSomething(new Light());
17742088 } else
....@@ -1818,30 +2132,30 @@
18182132
18192133 group(g);
18202134 } else
1821
- if (source == loopItem)
2135
+ if (source == loopItem || source == loopButton)
18222136 {
18232137 Composite csg = new GroupLeaf();
18242138 csg.count = 5;
18252139 group(csg);
1826
- Composite child = new cGroup();
2140
+ Composite child = new cGroup("Branch");
18272141 csg.addChild(child);
18282142 child.addChild(csg);
18292143 } else
18302144 if (source == doubleItem)
18312145 {
1832
- Composite csg = new GroupLeaf();
2146
+ Composite csg = new GroupLeaf("Fork");
18332147 csg.count = 5;
18342148 group(csg);
1835
- Composite child = new cGroup();
2149
+ Composite child = new cGroup("Branch A");
18362150 csg.addChild(child);
18372151 child.addChild(csg);
1838
- child = new cGroup();
2152
+ child = new cGroup("Branch B");
18392153 csg.addChild(child);
18402154 child.addChild(csg);
18412155 } else
18422156 if (source == tripleItem)
18432157 {
1844
- Composite csg = new GroupLeaf();
2158
+ Composite csg = new GroupLeaf("Trident");
18452159 csg.count = 4;
18462160 group(csg);
18472161 Composite child = new cGroup();
....@@ -1853,31 +2167,6 @@
18532167 child = new cGroup();
18542168 csg.addChild(child);
18552169 child.addChild(csg);
1856
- } else
1857
-
1858
- if (source == importGFDItem)
1859
- {
1860
- ImportGFD();
1861
- } else
1862
- if (source == importVRMLX3DItem)
1863
- {
1864
- ImportVRMLX3D();
1865
- } else
1866
- if (source == import3DSItem)
1867
- {
1868
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1869
- } else
1870
- if (source == importOBJItem)
1871
- {
1872
- //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
- FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1874
- browser.setVisible(true);
1875
- String filename = browser.getFile();
1876
- if (filename != null && filename.length() > 0)
1877
- {
1878
- String fullname = browser.getDirectory() + filename;
1879
- makeSomething(ReadOBJ(fullname), true);
1880
- }
18812170 } else
18822171 if (source == computeAOItem)
18832172 {
....@@ -1915,6 +2204,30 @@
19152204 if (source == dumpItem)
19162205 {
19172206 DumpObject();
2207
+ } else
2208
+ if (source == minButton)
2209
+ {
2210
+ Minimize();
2211
+ } else
2212
+ if (source == maxButton)
2213
+ {
2214
+ Maximize();
2215
+ } else
2216
+ if (source == fullButton)
2217
+ {
2218
+ ToggleFullScreen();
2219
+ } else
2220
+ if (source == undoButton)
2221
+ {
2222
+ Undo();
2223
+ } else
2224
+ if (source == redoButton)
2225
+ {
2226
+ Redo();
2227
+ } else
2228
+ if (source == saveButton)
2229
+ {
2230
+ Save();
19182231 } else
19192232 if (source == oneStepButton)
19202233 {
....@@ -1969,6 +2282,14 @@
19692282 if (source == cutItem || source == clearButton)
19702283 {
19712284 loadClipboard(true);
2285
+ } else
2286
+ if (source == undoItem)
2287
+ {
2288
+ Undo();
2289
+ } else
2290
+ if (source == redoItem)
2291
+ {
2292
+ Redo();
19722293 } else
19732294 if (source == duplicateItem)
19742295 {
....@@ -2301,9 +2622,9 @@
23012622 {
23022623 ClearSelection(true);
23032624 } else
2304
- if (source == grabItem)
2625
+ if (source == grabItem || source == groupButton)
23052626 {
2306
- group(new cGroup(), true);
2627
+ group(new cGroup(), false); // true);
23072628 } else
23082629 if (source == hideItem)
23092630 {
....@@ -2321,11 +2642,11 @@
23212642 {
23222643 makeSomething(new Camera());
23232644 } else
2324
- if (source == compositeItem)
2645
+ if (source == compositeItem || source == compositeButton)
23252646 {
23262647 group(new Composite());
23272648 } else
2328
- if (source == randomItem)
2649
+ if (source == switchItem || source == switchButton)
23292650 {
23302651 RandomNode random = new RandomNode();
23312652 group(random);
....@@ -2427,7 +2748,7 @@
24272748 {
24282749 group(new cLinker());
24292750 } else
2430
- if (source == textureItem)
2751
+ if (source == textureItem || source == textureButton)
24312752 {
24322753 group(new TextureNode());
24332754 } else
....@@ -2447,17 +2768,30 @@
24472768 {
24482769 CastShadow(2);
24492770 } else
2450
- if (source == ungroupItem)
2771
+ if (source == ungroupItem || source == ungroupButton)
24512772 {
2452
- //ungroup();
2773
+ boolean hasRoot = false;
2774
+
24532775 for (int i=0; i<group.selection.size(); i++)
24542776 {
2455
- Ungroup(group.selection.get(i));
2777
+ if (group.selection.get(i) == group)
2778
+ {
2779
+ hasRoot = true;
2780
+ break;
2781
+ }
24562782 }
24572783
2458
- ClearSelection(false);
2459
-
2460
- refreshContents();
2784
+ if (!hasRoot)
2785
+ {
2786
+ for (int i=0; i<group.selection.size(); i++)
2787
+ {
2788
+ Ungroup(group.selection.get(i));
2789
+ }
2790
+
2791
+ ClearSelection(false);
2792
+
2793
+ refreshContents();
2794
+ }
24612795 } else
24622796 if (source == genUVItem)
24632797 {
....@@ -2469,7 +2803,7 @@
24692803 } else
24702804 if (source == genNormalsMESHItem)
24712805 {
2472
- GenNormals(true); // TODO
2806
+ GenNormalsMESH();
24732807 } else
24742808 if (source == genNormalsORGANItem)
24752809 {
....@@ -2534,6 +2868,22 @@
25342868 if (source == unmarkleavesItem)
25352869 {
25362870 MarkLeaves(false);
2871
+ } else
2872
+ if (source == rewindleavesItem)
2873
+ {
2874
+ RewindLeaves(true);
2875
+ } else
2876
+ if (source == unrewindleavesItem)
2877
+ {
2878
+ RewindLeaves(false);
2879
+ } else
2880
+ if (source == randomleavesItem)
2881
+ {
2882
+ RandomLeaves(true);
2883
+ } else
2884
+ if (source == unrandomleavesItem)
2885
+ {
2886
+ RandomLeaves(false);
25372887 } else
25382888 if (source == flipVItem)
25392889 {
....@@ -2769,6 +3119,10 @@
27693119 if (source == twoButton)
27703120 {
27713121 radio.layout = twoButton;
3122
+
3123
+ if (CameraPane.FULLSCREEN)
3124
+ fullscreenLayout = radio.layout;
3125
+
27723126 // bug
27733127 //gridPanel.setDividerLocation(1.0);
27743128 //bigPanel.setDividerLocation(0.0);
....@@ -2801,10 +3155,31 @@
28013155 bigThree.ClearUI();
28023156 bigThree.add(centralPanel);
28033157 bigThree.FlushUI();
3158
+
3159
+ cameraView.requestFocusInWindow();
3160
+
3161
+// refreshContents(true);
3162
+//
3163
+// try
3164
+// {
3165
+// java.awt.Robot bot = new java.awt.Robot();
3166
+// int mask = InputEvent.BUTTON1_MASK;
3167
+// bot.mouseMove(100, 100);
3168
+// bot.mousePress(mask);
3169
+// bot.mouseRelease(mask);
3170
+// }
3171
+// catch (Exception e)
3172
+// {
3173
+//
3174
+// }
3175
+
28043176 } else
28053177 if (source == threeButton)
28063178 {
28073179 radio.layout = threeButton;
3180
+
3181
+ if (CameraPane.FULLSCREEN)
3182
+ fullscreenLayout = radio.layout;
28083183
28093184 // bigThree.remove(scenePanel);
28103185 // bigThree.remove(centralPanel);
....@@ -2837,10 +3212,15 @@
28373212 bigThree.add(centralPanel);
28383213 bigThree.add(XYZPanel);
28393214 bigThree.FlushUI();
3215
+
3216
+ cameraView.requestFocusInWindow();
28403217 } else
28413218 if (source == fourButton)
28423219 {
28433220 radio.layout = fourButton;
3221
+
3222
+ if (CameraPane.FULLSCREEN)
3223
+ fullscreenLayout = radio.layout;
28443224
28453225 // bigThree.remove(scenePanel);
28463226 // bigThree.remove(centralPanel);
....@@ -2872,10 +3252,15 @@
28723252 bigThree.ClearUI();
28733253 bigThree.add(scenePanel);
28743254 bigThree.FlushUI();
3255
+
3256
+ cameraView.requestFocusInWindow();
28753257 } else
28763258 if (source == sixButton)
28773259 {
28783260 radio.layout = sixButton;
3261
+
3262
+ if (CameraPane.FULLSCREEN)
3263
+ fullscreenLayout = radio.layout;
28793264
28803265 // bigThree.remove(scenePanel);
28813266 // bigThree.remove(centralPanel);
....@@ -2908,10 +3293,15 @@
29083293 bigThree.add(scenePanel);
29093294 bigThree.add(centralPanel);
29103295 bigThree.FlushUI();
3296
+
3297
+ cameraView.requestFocusInWindow();
29113298 } else
29123299 if (source == sevenButton)
29133300 {
29143301 radio.layout = sevenButton;
3302
+
3303
+ if (CameraPane.FULLSCREEN)
3304
+ fullscreenLayout = radio.layout;
29153305
29163306 // bigThree.remove(scenePanel);
29173307 // bigThree.remove(centralPanel);
....@@ -2945,6 +3335,8 @@
29453335 bigThree.add(centralPanel);
29463336 bigThree.add(XYZPanel);
29473337 bigThree.FlushUI();
3338
+
3339
+ cameraView.requestFocusInWindow();
29483340 } else
29493341 if (source == rootButton)
29503342 {
....@@ -2956,6 +3348,7 @@
29563348 EditObject(obj);
29573349 }
29583350
3351
+ cameraView.requestFocusInWindow();
29593352 refreshContents(true);
29603353 } else
29613354 if (source == closeButton)
....@@ -2965,22 +3358,37 @@
29653358 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29663359 {
29673360 ab = (cRadio)e.nextElement();
2968
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3361
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29693362 {
3363
+ // Patch to avoid bug with transparency.
3364
+ if (!ab.hadMaterial)
3365
+ {
3366
+ ab.object.material = null;
3367
+ }
3368
+
29703369 buttonGroup.remove(ab);
29713370 radioPanel.remove(ab);
29723371
2973
- ab.GetObject().editWindow = null;
3372
+ //ab.GetObject().editWindow = null;
3373
+ ab.GetObject().manipWindow = null;
29743374 // ab.GetObject().objectUI = null; // ?????????
29753375
29763376 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29773377 break;
29783378 }
29793379 }
3380
+
3381
+ cameraView.requestFocusInWindow();
29803382 refreshContents(true);
29813383 } else
29823384 if (source == editItem || source == editButton)
29833385 {
3386
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3387
+ {
3388
+ Object3D child = (Object3D)e.nextElement();
3389
+ child.pinned = true;
3390
+ }
3391
+
29843392 EditSelection(false);
29853393 } else
29863394 if (source == uneditButton)
....@@ -2990,10 +3398,11 @@
29903398 Object3D child = (Object3D)e.nextElement();
29913399 if(child.editWindow != null)
29923400 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3401
+ child.pinned = false;
29933402 child.CloseUI();
29943403 listUI.remove(child);
29953404
2996
- child.editWindow = null; // ???????????
3405
+ //child.editWindow = null; // ???????????
29973406 }
29983407 objEditor.ctrlPanel.FlushUI();
29993408 //objEditor.jTree.clearSelection();
....@@ -3006,6 +3415,7 @@
30063415 //copy.ClearUI();
30073416 for (Object3D obj : listUI)
30083417 {
3418
+ obj.pinned = false;
30093419 obj.CloseUI();
30103420 }
30113421 listUI.clear();
....@@ -3015,7 +3425,7 @@
30153425 {
30163426 assert(copy == group);
30173427
3018
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3428
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30193429
30203430 for (Object3D obj : listUI)
30213431 {
....@@ -3079,20 +3489,44 @@
30793489 frontView.object = group;
30803490 sideView.object = group;
30813491 }
3082
- group.editWindow = this;
3492
+
3493
+// fix "+" issue
3494
+ //group.editWindow = this;
3495
+ group.manipWindow = this;
3496
+
30833497 /*
30843498 currentLayout = radio.layout;
30853499 if (currentLayout == null)
30863500 currentLayout = sevenButton;
30873501 */
30883502 radio.layout.doClick();
3503
+
3504
+ ClearUnpinned();
3505
+ SetPinStates(group.selection.size() > 0);
3506
+ if (group.selection.size() == 1)
3507
+ EditSelection(false);
30893508 keepparent = group.parent;
30903509 // PARENT = NULL or not???
30913510 //group.parent = null; // ROOT
30923511 //group.attributes = -1;
30933512 ResetModel();
3513
+
3514
+ cameraView.requestFocusInWindow();
30943515 refreshContents(true);
3095
- }
3516
+ } else if (event.getSource() == editCameraItem)
3517
+ {
3518
+ cameraView.ProtectCamera();
3519
+ cameraView.repaint();
3520
+ return;
3521
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3522
+ {
3523
+ cameraView.RevertCamera();
3524
+ cameraView.repaint();
3525
+ return;
3526
+ // } else if (event.getSource() == textureButton)
3527
+ // {
3528
+ // return; // true;
3529
+ }
30963530 else
30973531 {
30983532 //return super.action(event, arg);
....@@ -3101,7 +3535,6 @@
31013535 }
31023536
31033537 boolean useclient = false;
3104
- cRadio radio;
31053538
31063539 void ToggleRoot()
31073540 {
....@@ -3340,7 +3773,8 @@
33403773
33413774 int size = obj.MemorySize();
33423775
3343
- System.err.println((size/1024) + " KB is the size of " + obj);
3776
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3777
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
33443778 }
33453779 }
33463780 catch (Exception e)
....@@ -3421,6 +3855,13 @@
34213855 void GenNormals(boolean crease)
34223856 {
34233857 group.GenNormalsS(crease);
3858
+
3859
+ refreshContents();
3860
+ }
3861
+
3862
+ void GenNormalsMESH()
3863
+ {
3864
+ group.GenNormalsMeshS();
34243865
34253866 refreshContents();
34263867 }
....@@ -4048,6 +4489,18 @@
40484489 refreshContents();
40494490 }
40504491
4492
+ void RewindLeaves(boolean hide)
4493
+ {
4494
+ group.selection.RewindLeaves(hide);
4495
+ refreshContents();
4496
+ }
4497
+
4498
+ void RandomLeaves(boolean hide)
4499
+ {
4500
+ group.selection.RandomLeaves(hide);
4501
+ refreshContents();
4502
+ }
4503
+
40514504 void SetTexRes(int tr)
40524505 {
40534506 group.selection.SetTexRes(tr);
....@@ -4119,10 +4572,6 @@
41194572 // }
41204573 // }
41214574
4122
- static boolean allparams = true;
4123
-
4124
- static Vector<Object3D> listUI = new Vector<Object3D>();
4125
-
41264575 void EditSelection(boolean newWindow)
41274576 {
41284577 // aConstraints.gridy = 0;
....@@ -4130,10 +4579,10 @@
41304579 {
41314580 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
41324581 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4133
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4582
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
41344583
41354584 Object3D elem = (Object3D)group.selection.elementAt(i);
4136
- if(elem != group)
4585
+ if(elem != group || !newWindow)
41374586 {
41384587 // if (!(elem instanceof Composite))
41394588 // newWindow = false;
....@@ -4215,7 +4664,8 @@
42154664 //new Exception().printStackTrace();
42164665
42174666 freezemodel = true;
4218
-
4667
+ ClearUnpinned();
4668
+
42194669 /**/
42204670 //switch (event.id)
42214671 {
....@@ -4223,7 +4673,6 @@
42234673 //case 702: // Event.LIST_DESELECT
42244674 group.deselectAll();
42254675 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4226
- objEditor.ClearInfo(); // .GetMaterial());
42274676 if (tps != null)
42284677 {
42294678 for (int i=0; i < tps.length; i++)
....@@ -4232,10 +4681,8 @@
42324681
42334682 //if (child.parent != null)
42344683 //child.parent.addSelectee(child);
4684
+ objEditor.SetMaterial(child);
42354685 group.addSelectee(child);
4236
- objEditor.SetMaterial(child); // .GetMaterial());
4237
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4238
- System.err.println("info : " + child.GetPath());
42394686 }
42404687 }
42414688 // else
....@@ -4245,20 +4692,28 @@
42454692 // System.err.println("info : " + group.GetPath());
42464693 // }
42474694
4248
- objEditor.SetText(); // jan 2014
4249
-
4250
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4695
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
42514696 CameraPane.flash = true;
42524697
4253
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4698
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
42544699 // a camera
42554700 {
4256
- CameraPane.camerachangeframe = 0; // don't refuse it
4257
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4701
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4702
+ {
4703
+ CameraPane.camerachangeframe = 0; // don't refuse it
4704
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4705
+ }
42584706 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
42594707 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
42604708 }
42614709
4710
+ if (tps != null && tps.length == 1)
4711
+ {
4712
+ EditSelection(false);
4713
+ }
4714
+
4715
+ SetPinStates(tps != null && tps.length > 0);
4716
+
42624717 refreshContents();
42634718 //return true;
42644719 }
....@@ -4267,6 +4722,35 @@
42674722
42684723 freezemodel = false;
42694724 }
4725
+
4726
+ void SetPinStates(boolean enabled)
4727
+ {
4728
+ editButton.setEnabled(enabled);
4729
+ uneditButton.setEnabled(enabled);
4730
+ unselectButton.setEnabled(enabled);
4731
+ flashSelectionButton.setEnabled(enabled);
4732
+ }
4733
+
4734
+ void refreshContents(boolean cp)
4735
+ {
4736
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4737
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4738
+ {
4739
+ objEditor.ClearInfo(); // .GetMaterial());
4740
+
4741
+ for (int i=0; i < group.selection.Size(); i++)
4742
+ {
4743
+ Object3D child = (Object3D) group.selection.get(i);
4744
+
4745
+ objEditor.AddInfo(child, this, true);
4746
+ System.err.println("info : " + child.GetPath());
4747
+ }
4748
+
4749
+ objEditor.SetText(); // jan 2014
4750
+ }
4751
+
4752
+ super.refreshContents(cp);
4753
+ }
42704754
42714755 void linkSomething(Object3D thing)
42724756 {
....@@ -4338,6 +4822,7 @@
43384822 {
43394823 if (group.selection.isEmpty())
43404824 return;
4825
+
43414826 Grafreed.clipboardIsTempGroup = false;
43424827 Composite tGroup = null;
43434828 if (group.selection.size() > 0) // 1)
....@@ -4348,6 +4833,8 @@
43484833
43494834 if (cut)
43504835 {
4836
+ if (Globals.SAVEONMAKE)
4837
+ Save();
43514838 //int indices[] = jList.getSelectedIndices();
43524839 //for (int i = indices.length - 1; i >= 0; i--)
43534840 //jList.remove(indices[i]);
....@@ -4437,8 +4924,10 @@
44374924 }
44384925
44394926 }
4927
+
44404928 if (Grafreed.clipboardIsTempGroup)
44414929 Grafreed.clipboard = tGroup;
4930
+
44424931 if (cut)
44434932 {
44444933 ResetModel();
....@@ -4970,21 +5459,6 @@
49705459 }
49715460 */
49725461
4973
- void ImportGFD()
4974
- {
4975
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4976
- browser.show();
4977
- String filename = browser.getFile();
4978
- if (filename != null && filename.length() > 0)
4979
- {
4980
- String fullname = browser.getDirectory() + filename;
4981
-
4982
- //Object3D readobj =
4983
- objEditor.ReadGFD(fullname, objEditor);
4984
- //makeSomething(readobj);
4985
- }
4986
- }
4987
-
49885462 /*
49895463 public void Callback(Object obj)
49905464 {
....@@ -5008,23 +5482,6 @@
50085482 }
50095483 */
50105484
5011
- void ImportVRMLX3D()
5012
- {
5013
- if (Grafreed.standAlone)
5014
- {
5015
- /**/
5016
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
5017
- browser.show();
5018
- String filename = browser.getFile();
5019
- if (filename != null && filename.length() > 0)
5020
- {
5021
- String fullname = browser.getDirectory() + filename;
5022
- LoadVRMLX3D(fullname);
5023
- }
5024
- /**/
5025
- }
5026
- }
5027
-
50285485 String GetFile(String dialogName)
50295486 {
50305487 if (Grafreed.standAlone)
....@@ -5095,7 +5552,28 @@
50955552 cButton clearpanelButton;
50965553 cButton unselectButton;
50975554
5555
+ cButton restoreCameraButton;
5556
+
5557
+ cButton saveButton;
50985558 cButton oneStepButton;
5559
+
5560
+ cButton groupButton;
5561
+ cButton ungroupButton;
5562
+ cButton compositeButton;
5563
+ cButton switchButton;
5564
+ cButton loopButton;
5565
+ cButton textureButton;
5566
+
5567
+ cButton gridButton;
5568
+ cButton boxButton;
5569
+ cButton sphereButton;
5570
+ cButton coneButton;
5571
+ cButton torusButton;
5572
+ cButton superButton;
5573
+ cButton kleinButton;
5574
+ cButton particlesButton;
5575
+ cButton overlayButton;
5576
+ cButton lightButton;
50995577
51005578 cButton screenfitButton;
51015579 cButton screenfitpointButton;
....@@ -5108,14 +5586,6 @@
51085586
51095587 cButton setsupportButton;
51105588
5111
- cButton twoButton;
5112
- cButton sixButton;
5113
- cButton threeButton;
5114
- cButton sevenButton;
5115
- cButton fourButton; // full panel
5116
- cButton oneButton; // full XYZ
5117
- //cButton currentLayout;
5118
-
51195589 //
51205590 //Composite
51215591 Object3D // to do !!
....@@ -5125,9 +5595,11 @@
51255595 //JTree jTree;
51265596 private MenuItem lookAtItem;
51275597 private MenuItem lookFromItem;
5128
- private MenuItem switchItem;
5598
+ private MenuItem switchViewItem;
51295599 private MenuItem cutItem;
5130
- private MenuItem duplicateItem;
5600
+ private MenuItem undoItem;
5601
+ private MenuItem redoItem;
5602
+ private JMenuItem duplicateItem;
51315603 private MenuItem cloneItem;
51325604 private MenuItem cloneSupportItem;
51335605 private MenuItem overwriteGeoItem;
....@@ -5190,6 +5662,10 @@
51905662 private MenuItem showleavesItem;
51915663 private MenuItem markleavesItem;
51925664 private MenuItem unmarkleavesItem;
5665
+ private MenuItem rewindleavesItem;
5666
+ private MenuItem unrewindleavesItem;
5667
+ private MenuItem randomleavesItem;
5668
+ private MenuItem unrandomleavesItem;
51935669
51945670 private MenuItem flipVItem;
51955671 private MenuItem unflipVItem;
....@@ -5211,7 +5687,7 @@
52115687 private MenuItem frontItem;
52125688 private MenuItem cameraItem;
52135689 private MenuItem compositeItem;
5214
- private MenuItem randomItem;
5690
+ private MenuItem switchItem;
52155691 private MenuItem physicsItem;
52165692 private MenuItem frameselectorItem;
52175693 private MenuItem scriptNodeItem;
....@@ -5273,11 +5749,6 @@
52735749 private MenuItem doubleItem;
52745750 private MenuItem tripleItem;
52755751
5276
- private MenuItem importGFDItem;
5277
- private MenuItem importVRMLX3DItem;
5278
- private MenuItem import3DSItem;
5279
- private MenuItem importOBJItem;
5280
-
52815752 private MenuItem computeAOItem;
52825753 private MenuItem recompileItem;
52835754 private MenuItem editScriptItem;
....@@ -5287,4 +5758,8 @@
52875758 private MenuItem analyzeItem;
52885759 private MenuItem dumpItem;
52895760 //boolean freezemodel = false;
5761
+
5762
+ Menu cameraMenu;
5763
+ MenuItem editCameraItem;
5764
+ MenuItem restoreCameraItem;
52905765 }