Normand Briere
2019-08-17 07c0c67b88160b51e61c5c1d2b9b602daafa44a9
ObjEditor.java
....@@ -4,6 +4,7 @@
44
55 import java.awt.*;
66 import java.awt.event.*;
7
+import java.awt.image.BufferedImage;
78 import javax.swing.*;
89 import javax.swing.event.*;
910 import javax.swing.text.*;
....@@ -13,6 +14,9 @@
1314 import javax.swing.plaf.metal.MetalLookAndFeel;
1415 //import javax.swing.plaf.ColorUIResource;
1516 //import javax.swing.plaf.metal.DefaultMetalTheme;
17
+
18
+import javax.swing.plaf.basic.BasicSplitPaneDivider;
19
+import javax.swing.plaf.basic.BasicSplitPaneUI;
1620
1721 //import javax.media.opengl.GLCanvas;
1822
....@@ -30,11 +34,128 @@
3034 iSendInfo
3135 //KeyListener
3236 {
37
+ public cToggleButton pinButton;
3338 boolean timeline;
3439 boolean wasFullScreen;
3540
3641 GroupEditor callee;
3742 JFrame frame;
43
+
44
+ static ObjEditor theFrame;
45
+
46
+ public void AllocProjectedVertices(Object3D object)
47
+ {
48
+ assert (object.projectedVertices != null);
49
+
50
+ if (object.projectedVertices.length <= 2)
51
+ {
52
+ // Side effect...
53
+ Object3D.cVector2[] keep = object.projectedVertices;
54
+ object.projectedVertices = new Object3D.cVector2[3];
55
+ for (int i = 0; i < 3; i++)
56
+ {
57
+ if (i < keep.length)
58
+ {
59
+ object.projectedVertices[i] = keep[i];
60
+ } else
61
+ {
62
+ object.projectedVertices[i] = new Object3D.cVector2();
63
+ }
64
+ /*
65
+ if(keep.length == 0)
66
+ object.projectedVertices[0] = new Object3D.cVector2();
67
+ else
68
+ object.projectedVertices[0] = keep[0];
69
+ object.projectedVertices[1] = new Object3D.cVector2();
70
+ */
71
+ }
72
+ }
73
+ }
74
+
75
+ public cGridBag GetSeparator()
76
+ {
77
+ cGridBag separator = new cGridBag();
78
+ separator.add(new JSeparator());
79
+ separator.preferredHeight = 5;
80
+ return separator;
81
+ }
82
+
83
+ cButton GetButton(String name, boolean border)
84
+ {
85
+ ImageIcon icon = GetIcon(name);
86
+ return new cButton(icon, border);
87
+ }
88
+
89
+ cLabel GetLabel(String name, boolean border)
90
+ {
91
+ //ImageIcon icon = GetIcon(name);
92
+ return new cLabel(GetImage(name), border);
93
+ }
94
+
95
+ cToggleButton GetToggleButton(String name, boolean border)
96
+ {
97
+ ImageIcon icon = GetIcon(name);
98
+ return new cToggleButton(icon, border);
99
+ }
100
+
101
+ cCheckBox GetCheckBox(String name, boolean border)
102
+ {
103
+ ImageIcon icon = GetIcon(name);
104
+ return new cCheckBox(icon, border);
105
+ }
106
+
107
+ static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>();
108
+
109
+ ImageIcon GetIcon(String name)
110
+ {
111
+ javax.swing.ImageIcon iconCache = icons.get(name);
112
+ if (iconCache != null)
113
+ {
114
+ return iconCache;
115
+ }
116
+
117
+ try
118
+ {
119
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
120
+
121
+// if (image.getWidth() > 48 && image.getHeight() > 48)
122
+// {
123
+// BufferedImage resized = new BufferedImage(48, 48, image.getType());
124
+// Graphics2D g = resized.createGraphics();
125
+// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
126
+// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
127
+// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
128
+// g.dispose();
129
+//
130
+// image = resized;
131
+// }
132
+
133
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
134
+
135
+ icons.put(name, icon);
136
+
137
+ return icon;
138
+ }
139
+ catch (Exception e)
140
+ {
141
+ //icons.put(name, null);
142
+ return null;
143
+ }
144
+ }
145
+
146
+ BufferedImage GetImage(String name)
147
+ {
148
+ try
149
+ {
150
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
151
+
152
+ return image;
153
+ }
154
+ catch (Exception e)
155
+ {
156
+ return null;
157
+ }
158
+ }
38159
39160 // SCRIPT
40161
....@@ -143,7 +264,9 @@
143264 //nameField.removeActionListener(this);
144265 // objEditor.ctrlPanel.remove(nameField);
145266
146
- if (!GroupEditor.allparams)
267
+ objEditor.ctrlPanel.remove(namePanel);
268
+
269
+ if (!allparams)
147270 return;
148271
149272 // objEditor.ctrlPanel.remove(liveCB);
....@@ -165,9 +288,9 @@
165288 // objEditor.ctrlPanel.remove(fasterButton);
166289 // objEditor.ctrlPanel.remove(remarkButton);
167290
168
- objEditor.ctrlPanel.remove(namePanel);
169291 objEditor.ctrlPanel.remove(setupPanel);
170
- objEditor.ctrlPanel.remove(commandsPanel);
292
+ objEditor.ctrlPanel.remove(setupPanel2);
293
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
171294 objEditor.ctrlPanel.remove(pushPanel);
172295 //objEditor.ctrlPanel.remove(fillPanel);
173296
....@@ -215,6 +338,14 @@
215338 client = inClient;
216339 copy = client;
217340
341
+// if (copy.versionlist == null)
342
+// {
343
+// copy.versionlist = new Object3D[100];
344
+// copy.versionindex = -1;
345
+//
346
+// callee.Save(true);
347
+// }
348
+
218349 // "this" is not called: SetupUI2(objEditor);
219350 }
220351
....@@ -228,6 +359,14 @@
228359 client = inClient;
229360 copy = client;
230361
362
+ if (copy.versionlist == null)
363
+ {
364
+ copy.versionlist = new Object3D[100];
365
+ copy.versionindex = -1;
366
+
367
+// Save(true);
368
+ }
369
+
231370 SetupUI2(callee.GetEditor());
232371 }
233372
....@@ -242,13 +381,15 @@
242381 //localCopy.parent = null;
243382
244383 frame = new JFrame();
384
+ frame.setUndecorated(false);
245385 objEditor = this;
246386 this.callee = callee;
247387
248388 //parent = p;
249389
250390 GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
251
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
391
+ if (Globals.DEBUG)
392
+ System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
252393 //gd.setFullScreenWindow(this);
253394 //setResizable(false);
254395 //if (!isDisplayable())
....@@ -259,6 +400,14 @@
259400 copy = localCopy;
260401 copy.editWindow = this;
261402
403
+// if (copy.versionlist == null)
404
+// {
405
+// copy.versionlist = new Object3D[100];
406
+// copy.versionindex = -1;
407
+//
408
+// Save(true);
409
+// }
410
+
262411 SetupMenu();
263412
264413 //SetupName(objEditor); // new
....@@ -272,28 +421,52 @@
272421 return frame.action(event, obj);
273422 }
274423
424
+ // Cannot work without static
425
+ static boolean allparams = true;
426
+
427
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
428
+
429
+ // This is to refresh the UI of the material panel.
430
+ boolean patchMaterial;
431
+
275432 void SetupMenu()
276433 {
277434 frame.setMenuBar(menuBar = new MenuBar());
278
- menuBar.add(windowMenu = new Menu("File"));
279
- windowMenu.add(loadItem = new MenuItem("Load..."));
280
- windowMenu.add("-");
281
- windowMenu.add(saveItem = new MenuItem("Save"));
282
- windowMenu.add(saveAsItem = new MenuItem("Save As..."));
435
+ menuBar.add(fileMenu = new Menu("File"));
436
+ fileMenu.add(newItem = new MenuItem("New"));
437
+ fileMenu.add(openItem = new MenuItem("Open..."));
438
+
439
+ //oe.menuBar.add(menu = new Menu("Include"));
440
+ Menu menu = new Menu("Import");
441
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
442
+ importOBJItem.addActionListener(this);
443
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
444
+ import3DSItem.addActionListener(this);
445
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
446
+ importVRMLX3DItem.addActionListener(this);
447
+ menu.add("-");
448
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
449
+ importGFDItem.addActionListener(this);
450
+ fileMenu.add(menu);
451
+ fileMenu.add("-");
452
+
453
+ fileMenu.add(saveItem = new MenuItem("Save"));
454
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
283455 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
284
- windowMenu.add("-");
285
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
286
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
287
- windowMenu.add("-");
456
+ fileMenu.add("-");
457
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
458
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
459
+ fileMenu.add("-");
288460 if (client.parent != null)
289461 {
290
- windowMenu.add(closeItem = new MenuItem("Close"));
462
+ fileMenu.add(closeItem = new MenuItem("Close"));
291463 } else
292464 {
293
- windowMenu.add(closeItem = new MenuItem("Exit"));
465
+ fileMenu.add(closeItem = new MenuItem("Exit"));
294466 }
295467
296
- loadItem.addActionListener(this);
468
+ newItem.addActionListener(this);
469
+ openItem.addActionListener(this);
297470 saveItem.addActionListener(this);
298471 saveAsItem.addActionListener(this);
299472 exportAsItem.addActionListener(this);
....@@ -301,84 +474,103 @@
301474 //povItem.addActionListener(this);
302475 closeItem.addActionListener(this);
303476
304
- menuBar.add(cameraMenu = new Menu("View"));
305
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
306
- //zBufferItem.addActionListener(this);
307
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
308
- //normalLensItem.addActionListener(this);
309
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
310
- revertCameraItem.addActionListener(this);
311
- cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
312
- toggleTimelineItem.addItemListener(this);
313
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
314
- toggleFullScreenItem.addItemListener(this);
315
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
316
- cameraMenu.add("-");
317
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
318
- toggleTextureItem.addItemListener(this);
319
- toggleTextureItem.setState(CameraPane.textureon);
320
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
321
- toggleLiveItem.addItemListener(this);
322
- toggleLiveItem.setState(Globals.isLIVE());
323
- cameraMenu.add(stepItem = new MenuItem("Step"));
324
- stepItem.addActionListener(this);
325
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
326
-// toggleDLItem.addItemListener(this);
327
-// toggleDLItem.setState(false);
328
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
329
- toggleRenderItem.addItemListener(this);
330
- toggleRenderItem.setState(!CameraPane.frozen);
331
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
332
- toggleDebugItem.addItemListener(this);
333
- toggleDebugItem.setState(CameraPane.DEBUG);
334
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
335
- toggleFrustumItem.addItemListener(this);
336
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
337
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
338
- toggleFootContactItem.addItemListener(this);
339
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
340
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
341
- toggleRandomItem.addItemListener(this);
342
- toggleRandomItem.setState(CameraPane.RANDOM);
343
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
344
- toggleHandleItem.addItemListener(this);
345
- toggleHandleItem.setState(CameraPane.HANDLES);
346
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
347
- togglePaintItem.addItemListener(this);
348
- togglePaintItem.setState(CameraPane.PAINTMODE);
349
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
350
-// toggleRootItem.addItemListener(this);
351
-// toggleRootItem.setState(false);
352
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
353
-// animationItem.addItemListener(this);
354
-// animationItem.setState(CameraPane.ANIMATION);
355
- cameraMenu.add("-");
356
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
357
- editCameraItem.addActionListener(this);
358
-
359477 objectPanel = new JTabbedPane();
478
+
479
+ ChangeListener changeListener = new ChangeListener()
480
+ {
481
+ //String name;
482
+
483
+ public void stateChanged(ChangeEvent changeEvent)
484
+ {
485
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
486
+// {
487
+// if (latestObject != null)
488
+// {
489
+// refreshContents(true);
490
+// SetMaterial(latestObject);
491
+// }
492
+//
493
+// materialFlushed = true;
494
+// }
495
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
496
+// {
497
+// if (listUI.size() == 0)
498
+// EditSelection(false);
499
+// }
500
+
501
+// if (objectPanel.getSelectedIndex() == 4)
502
+// {
503
+// name = copy.skyboxname;
504
+//
505
+// if (name == null)
506
+// {
507
+// name = "";
508
+// }
509
+//
510
+// copy.skyboxname = "cubemaps/default-skyboxes/rgb";
511
+// copy.skyboxext = "jpg";
512
+// }
513
+// else
514
+// {
515
+// if (name != null)
516
+// {
517
+// if (name.equals(""))
518
+// {
519
+// copy.skyboxname = null;
520
+// copy.skyboxext = null;
521
+// }
522
+// else
523
+// {
524
+// copy.skyboxname = name;
525
+// }
526
+// }
527
+// }
528
+ cameraView.transformMode = objectPanel.getSelectedIndex() == 4;
529
+
530
+// refreshContents(false); // To refresh Info tab
531
+ cameraView.repaint();
532
+ }
533
+ };
534
+ objectPanel.addChangeListener(changeListener);
535
+
360536 toolbarPanel = new JPanel();
361537 toolbarPanel.setName("Toolbar");
538
+
362539 treePanel = new cGridBag();
363540 treePanel.setName("Tree");
541
+
542
+ editPanel = new cGridBag().setVertical(true);
543
+ //editPanel.setName("Edit");
544
+
364545 ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
365
- ctrlPanel.setName("Edit");
366
- materialPanel = new cGridBag().setVertical(true);
367
- materialPanel.setName("Material");
546
+
547
+ editCommandsPanel = new cGridBag();
548
+ editPanel.add(editCommandsPanel);
549
+ editPanel.add(ctrlPanel);
550
+
551
+ toolboxPanel = new cGridBag().setVertical(true);
552
+ //toolboxPanel.setName("Toolbox");
553
+
554
+ skyboxPanel = new cGridBag().setVertical(true);
555
+
556
+ materialPanel = new cGridBag().setVertical(false);
557
+ //materialPanel.setName("Material");
558
+
368559 /*JTextPane*/
369560 infoarea = createTextPane();
370561 doc = infoarea.getStyledDocument();
371562
372563 infoarea.setEditable(true);
373564 SetText();
565
+
374566 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
375567 // infoarea.setOpaque(false);
376568 // //infoarea.setForeground(textcolor);
377569 // TEXTAREA infoarea.setLineWrap(true);
378570 // TEXTAREA infoarea.setWrapStyleWord(true);
379571 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
380
- infoPanel.setPreferredSize(new Dimension(50, 200));
381
- infoPanel.setName("Info");
572
+ infoPanel.setPreferredSize(new Dimension(1, 1));
573
+ //infoPanel.setName("Info");
382574 //infoPanel.setLayout(new BorderLayout());
383575 //infoPanel.add(createTextPane());
384576
....@@ -389,7 +581,14 @@
389581 mainPanel.setDividerSize(9);
390582 mainPanel.setDividerLocation(0.5); //1.0);
391583 mainPanel.setResizeWeight(0.5);
392
-
584
+
585
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
586
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
587
+ divider.setDividerSize(15);
588
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
589
+
590
+ mainPanel.setUI(new BasicSplitPaneUI());
591
+
393592 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
394593 //mainPanel.setLayout(new GridBagLayout());
395594 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
....@@ -457,10 +656,10 @@
457656 e.printStackTrace();
458657 }
459658
460
- String selection = infoarea.getText();
461
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
462
- java.awt.datatransfer.Clipboard clipboard =
463
- Toolkit.getDefaultToolkit().getSystemClipboard();
659
+// String selection = infoarea.getText();
660
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
661
+// java.awt.datatransfer.Clipboard clipboard =
662
+// Toolkit.getDefaultToolkit().getSystemClipboard();
464663 //clipboard.setContents(data, data);
465664 }
466665
....@@ -483,13 +682,13 @@
483682 //SendInfo("Name:", "bold");
484683 if (sel.GetTextures() != null || debug)
485684 {
486
- si.SendInfo(sel.toString(), "bold");
685
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
487686 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
488687 if (sel.Size() > 0)
489688 {
490689 si.SendInfo("#children = " + sel.Size(), "regular");
491690 }
492
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
691
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
493692 if (debug)
494693 {
495694 try
....@@ -531,7 +730,7 @@
531730 }
532731 if (sel.support != null)
533732 {
534
- si.SendInfo(" support: " + sel.support, "regular");
733
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
535734 }
536735 if (sel.scriptnode != null)
537736 {
....@@ -620,21 +819,164 @@
620819 }
621820 }
622821
822
+//static GraphicsDevice device = GraphicsEnvironment
823
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
824
+
825
+ Rectangle keeprect;
826
+ cRadio radio;
827
+
828
+cButton keepButton;
829
+ cButton twoButton; // Full 3D
830
+ cButton sixButton;
831
+ cButton threeButton;
832
+ cButton sevenButton;
833
+ cButton fourButton; // full panel
834
+ cButton oneButton; // full XYZ
835
+ //cButton currentLayout;
836
+
837
+ boolean maximized;
838
+
839
+ cButton fullscreenLayout;
840
+ cButton expandedLayout;
841
+
842
+ void Minimize()
843
+ {
844
+ frame.setState(Frame.ICONIFIED);
845
+ frame.validate();
846
+ }
847
+
848
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
849
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
850
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
851
+ void Maximize()
852
+ {
853
+ if (CameraPane.FULLSCREEN)
854
+ {
855
+ ToggleFullScreen();
856
+ }
857
+
858
+ if (maximized)
859
+ {
860
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
861
+ }
862
+ else
863
+ {
864
+ keeprect = frame.getBounds();
865
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
866
+// Dimension rect2 = frame.getToolkit().getScreenSize();
867
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
868
+// frame.setState(Frame.MAXIMIZED_BOTH);
869
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
870
+ }
871
+
872
+ maximized ^= true;
873
+
874
+ frame.validate();
875
+ }
876
+
877
+ cButton minButton;
878
+ cButton maxButton;
879
+ cButton fullButton;
880
+ cButton collapseButton;
881
+ cButton maximize3DButton;
882
+
623883 void ToggleFullScreen()
624884 {
625
- if (CameraPane.FULLSCREEN)
885
+ GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
886
+
887
+ cameraView.ToggleFullScreen();
888
+
889
+ if (!CameraPane.FULLSCREEN)
626890 {
627
- frame.getContentPane().remove(/*"Center",*/bigThree);
628
- framePanel.add(bigThree);
629
- frame.getContentPane().add(/*"Center",*/framePanel);
891
+ device.setFullScreenWindow(null);
892
+ frame.dispose();
893
+ frame.setUndecorated(false);
894
+ frame.validate();
895
+ frame.setVisible(true);
896
+
897
+ //frame.setVisible(false);
898
+// frame.removeNotify();
899
+// frame.setUndecorated(false);
900
+// frame.addNotify();
901
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
902
+
903
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
904
+// X framePanel.add(bigThree);
905
+// X frame.getContentPane().add(/*"Center",*/framePanel);
906
+// framePanel.setDividerLocation(46); // icons are 24x24
907
+
908
+ //frame.setVisible(true);
909
+// radio.layout = keepButton;
910
+ //theFrame = null;
911
+ keepButton = null;
912
+// radio.layout.doClick();
913
+
630914 } else
631915 {
632
- frame.getContentPane().remove(/*"Center",*/framePanel);
633
- framePanel.remove(bigThree);
634
- frame.getContentPane().add(/*"Center",*/bigThree);
916
+ keepButton = radio.layout;
917
+ //keeprect = frame.getBounds();
918
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
919
+// frame.getToolkit().getScreenSize().height);
920
+ //frame.setVisible(false);
921
+
922
+ frame.dispose();
923
+ frame.setUndecorated(true);
924
+ device.setFullScreenWindow(frame);
925
+ frame.validate();
926
+ frame.setVisible(true);
927
+// frame.removeNotify();
928
+// frame.setUndecorated(true);
929
+// frame.addNotify();
930
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
931
+// X framePanel.remove(bigThree);
932
+// X frame.getContentPane().add(/*"Center",*/bigThree);
933
+// framePanel.setDividerLocation(0);
934
+
935
+// radio.layout = fullscreenLayout;
936
+// radio.layout.doClick();
937
+ //frame.setVisible(true);
635938 }
636
- cameraView.ToggleFullScreen();
939
+ frame.validate();
940
+
941
+ cameraView.requestFocusInWindow();
637942 }
943
+
944
+ void CollapseToolbar()
945
+ {
946
+ framePanel.setDividerLocation(0);
947
+ //frame.validate();
948
+
949
+ cameraView.requestFocusInWindow();
950
+ }
951
+
952
+ private Object3D Duplicate(Object3D object)
953
+ {
954
+ boolean temp = CameraPane.SWITCH;
955
+ CameraPane.SWITCH = false;
956
+
957
+ if (Grafreed.grafreed.universe.versiontable == null)
958
+ Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
959
+
960
+ object.ExtractBigData(Grafreed.grafreed.universe.versiontable);
961
+ // if (copy == client)
962
+
963
+ Object3D versions[] = object.versionlist;
964
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe
965
+ object.versionlist = null;
966
+ object.versiontable = null;
967
+
968
+ //byte[] compress = Compress(copy);
969
+ Object3D compress = (Object3D)Grafreed.clone(object);
970
+
971
+ object.versionlist = versions;
972
+ object.versiontable = versiontable; // if Grafreed.grafreed.universe
973
+
974
+ object.RestoreBigData(Grafreed.grafreed.universe.versiontable);
975
+
976
+ CameraPane.SWITCH = temp;
977
+
978
+ return compress;
979
+ }
638980
639981 private JTextPane createTextPane()
640982 {
....@@ -734,7 +1076,7 @@
7341076 protected static ImageIcon createImageIcon(String path,
7351077 String description)
7361078 {
737
- java.net.URL imgURL = GrafreeD.class.getResource(path);
1079
+ java.net.URL imgURL = Grafreed.class.getResource(path);
7381080 if (imgURL != null)
7391081 {
7401082 return new ImageIcon(imgURL, description);
....@@ -757,6 +1099,7 @@
7571099 {
7581100 SetupMaterial(materialPanel);
7591101 }
1102
+
7601103 //SetupName();
7611104 //SetupViews();
7621105 }
....@@ -766,6 +1109,7 @@
7661109 // NumberSlider vDivsField;
7671110 // JCheckBox endcaps;
7681111 JCheckBox liveCB;
1112
+ JCheckBox selectableCB;
7691113 JCheckBox hideCB;
7701114 JCheckBox link2masterCB;
7711115 JCheckBox markCB;
....@@ -773,7 +1117,12 @@
7731117 JCheckBox speedupCB;
7741118 JCheckBox rewindCB;
7751119 JCheckBox flipVCB;
1120
+
1121
+ cCheckBox toggleTextureCB;
1122
+ cCheckBox toggleSwitchCB;
1123
+
7761124 JComboBox texresMenu;
1125
+
7771126 JButton resetButton;
7781127 JButton stepButton;
7791128 JButton stepAllButton;
....@@ -782,9 +1131,13 @@
7821131 JButton fasterButton;
7831132 JButton remarkButton;
7841133
1134
+ cGridBag editPanel;
1135
+ cGridBag editCommandsPanel;
1136
+
7851137 cGridBag namePanel;
7861138 cGridBag setupPanel;
787
- cGridBag commandsPanel;
1139
+ cGridBag setupPanel2;
1140
+ cGridBag objectCommandsPanel;
7881141 cGridBag pushPanel;
7891142 cGridBag fillPanel;
7901143
....@@ -951,52 +1304,88 @@
9511304
9521305 void SetupUI2(ObjEditor oe)
9531306 {
954
-// oe.aConstraints.weightx = 0;
955
-// oe.aConstraints.weighty = 0;
956
-// oe.aConstraints.gridx = 0;
957
-// oe.aConstraints.gridy = 0;
9581307 //SetupName(oe);
9591308
9601309 namePanel = new cGridBag();
9611310
1311
+ //if (copy.pinned)
1312
+ {
1313
+ pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF);
1314
+ pinButton.setSelected(copy.pinned);
1315
+ cGridBag t = new cGridBag();
1316
+ t.preferredWidth = 2;
1317
+ t.add(pinButton);
1318
+ namePanel.add(t);
1319
+
1320
+ pinButton.addItemListener(this);
1321
+ }
1322
+
9621323 nameField = AddText(namePanel, copy.GetName());
963
- namePanel.add(nameField);
1324
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
9641325 oe.ctrlPanel.add(namePanel);
9651326
9661327 oe.ctrlPanel.Return();
9671328
968
- if (!GroupEditor.allparams)
1329
+ if (!allparams)
9691330 return;
9701331
9711332 setupPanel = new cGridBag().setVertical(false);
9721333
9731334 liveCB = AddCheckBox(setupPanel, "Live", copy.live);
974
- link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master);
975
- hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1335
+ liveCB.setToolTipText("Animate object");
1336
+ markCB = AddCheckBox(setupPanel, "Anim", copy.marked);
1337
+ markCB.setToolTipText("Set target transform");
1338
+ selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1339
+ selectableCB.setToolTipText("Make object selectable");
9761340 // Return();
977
- markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
978
- rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind);
979
- randomCB = AddCheckBox(setupPanel, "Rand", copy.random);
1341
+
1342
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1343
+ hideCB.setToolTipText("Hide object");
1344
+
1345
+ ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
1346
+
1347
+ setupPanel2 = new cGridBag().setVertical(false);
1348
+
1349
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1350
+ rewindCB.setToolTipText("Rewind animation");
1351
+
1352
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1353
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
9801354
1355
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1356
+ link2masterCB.setToolTipText("Attach to support");
1357
+
1358
+ if (Globals.ADVANCED)
1359
+ {
1360
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1361
+ speedupCB.setToolTipText("Option motion capture");
1362
+ }
1363
+
9811364 oe.ctrlPanel.add(setupPanel);
9821365 oe.ctrlPanel.Return();
1366
+ oe.ctrlPanel.add(setupPanel2);
1367
+ oe.ctrlPanel.Return();
9831368
984
- commandsPanel = new cGridBag().setVertical(false);
1369
+ objectCommandsPanel = new cGridBag().setVertical(false);
9851370
986
- resetButton = AddButton(commandsPanel, "Reset");
987
- stepButton = AddButton(commandsPanel, "Step");
1371
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1372
+ resetButton.setToolTipText("Jump to frame zero");
1373
+ stepButton = AddButton(objectCommandsPanel, "Step");
1374
+ stepButton.setToolTipText("Step one frame");
9881375 // resetAllButton = AddButton(oe, "Reset All");
9891376 // stepAllButton = AddButton(oe, "Step All");
990
- speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup);
9911377 // Return();
992
- slowerButton = AddButton(commandsPanel, "Slow");
993
- fasterButton = AddButton(commandsPanel, "Fast");
994
- remarkButton = AddButton(commandsPanel, "Remark");
1378
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1379
+ slowerButton.setToolTipText("Decrease animation speed");
1380
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1381
+ fasterButton.setToolTipText("Increase animation speed");
1382
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1383
+ remarkButton.setToolTipText("Set the current transform as the target");
9951384
996
- oe.ctrlPanel.add(commandsPanel);
1385
+ oe.ctrlPanel.add(objectCommandsPanel);
9971386 oe.ctrlPanel.Return();
9981387
999
- pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1);
1388
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
10001389 normalpushField = (cNumberSlider)pushPanel.getComponent(1);
10011390 //Return();
10021391
....@@ -1153,6 +1542,7 @@
11531542
11541543 if (cam == null || !(copy.get(0) instanceof cGroup))
11551544 {
1545
+ if (Globals.DEBUG)
11561546 System.out.println("CREATE CAMERAS");
11571547 cams = new cTemplate();
11581548 cams.name = "Cameras";
....@@ -1199,8 +1589,11 @@
11991589 //worldPanel.setName("World");
12001590 centralPanel = new cGridBag();
12011591 centralPanel.preferredWidth = 20;
1202
- timelinePanel = new JPanel(new BorderLayout());
1203
- timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
1592
+
1593
+ if (Globals.ADVANCED)
1594
+ {
1595
+ timelinePanel = new JPanel(new BorderLayout());
1596
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
12041597
12051598 cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
12061599 cameraPanel.setContinuousLayout(true);
....@@ -1209,7 +1602,10 @@
12091602 // cameraPanel.setDividerSize(9);
12101603 cameraPanel.setResizeWeight(1.0);
12111604
1605
+ }
1606
+
12121607 centralPanel.add(cameraView);
1608
+ centralPanel.setFocusable(true);
12131609 //frame.setJMenuBar(timelineMenubar);
12141610 //centralPanel.add(timelinePanel);
12151611
....@@ -1235,6 +1631,7 @@
12351631 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
12361632 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
12371633 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1634
+ //XYZPanel.setName("XYZ");
12381635
12391636 /*
12401637 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1271,14 +1668,34 @@
12711668
12721669 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12731670 //tmp.setName("Edit");
1671
+ objectPanel.add(toolboxPanel);
1672
+ objectPanel.setIconAt(0, GetIcon("icons/primitives.png"));
1673
+ objectPanel.setToolTipTextAt(0, "Objects & textures");
1674
+
12741675 objectPanel.add(materialPanel);
1676
+ objectPanel.setIconAt(1, GetIcon("icons/material.png"));
1677
+ objectPanel.setToolTipTextAt(1, "Material");
1678
+
1679
+ objectPanel.add(skyboxPanel);
1680
+ objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg"));
1681
+ objectPanel.setToolTipTextAt(2, "Backgrounds");
1682
+
12751683 // JPanel north = new JPanel(new BorderLayout());
12761684 // north.setName("Edit");
12771685 // north.add(ctrlPanel, BorderLayout.NORTH);
12781686 // objectPanel.add(north);
1279
- objectPanel.add(ctrlPanel);
1280
- objectPanel.add(infoPanel);
1281
-
1687
+ objectPanel.add(editPanel);
1688
+ objectPanel.setIconAt(3, GetIcon("icons/write.png"));
1689
+ objectPanel.setToolTipTextAt(3, "Edit controls");
1690
+
1691
+ objectPanel.add(XYZPanel);
1692
+ objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
1693
+ objectPanel.setToolTipTextAt(4, "XYZ/RGB transform");
1694
+
1695
+ patchMaterial = true;
1696
+ cameraView.patchMaterial = this;
1697
+ objectPanel.setSelectedIndex(1);
1698
+
12821699 /*
12831700 aConstraints.gridx = 0;
12841701 aConstraints.gridwidth = 1;
....@@ -1286,7 +1703,7 @@
12861703 aConstraints.gridy += 1;
12871704 aConstraints.gridwidth = 1;
12881705 mainPanel.add(objectPanel, aConstraints);
1289
- */
1706
+ */
12901707
12911708 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12921709 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1298,14 +1715,12 @@
12981715 scrollpane.addMouseWheelListener(this); // Default not fast enough
12991716
13001717 /*JTabbedPane*/ scenePanel = new cGridBag();
1301
- scenePanel.preferredWidth = 7;
1718
+ scenePanel.preferredWidth = 5;
13021719
13031720 JTabbedPane tabbedPane = new JTabbedPane();
13041721 tabbedPane.add(scrollpane);
13051722
1306
- tabbedPane.add(FSPane = new cFileSystemPane(this));
1307
-
1308
- optionsPanel = new cGridBag().setVertical(true);
1723
+ optionsPanel = new cGridBag().setVertical(false);
13091724
13101725 optionsPanel.setName("Options");
13111726
....@@ -1313,8 +1728,15 @@
13131728
13141729 tabbedPane.add(optionsPanel);
13151730
1731
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
1732
+
13161733 scenePanel.add(tabbedPane);
13171734
1735
+ //if (Globals.ADVANCED)
1736
+// tabbedPane.add(infoPanel);
1737
+// tabbedPane.setIconAt(3, GetIcon("icons/info.png"));
1738
+// tabbedPane.setToolTipTextAt(3, "Information");
1739
+
13181740 /*
13191741 cTree jTree = new cTree(null);
13201742 ToolTipManager.sharedInstance().registerComponent(jTree);
....@@ -1376,7 +1798,7 @@
13761798 bigThree = new cGridBag();
13771799 bigThree.addComponent(scenePanel);
13781800 bigThree.addComponent(centralPanel);
1379
- bigThree.addComponent(XYZPanel);
1801
+ //bigThree.addComponent(XYZPanel);
13801802
13811803 // // SIDE EFFECT!!!
13821804 // aConstraints.gridx = 0;
....@@ -1385,16 +1807,33 @@
13851807 // aConstraints.gridheight = 1;
13861808
13871809 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1388
- framePanel.setContinuousLayout(true);
1389
- framePanel.setOneTouchExpandable(true);
1390
- framePanel.setDividerLocation(0.8);
1810
+
1811
+ framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,
1812
+ new java.beans.PropertyChangeListener()
1813
+ {
1814
+ public void propertyChange(java.beans.PropertyChangeEvent pce)
1815
+ {
1816
+ if ((Integer)pce.getOldValue() == 1)
1817
+ {
1818
+ if (radio.layout != expandedLayout)
1819
+ {
1820
+ radio.layout = expandedLayout;
1821
+ radio.layout.doClick();
1822
+ }
1823
+ }
1824
+ }
1825
+ });
1826
+
1827
+ framePanel.setContinuousLayout(false);
1828
+ framePanel.setOneTouchExpandable(false);
1829
+ //.setDividerLocation(0.8);
13911830 //framePanel.setDividerSize(15);
13921831 //framePanel.setResizeWeight(0.15);
13931832 framePanel.setName("Frame");
13941833
13951834 frame.getContentPane().setLayout(new BorderLayout());
13961835 /**/
1397
- JTabbedPane worldPane = new JTabbedPane();
1836
+ //JTabbedPane worldPane = new JTabbedPane();
13981837 //worldPane.add(bigPanel);
13991838 //worldPane.add(worldPanel);
14001839 /**/
....@@ -1404,15 +1843,19 @@
14041843
14051844 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
14061845
1407
- frame.setSize(1024, 768);
1408
- frame.show();
1409
-
1846
+ frame.setSize(1280, 860);
1847
+
1848
+ cameraView.requestFocusInWindow();
1849
+
14101850 gridPanel.setDividerLocation(1.0);
1851
+
1852
+ frame.validate();
1853
+
1854
+ frame.setVisible(true);
14111855
14121856 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
14131857 frame.addWindowListener(new WindowAdapter()
14141858 {
1415
-
14161859 public void windowClosing(WindowEvent e)
14171860 {
14181861 Close();
....@@ -1435,28 +1878,445 @@
14351878 ctrlPanel.removeAll();
14361879 }
14371880
1438
- void SetupMaterial(cGridBag panel)
1881
+ void SetupMaterial(cGridBag materialpanel)
14391882 {
1440
- /*
1883
+ cGridBag presetpanel = new cGridBag().setVertical(true);
1884
+
1885
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF);
1886
+ skin.setToolTipText("Skin");
1887
+ skin.addMouseListener(new MouseAdapter()
1888
+ {
1889
+ public void mouseClicked(MouseEvent e)
1890
+ {
1891
+ Object3D object = Grafreed.materials.versionlist[0].get(0);
1892
+ cMaterial material = object.material;
1893
+
1894
+ // Skin
1895
+ colorField.setFloat(material.color);
1896
+ float saturation = material.modulation;
1897
+
1898
+ if (!cameraView.Skinshader)
1899
+ {
1900
+ saturation /= 1.5;
1901
+ }
1902
+
1903
+ saturationField.setFloat(saturation);
1904
+
1905
+ subsurfaceField.setFloat(material.subsurface);
1906
+ selfshadowField.setFloat(material.diffuseness);
1907
+ diffusenessField.setFloat(material.factor);
1908
+ shininessField.setFloat(material.shininess);
1909
+ shadowbiasField.setFloat(material.shadowbias);
1910
+ diffuseField.setFloat(material.diffuse);
1911
+ specularField.setFloat(material.specular);
1912
+
1913
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
1914
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
1915
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
1916
+
1917
+ materialtouched = true;
1918
+ applySelf();
1919
+ }
1920
+ });
1921
+ presetpanel.add(skin);
1922
+
1923
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF);
1924
+ lambert.setToolTipText("Diffuse");
1925
+ lambert.addMouseListener(new MouseAdapter()
1926
+ {
1927
+ public void mouseClicked(MouseEvent e)
1928
+ {
1929
+ Object3D object = Grafreed.materials.versionlist[2].get(0);
1930
+ cMaterial material = object.material;
1931
+
1932
+ diffusenessField.setFloat(material.factor);
1933
+ selfshadowField.setFloat(material.diffuseness);
1934
+
1935
+ materialtouched = true;
1936
+ applySelf();
1937
+ }
1938
+ });
1939
+ presetpanel.add(lambert);
1940
+
1941
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF);
1942
+ diffuse2.setToolTipText("Diffuse2");
1943
+ diffuse2.addMouseListener(new MouseAdapter()
1944
+ {
1945
+ public void mouseClicked(MouseEvent e)
1946
+ {
1947
+ Object3D object = Grafreed.materials.versionlist[3].get(0);
1948
+ cMaterial material = object.material;
1949
+
1950
+ diffusenessField.setFloat(material.factor);
1951
+ selfshadowField.setFloat(material.diffuseness);
1952
+
1953
+ materialtouched = true;
1954
+ applySelf();
1955
+ }
1956
+ });
1957
+ presetpanel.add(diffuse2);
1958
+
1959
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF);
1960
+ diffusemoon.setToolTipText("Moon");
1961
+ diffusemoon.addMouseListener(new MouseAdapter()
1962
+ {
1963
+ public void mouseClicked(MouseEvent e)
1964
+ {
1965
+ Object3D object = Grafreed.materials.versionlist[4].get(0);
1966
+ cMaterial material = object.material;
1967
+
1968
+ diffusenessField.setFloat(material.factor);
1969
+ selfshadowField.setFloat(material.diffuseness);
1970
+
1971
+ materialtouched = true;
1972
+ applySelf();
1973
+ }
1974
+ });
1975
+ presetpanel.add(diffusemoon);
1976
+
1977
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF);
1978
+ diffusemoon2.setToolTipText("Moon2");
1979
+ diffusemoon2.addMouseListener(new MouseAdapter()
1980
+ {
1981
+ public void mouseClicked(MouseEvent e)
1982
+ {
1983
+ Object3D object = Grafreed.materials.versionlist[5].get(0);
1984
+ cMaterial material = object.material;
1985
+
1986
+ diffusenessField.setFloat(material.factor);
1987
+ selfshadowField.setFloat(material.diffuseness);
1988
+
1989
+ materialtouched = true;
1990
+ applySelf();
1991
+ }
1992
+ });
1993
+ presetpanel.add(diffusemoon2);
1994
+
1995
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF);
1996
+ diffusemoon3.setToolTipText("Moon3");
1997
+ diffusemoon3.addMouseListener(new MouseAdapter()
1998
+ {
1999
+ public void mouseClicked(MouseEvent e)
2000
+ {
2001
+ Object3D object = Grafreed.materials.versionlist[6].get(0);
2002
+ cMaterial material = object.material;
2003
+
2004
+ diffusenessField.setFloat(material.factor);
2005
+ selfshadowField.setFloat(material.diffuseness);
2006
+
2007
+ materialtouched = true;
2008
+ applySelf();
2009
+ }
2010
+ });
2011
+ presetpanel.add(diffusemoon3);
2012
+
2013
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF);
2014
+ diffusesheen.setToolTipText("Sheen");
2015
+ diffusesheen.addMouseListener(new MouseAdapter()
2016
+ {
2017
+ public void mouseClicked(MouseEvent e)
2018
+ {
2019
+ Object3D object = Grafreed.materials.versionlist[7].get(0);
2020
+ cMaterial material = object.material;
2021
+
2022
+ sheenField.setFloat(material.sheen);
2023
+
2024
+ materialtouched = true;
2025
+ applySelf();
2026
+ }
2027
+ });
2028
+ presetpanel.add(diffusesheen);
2029
+
2030
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF);
2031
+ rough.setToolTipText("Rough metal");
2032
+ rough.addMouseListener(new MouseAdapter()
2033
+ {
2034
+ public void mouseClicked(MouseEvent e)
2035
+ {
2036
+ Object3D object = Grafreed.materials.versionlist[1].get(0);
2037
+ cMaterial material = object.material;
2038
+
2039
+ shininessField.setFloat(material.shininess);
2040
+ velvetField.setFloat(material.velvet);
2041
+
2042
+ materialtouched = true;
2043
+ applySelf();
2044
+ }
2045
+ });
2046
+ presetpanel.add(rough);
2047
+
2048
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF);
2049
+ rough2.setToolTipText("Medium metal");
2050
+ rough2.addMouseListener(new MouseAdapter()
2051
+ {
2052
+ public void mouseClicked(MouseEvent e)
2053
+ {
2054
+ Object3D object = Grafreed.materials.versionlist[13].get(0);
2055
+ cMaterial material = object.material;
2056
+
2057
+ shininessField.setFloat(material.shininess);
2058
+ lightareaField.setFloat(material.lightarea);
2059
+
2060
+ materialtouched = true;
2061
+ applySelf();
2062
+ }
2063
+ });
2064
+ presetpanel.add(rough2);
2065
+
2066
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF);
2067
+ shini0.setToolTipText("Shiny");
2068
+ shini0.addMouseListener(new MouseAdapter()
2069
+ {
2070
+ public void mouseClicked(MouseEvent e)
2071
+ {
2072
+ Object3D object = Grafreed.materials.versionlist[14].get(0);
2073
+ cMaterial material = object.material;
2074
+
2075
+ shininessField.setFloat(material.shininess);
2076
+ lightareaField.setFloat(material.lightarea);
2077
+
2078
+ materialtouched = true;
2079
+ applySelf();
2080
+ }
2081
+ });
2082
+ presetpanel.add(shini0);
2083
+
2084
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF);
2085
+ shini1.setToolTipText("Shiny2");
2086
+ shini1.addMouseListener(new MouseAdapter()
2087
+ {
2088
+ public void mouseClicked(MouseEvent e)
2089
+ {
2090
+ Object3D object = Grafreed.materials.versionlist[11].get(0);
2091
+ cMaterial material = object.material;
2092
+
2093
+ shininessField.setFloat(material.shininess);
2094
+ lightareaField.setFloat(material.lightarea);
2095
+
2096
+ materialtouched = true;
2097
+ applySelf();
2098
+ }
2099
+ });
2100
+ presetpanel.add(shini1);
2101
+
2102
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF);
2103
+ shini2.setToolTipText("Shiny3");
2104
+ shini2.addMouseListener(new MouseAdapter()
2105
+ {
2106
+ public void mouseClicked(MouseEvent e)
2107
+ {
2108
+ Object3D object = Grafreed.materials.versionlist[12].get(0);
2109
+ cMaterial material = object.material;
2110
+
2111
+ shininessField.setFloat(material.shininess);
2112
+ lightareaField.setFloat(material.lightarea);
2113
+
2114
+ materialtouched = true;
2115
+ applySelf();
2116
+ }
2117
+ });
2118
+ presetpanel.add(shini2);
2119
+
2120
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF);
2121
+ aniso.setToolTipText("AnisoU");
2122
+ aniso.addMouseListener(new MouseAdapter()
2123
+ {
2124
+ public void mouseClicked(MouseEvent e)
2125
+ {
2126
+ Object3D object = Grafreed.materials.versionlist[8].get(0);
2127
+ cMaterial material = object.material;
2128
+
2129
+ anisoField.setFloat(material.aniso);
2130
+ anisoVField.setFloat(material.anisoV);
2131
+
2132
+ materialtouched = true;
2133
+ applySelf();
2134
+ }
2135
+ });
2136
+ presetpanel.add(aniso);
2137
+
2138
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF);
2139
+ aniso2.setToolTipText("AnisoV");
2140
+ aniso2.addMouseListener(new MouseAdapter()
2141
+ {
2142
+ public void mouseClicked(MouseEvent e)
2143
+ {
2144
+ Object3D object = Grafreed.materials.versionlist[9].get(0);
2145
+ cMaterial material = object.material;
2146
+
2147
+ anisoField.setFloat(material.aniso);
2148
+ anisoVField.setFloat(material.anisoV);
2149
+
2150
+ materialtouched = true;
2151
+ applySelf();
2152
+ }
2153
+ });
2154
+ presetpanel.add(aniso2);
2155
+
2156
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF);
2157
+ aniso3.setToolTipText("AnisoUV");
2158
+ aniso3.addMouseListener(new MouseAdapter()
2159
+ {
2160
+ public void mouseClicked(MouseEvent e)
2161
+ {
2162
+ Object3D object = Grafreed.materials.versionlist[10].get(0);
2163
+ cMaterial material = object.material;
2164
+
2165
+ anisoField.setFloat(material.aniso);
2166
+ anisoVField.setFloat(material.anisoV);
2167
+
2168
+ materialtouched = true;
2169
+ applySelf();
2170
+ }
2171
+ });
2172
+ presetpanel.add(aniso3);
2173
+
2174
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF);
2175
+ velvet0.setToolTipText("Velvet");
2176
+ velvet0.addMouseListener(new MouseAdapter()
2177
+ {
2178
+ public void mouseClicked(MouseEvent e)
2179
+ {
2180
+ Object3D object = Grafreed.materials.versionlist[15].get(0);
2181
+ cMaterial material = object.material;
2182
+
2183
+ diffusenessField.setFloat(material.factor);
2184
+ selfshadowField.setFloat(material.diffuseness);
2185
+ sheenField.setFloat(material.sheen);
2186
+ shininessField.setFloat(material.shininess);
2187
+ velvetField.setFloat(material.velvet);
2188
+ shiftField.setFloat(material.shift);
2189
+
2190
+ materialtouched = true;
2191
+ applySelf();
2192
+ }
2193
+ });
2194
+ presetpanel.add(velvet0);
2195
+
2196
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF);
2197
+ bump0.setToolTipText("Bump texture");
2198
+ bump0.addMouseListener(new MouseAdapter()
2199
+ {
2200
+ public void mouseClicked(MouseEvent e)
2201
+ {
2202
+ Object3D object = Grafreed.materials.versionlist[16].get(0);
2203
+ cMaterial material = object.material;
2204
+
2205
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2206
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2207
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2208
+
2209
+ materialtouched = true;
2210
+ applySelf();
2211
+ }
2212
+ });
2213
+ presetpanel.add(bump0);
2214
+
2215
+ cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF);
2216
+ borderShader.setToolTipText("Border fade");
2217
+ borderShader.addMouseListener(new MouseAdapter()
2218
+ {
2219
+ public void mouseClicked(MouseEvent e)
2220
+ {
2221
+ borderfadeField.setFloat(0.5);
2222
+ opacityField.setFloat(0.75);
2223
+
2224
+ materialtouched = true;
2225
+ applySelf();
2226
+ }
2227
+ });
2228
+ presetpanel.add(borderShader);
2229
+
2230
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF);
2231
+ halo.setToolTipText("Halo");
2232
+ halo.addMouseListener(new MouseAdapter()
2233
+ {
2234
+ public void mouseClicked(MouseEvent e)
2235
+ {
2236
+ Object3D object = Grafreed.materials.versionlist[17].get(0);
2237
+ cMaterial material = object.material;
2238
+
2239
+ opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0);
2240
+
2241
+ materialtouched = true;
2242
+ applySelf();
2243
+ }
2244
+ });
2245
+ presetpanel.add(halo);
2246
+
2247
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF);
2248
+ candle.setToolTipText("Candle");
2249
+ candle.addMouseListener(new MouseAdapter()
2250
+ {
2251
+ public void mouseClicked(MouseEvent e)
2252
+ {
2253
+ Object3D object = Grafreed.materials.versionlist[18].get(0);
2254
+ cMaterial material = object.material;
2255
+
2256
+ subsurfaceField.setFloat(material.subsurface);
2257
+ shadowbiasField.setFloat(material.shadowbias);
2258
+ ambientField.setFloat(material.ambient);
2259
+ specularField.setFloat(material.specular);
2260
+ lightareaField.setFloat(material.lightarea);
2261
+ shininessField.setFloat(material.shininess);
2262
+
2263
+ materialtouched = true;
2264
+ applySelf();
2265
+ }
2266
+ });
2267
+ presetpanel.add(candle);
2268
+
2269
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF);
2270
+ shadowShader.setToolTipText("Shadow");
2271
+ shadowShader.addMouseListener(new MouseAdapter()
2272
+ {
2273
+ public void mouseClicked(MouseEvent e)
2274
+ {
2275
+ diffuseField.setFloat(0.001);
2276
+ ambientField.setFloat(0.001);
2277
+ cameraField.setFloat(0.001);
2278
+ specularField.setFloat(0.001);
2279
+ fakedepthField.setFloat(0.001);
2280
+ opacityField.setFloat(0.6);
2281
+
2282
+ materialtouched = true;
2283
+ applySelf();
2284
+ }
2285
+ });
2286
+ presetpanel.add(shadowShader);
2287
+
2288
+ cGridBag panel = new cGridBag().setVertical(true);
2289
+
2290
+ presetpanel.preferredWidth = 1;
2291
+
2292
+ materialpanel.add(presetpanel);
2293
+ materialpanel.add(panel);
2294
+
2295
+ panel.preferredWidth = 8;
2296
+
2297
+ /*
14412298 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14422299 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1443
- */
2300
+ */
14442301
14452302 cGridBag editBar = new cGridBag().setVertical(false);
14462303
1447
- editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
2304
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
14482305 createMaterialButton.setToolTipText("Create material");
14492306
14502307 /*
14512308 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14522309 */
14532310
1454
- editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
2311
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
14552312 clearMaterialButton.setToolTipText("Clear material");
14562313
1457
- editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1458
- editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1459
- editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
2314
+ if (Globals.ADVANCED)
2315
+ {
2316
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
2317
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
2318
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
2319
+ }
14602320
14612321 editBar.preferredHeight = 15;
14622322
....@@ -1471,45 +2331,61 @@
14712331 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14722332
14732333 cGridBag colorSection = new cGridBag().setVertical(true);
2334
+
2335
+ cGridBag huepanel = new cGridBag();
2336
+ cGridBag huelabel = new cGridBag();
2337
+ cLabel hue = GetLabel("icons/hue.png", false);
2338
+ hue.fit = true;
2339
+
2340
+ hue.addMouseListener(new MouseAdapter()
2341
+ {
2342
+ public void mousePressed(MouseEvent e)
2343
+ {
2344
+ int x = e.getX();
2345
+
2346
+ colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth());
2347
+ }
2348
+ });
2349
+
2350
+ huelabel.add(hue);
2351
+ huelabel.preferredWidth = 20;
2352
+ huepanel.add(new cGridBag()); // Label
2353
+ huepanel.add(huelabel); // Field/slider
2354
+
2355
+ huepanel.preferredHeight = 7;
2356
+
2357
+ colorSection.add(huepanel);
14742358
14752359 cGridBag color = new cGridBag();
1476
- color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1477
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1478
- color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2360
+
2361
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
2362
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2363
+ color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2364
+
14792365 //colorField.preferredWidth = 200;
14802366 colorSection.add(color);
14812367
14822368 cGridBag modulation = new cGridBag();
14832369 modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
14842370 modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1485
- modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2371
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
14862372 colorSection.add(modulation);
14872373
2374
+ cGridBag opacity = new cGridBag();
2375
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
2376
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2377
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2378
+ colorSection.add(opacity);
2379
+
2380
+ colorSection.add(GetSeparator());
2381
+
14882382 cGridBag texture = new cGridBag();
14892383 texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
14902384 textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
14912385 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
14922386 colorSection.add(texture);
14932387
1494
- cGridBag anisoU = new cGridBag();
1495
- anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1496
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1497
- anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1498
- colorSection.add(anisoU);
1499
-
1500
- cGridBag anisoV = new cGridBag();
1501
- anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1502
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1503
- anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1504
- colorSection.add(anisoV);
1505
-
1506
- cGridBag shadowbias = new cGridBag();
1507
- shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1508
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1509
- shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1510
- colorSection.add(shadowbias);
1511
-
1512
- panel.add(new JSeparator());
2388
+ panel.add(GetSeparator());
15132389
15142390 panel.add(colorSection);
15152391
....@@ -1559,7 +2435,13 @@
15592435 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15602436 diffuseSection.add(fakedepth);
15612437
1562
- panel.add(new JSeparator());
2438
+ cGridBag shadowbias = new cGridBag();
2439
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
2440
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2441
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2442
+ diffuseSection.add(shadowbias);
2443
+
2444
+ panel.add(GetSeparator());
15632445
15642446 panel.add(diffuseSection);
15652447
....@@ -1609,42 +2491,48 @@
16092491 // aConstraints.gridy += 1;
16102492 // aConstraints.gridwidth = 1;
16112493
2494
+ cGridBag anisoU = new cGridBag();
2495
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
2496
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2497
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2498
+ specularSection.add(anisoU);
16122499
1613
- panel.add(new JSeparator());
2500
+ cGridBag anisoV = new cGridBag();
2501
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
2502
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2503
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2504
+ specularSection.add(anisoV);
2505
+
2506
+
2507
+ panel.add(GetSeparator());
16142508
16152509 panel.add(specularSection);
16162510
16172511 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16182512
1619
- cGridBag globalSection = new cGridBag().setVertical(true);
2513
+ //cGridBag globalSection = new cGridBag().setVertical(true);
16202514
16212515 cGridBag camera = new cGridBag();
16222516 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
16232517 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16242518 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1625
- globalSection.add(camera);
2519
+ colorSection.add(camera);
16262520
16272521 cGridBag ambient = new cGridBag();
16282522 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
16292523 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16302524 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1631
- globalSection.add(ambient);
2525
+ colorSection.add(ambient);
16322526
16332527 cGridBag backlit = new cGridBag();
16342528 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
16352529 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16362530 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1637
- globalSection.add(backlit);
2531
+ colorSection.add(backlit);
16382532
1639
- cGridBag opacity = new cGridBag();
1640
- opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1641
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1642
- opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1643
- globalSection.add(opacity);
1644
-
1645
- panel.add(new JSeparator());
2533
+ //panel.add(new JSeparator());
16462534
1647
- panel.add(globalSection);
2535
+ //panel.add(globalSection);
16482536
16492537 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16502538
....@@ -1686,7 +2574,7 @@
16862574 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
16872575 textureSection.add(opacityPower);
16882576
1689
- panel.add(new JSeparator());
2577
+ panel.add(GetSeparator());
16902578
16912579 panel.add(textureSection);
16922580
....@@ -1725,12 +2613,15 @@
17252613 opacityPowerField.addChangeListener(this);
17262614 /**/
17272615
1728
- resetSlidersButton.addActionListener(this);
17292616 clearMaterialButton.addActionListener(this);
17302617 createMaterialButton.addActionListener(this);
1731
-
1732
- propagateToggle.addItemListener(this);
1733
- multiplyToggle.addItemListener(this);
2618
+
2619
+ if (Globals.ADVANCED)
2620
+ {
2621
+ resetSlidersButton.addActionListener(this);
2622
+ propagateToggle.addItemListener(this);
2623
+ multiplyToggle.addItemListener(this);
2624
+ }
17342625 }
17352626
17362627 void DropFile(java.io.File[] files, boolean textures)
....@@ -1748,8 +2639,9 @@
17482639 // 3D models
17492640 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
17502641 {
1751
- lastConverter = new com.jmex.model.converters.MaxToJme();
1752
- LoadFile(filename, lastConverter);
2642
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2643
+ //LoadFile(filename, lastConverter);
2644
+ LoadObjFile(filename); // New 3ds loader
17532645 continue;
17542646 }
17552647 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -1901,7 +2793,7 @@
19012793
19022794 //? flashIt = false;
19032795 CameraPane pane = (CameraPane) cameraView;
1904
- pane.clickStart(location.x, location.y, 0);
2796
+ pane.clickStart(location.x, location.y, 0, 0);
19052797 pane.clickEnd(location.x, location.y, 0, true);
19062798
19072799 if (group.selection.size() == 1)
....@@ -1950,6 +2842,7 @@
19502842 e2.printStackTrace();
19512843 }
19522844 }
2845
+
19532846 LoadJMEThread loadThread;
19542847
19552848 class LoadJMEThread extends Thread
....@@ -2007,6 +2900,7 @@
20072900 //LoadFile0(filename, converter);
20082901 }
20092902 }
2903
+
20102904 LoadOBJThread loadObjThread;
20112905
20122906 class LoadOBJThread extends Thread
....@@ -2085,19 +2979,19 @@
20852979
20862980 void LoadObjFile(String fullname)
20872981 {
2088
- /*
2982
+ System.out.println("Loading " + fullname);
2983
+ /**/
20892984 //lastFilename = fullname;
20902985 if(loadObjThread == null)
20912986 {
2092
- loadObjThread = new LoadOBJThread();
2093
- loadObjThread.start();
2987
+ loadObjThread = new LoadOBJThread();
2988
+ loadObjThread.start();
20942989 }
20952990
20962991 loadObjThread.add(fullname);
2097
- */
2992
+ /**/
20982993
2099
- System.out.println("Loading " + fullname);
2100
- makeSomething(new FileObject(fullname, true), true);
2994
+ //makeSomething(new FileObject(fullname, true), true);
21012995 }
21022996
21032997 void LoadGFDFile(String fullname)
....@@ -2358,11 +3252,11 @@
23583252
23593253 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23603254 {
2361
- if (GrafreeD.standAlone)
3255
+ if (Grafreed.standAlone)
23623256 {
23633257 /**/
23643258 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2365
- browser.show();
3259
+ browser.setVisible(true);
23663260 String filename = browser.getFile();
23673261 if (filename != null && filename.length() > 0)
23683262 {
....@@ -2473,6 +3367,7 @@
24733367 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
24743368 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
24753369 }
3370
+
24763371 //cJME.count++;
24773372 //cJME.count %= 12;
24783373 if (gc)
....@@ -2656,6 +3551,7 @@
26563551 }
26573552 }
26583553 }
3554
+
26593555 cFileSystemPane FSPane;
26603556
26613557 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2665,7 +3561,7 @@
26653561
26663562 freezematerial = true;
26673563 colorField.setFloat(mat.color);
2668
- modulationField.setFloat(mat.modulation);
3564
+ saturationField.setFloat(mat.modulation);
26693565 metalnessField.setFloat(mat.metalness);
26703566 diffuseField.setFloat(mat.diffuse);
26713567 specularField.setFloat(mat.specular);
....@@ -2709,11 +3605,14 @@
27093605 }
27103606 }
27113607 }
3608
+
27123609 freezematerial = false;
27133610 }
27143611
27153612 void SetMaterial(Object3D object)
27163613 {
3614
+ latestObject = object;
3615
+
27173616 cMaterial mat = object.material;
27183617
27193618 if (mat == null)
....@@ -2722,33 +3621,10 @@
27223621 return;
27233622 }
27243623
2725
- multiplyToggle.setSelected(mat.multiply);
2726
-
2727
- assert (object.projectedVertices != null);
2728
-
2729
- if (object.projectedVertices.length <= 2)
2730
- {
2731
- // Side effect...
2732
- Object3D.cVector2[] keep = object.projectedVertices;
2733
- object.projectedVertices = new Object3D.cVector2[3];
2734
- for (int i = 0; i < 3; i++)
2735
- {
2736
- if (i < keep.length)
2737
- {
2738
- object.projectedVertices[i] = keep[i];
2739
- } else
2740
- {
2741
- object.projectedVertices[i] = new Object3D.cVector2();
2742
- }
2743
- /*
2744
- if(keep.length == 0)
2745
- object.projectedVertices[0] = new Object3D.cVector2();
2746
- else
2747
- object.projectedVertices[0] = keep[0];
2748
- object.projectedVertices[1] = new Object3D.cVector2();
2749
- */
2750
- }
2751
- }
3624
+ if (multiplyToggle != null)
3625
+ multiplyToggle.setSelected(mat.multiply);
3626
+
3627
+ AllocProjectedVertices(object);
27523628
27533629 SetMaterial(mat, object.projectedVertices);
27543630 }
....@@ -2824,12 +3700,17 @@
28243700 // }
28253701
28263702 /**/
2827
- if (deselect)
3703
+ if (deselect || child == null)
28283704 {
28293705 //group.deselectAll();
28303706 //freeze = true;
28313707 GetTree().clearSelection();
28323708 //freeze = false;
3709
+
3710
+ if (child == null)
3711
+ {
3712
+ return;
3713
+ }
28333714 }
28343715
28353716 //group.addSelectee(child);
....@@ -2863,6 +3744,17 @@
28633744 public void itemStateChanged(ItemEvent event)
28643745 {
28653746 // System.out.println("Propagate = " + propagate);
3747
+ if (event.getSource() == pinButton)
3748
+ {
3749
+ copy.pinned ^= true;
3750
+ if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy))
3751
+ {
3752
+ ((GroupEditor)copy.editWindow).listUI.remove(copy);
3753
+ copy.CloseUI();
3754
+ //copy.editWindow.refreshContents();
3755
+ }
3756
+ }
3757
+ else
28663758 if (event.getSource() == propagateToggle)
28673759 {
28683760 propagate ^= true;
....@@ -2898,7 +3790,7 @@
28983790 cameraView.ToggleDL();
28993791 cameraView.repaint();
29003792 return;
2901
- } else if (event.getSource() == toggleTextureItem)
3793
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
29023794 {
29033795 cameraView.ToggleTexture();
29043796 // june 2013 copy.HardTouch();
....@@ -2937,9 +3829,9 @@
29373829 frame.validate();
29383830
29393831 return;
2940
- } else if (event.getSource() == toggleRandomItem)
3832
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29413833 {
2942
- cameraView.ToggleRandom();
3834
+ cameraView.ToggleSwitch();
29433835 cameraView.repaint();
29443836 return;
29453837 } else if (event.getSource() == toggleHandleItem)
....@@ -2967,12 +3859,17 @@
29673859 } else if (event.getSource() == liveCB)
29683860 {
29693861 copy.live ^= true;
3862
+ objEditor.refreshContents(true); // To show item colors
3863
+ return;
3864
+ } else if (event.getSource() == selectableCB)
3865
+ {
3866
+ copy.dontselect ^= true;
29703867 return;
29713868 } else if (event.getSource() == hideCB)
29723869 {
29733870 copy.hide ^= true;
29743871 copy.Touch(); // display list issue
2975
- objEditor.refreshContents();
3872
+ objEditor.refreshContents(true); // To show item colors
29763873 return;
29773874 } else if (event.getSource() == link2masterCB)
29783875 {
....@@ -2982,6 +3879,7 @@
29823879 if (event.getSource() == randomCB)
29833880 {
29843881 copy.random ^= true;
3882
+ objEditor.refreshContents();
29853883 return;
29863884 }
29873885 if (event.getSource() == speedupCB)
....@@ -3005,8 +3903,9 @@
30053903
30063904 public void actionPerformed(ActionEvent event)
30073905 {
3906
+ Object source = event.getSource();
30083907 // SCRIPT DIALOG
3009
- if (event.getSource() == okbutton)
3908
+ if (source == okbutton)
30103909 {
30113910 textpanel.setVisible(false);
30123911 textpanel.remove(textarea);
....@@ -3018,7 +3917,7 @@
30183917 textarea = null;
30193918 textpanel = null;
30203919 }
3021
- if (event.getSource() == cancelbutton)
3920
+ if (source == cancelbutton)
30223921 {
30233922 textpanel.setVisible(false);
30243923 textpanel.remove(textarea);
....@@ -3030,50 +3929,50 @@
30303929 //applySelf();
30313930 //client.refreshEditWindow();
30323931 //refreshContents();
3033
- if (event.getSource() == nameField)
3932
+ if (source == nameField)
30343933 {
30353934 //System.out.println("ObjEditor " + event);
30363935 applySelf0(true);
30373936 //parent.applySelf();
3038
- objEditor.refreshContents();
3039
- } else if (event.getSource() == resetButton)
3937
+ // conflicts with requestFocus objEditor.refreshContents();
3938
+ } else if (source == resetButton)
30403939 {
30413940 CameraPane.fullreset = true;
30423941 copy.Reset(); // ResetMeshes();
30433942 copy.Touch();
30443943 objEditor.refreshContents();
3045
- } else if (event.getSource() == stepItem)
3944
+ } else if (source == stepItem)
30463945 {
30473946 //cameraView.ONESTEP = true;
30483947 Globals.ONESTEP = true;
30493948 cameraView.repaint();
30503949 return;
3051
- } else if (event.getSource() == stepButton)
3950
+ } else if (source == stepButton)
30523951 {
30533952 copy.Step();
30543953 copy.Touch();
30553954 objEditor.refreshContents();
3056
- } else if (event.getSource() == slowerButton)
3955
+ } else if (source == slowerButton)
30573956 {
30583957 copy.Slower();
30593958 copy.Touch();
30603959 objEditor.refreshContents();
3061
- } else if (event.getSource() == fasterButton)
3960
+ } else if (source == fasterButton)
30623961 {
30633962 copy.Faster();
30643963 copy.Touch();
30653964 objEditor.refreshContents();
3066
- } else if (event.getSource() == remarkButton)
3965
+ } else if (source == remarkButton)
30673966 {
30683967 copy.Remark();
30693968 copy.Touch();
30703969 objEditor.refreshContents();
3071
- } else if (event.getSource() == stepAllButton)
3970
+ } else if (source == stepAllButton)
30723971 {
30733972 copy.StepAll();
30743973 copy.Touch();
30753974 objEditor.refreshContents();
3076
- } else if (event.getSource() == resetAllButton)
3975
+ } else if (source == resetAllButton)
30773976 {
30783977 //CameraPane.fullreset = true;
30793978 copy.ResetAll(); // ResetMeshes();
....@@ -3106,53 +4005,79 @@
31064005 // Close();
31074006 // }
31084007 // else
3109
- if (event.getSource() == resetSlidersButton)
4008
+ if (source == resetSlidersButton)
31104009 {
31114010 ResetSliders();
3112
- } else if (event.getSource() == clearMaterialButton)
4011
+ } else if (source == clearMaterialButton)
31134012 {
31144013 ClearMaterial();
3115
- } else if (event.getSource() == createMaterialButton)
4014
+ } else if (source == createMaterialButton)
31164015 {
31174016 CreateMaterial();
3118
- } else if (event.getSource() == clearPanelButton)
4017
+ } else if (source == clearPanelButton)
31194018 {
31204019 copy.ClearUI();
31214020 refreshContents(true);
3122
- } /*
3123
- }
3124
-
3125
- public boolean action(Event event, Object arg)
3126
- {
3127
- */ else if (event.getSource() == closeItem)
4021
+ } else if (source == importGFDItem)
4022
+ {
4023
+ ImportGFD();
4024
+ } else
4025
+ if (source == importVRMLX3DItem)
4026
+ {
4027
+ ImportVRMLX3D();
4028
+ } else
4029
+ if (source == import3DSItem)
4030
+ {
4031
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
4032
+ } else
4033
+ if (source == importOBJItem)
4034
+ {
4035
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
4036
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
4037
+ browser.setVisible(true);
4038
+ String filename = browser.getFile();
4039
+ if (filename != null && filename.length() > 0)
4040
+ {
4041
+ String fullname = browser.getDirectory() + filename;
4042
+ makeSomething(ReadOBJ(fullname), true);
4043
+ }
4044
+ } else
4045
+ if (source == closeItem)
31284046 {
31294047 Close();
31304048 //return true;
3131
- } else if (event.getSource() == loadItem)
4049
+ } else if (source == openItem)
31324050 {
3133
- load();
4051
+ Open();
31344052 //return true;
3135
- } else if (event.getSource() == saveItem)
4053
+ } else if (source == newItem)
4054
+ {
4055
+ New();
4056
+ } else if (source == saveItem)
31364057 {
31374058 save();
31384059 //return true;
3139
- } else if (event.getSource() == saveAsItem)
4060
+ } else if (source == saveAsItem)
31404061 {
31414062 saveAs();
31424063 //return true;
3143
- } else if (event.getSource() == reexportItem)
4064
+ } else if (source == reexportItem)
31444065 {
31454066 reexport();
31464067 //return true;
3147
- } else if (event.getSource() == exportAsItem)
4068
+ } else if (source == exportAsItem)
31484069 {
31494070 export();
31504071 //return true;
3151
- } else if (event.getSource() == povItem)
4072
+ } else if (source == povItem)
31524073 {
31534074 generatePOV();
31544075 //return true;
3155
- } else if (event.getSource() == zBufferItem)
4076
+ } else if (event.getSource() == archiveItem)
4077
+ {
4078
+ cTools.Archive(frame);
4079
+ return;
4080
+ } else if (source == zBufferItem)
31564081 {
31574082 try
31584083 {
....@@ -3174,21 +4099,8 @@
31744099 cameraView.repaint();
31754100 //return true;
31764101 }
3177
- */ else if (event.getSource() == editCameraItem)
3178
- {
3179
- cameraView.ProtectCamera();
3180
- cameraView.repaint();
3181
- return;
3182
- } else if (event.getSource() == revertCameraItem)
3183
- {
3184
- cameraView.RevertCamera();
3185
- cameraView.repaint();
3186
- return;
3187
-// } else if (event.getSource() == textureButton)
3188
-// {
3189
-// return; // true;
3190
- } else // combos...
3191
- if (event.getSource() == texresMenu)
4102
+ */ else // combos...
4103
+ if (source == texresMenu)
31924104 {
31934105 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
31944106 copy.texres = texresMenu.getSelectedIndex();
....@@ -3200,12 +4112,479 @@
32004112 }
32014113 }
32024114
4115
+ void New()
4116
+ {
4117
+ while (copy.Size() > 1)
4118
+ {
4119
+ copy.remove(1);
4120
+ }
4121
+
4122
+ ResetModel();
4123
+ objEditor.refreshContents();
4124
+ }
4125
+
4126
+ static public byte[] Compress(Object3D o)
4127
+ {
4128
+ // Slower to actually compress.
4129
+ try
4130
+ {
4131
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
4132
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
4133
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
4134
+
4135
+ Object3D parent = o.parent;
4136
+ o.parent = null;
4137
+
4138
+ out.writeObject(o);
4139
+
4140
+ o.parent = parent;
4141
+
4142
+ out.flush();
4143
+
4144
+ baos //zstream
4145
+ .close();
4146
+ out.close();
4147
+
4148
+ byte[] bytes = baos.toByteArray();
4149
+
4150
+ System.out.println("save #bytes = " + bytes.length);
4151
+ return bytes;
4152
+ } catch (Exception e)
4153
+ {
4154
+ System.err.println(e);
4155
+ return null;
4156
+ }
4157
+ }
4158
+
4159
+ static public Object Uncompress(byte[] bytes)
4160
+ {
4161
+ System.out.println("restore #bytes = " + bytes.length);
4162
+ try
4163
+ {
4164
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
4165
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
4166
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
4167
+ Object obj = in.readObject();
4168
+
4169
+ bais //istream
4170
+ .close();
4171
+ in.close();
4172
+
4173
+ return obj;
4174
+ } catch (Exception e)
4175
+ {
4176
+ System.err.println(e);
4177
+ return null;
4178
+ }
4179
+ }
4180
+
4181
+ static public Object clone(Object o)
4182
+ {
4183
+ try
4184
+ {
4185
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
4186
+ ObjectOutputStream out = new ObjectOutputStream(baos);
4187
+
4188
+ out.writeObject(o);
4189
+
4190
+ out.flush();
4191
+ out.close();
4192
+
4193
+ byte[] bytes = baos.toByteArray();
4194
+
4195
+ System.out.println("clone = " + bytes.length);
4196
+
4197
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
4198
+ ObjectInputStream in = new ObjectInputStream(bais);
4199
+ Object obj = in.readObject();
4200
+ in.close();
4201
+
4202
+ return obj;
4203
+ } catch (Exception e)
4204
+ {
4205
+ System.err.println(e);
4206
+ return null;
4207
+ }
4208
+ }
4209
+
4210
+ cRadio GetCurrentTab()
4211
+ {
4212
+ cRadio ab;
4213
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4214
+ {
4215
+ ab = (cRadio)e.nextElement();
4216
+ if(ab.GetObject() == copy)
4217
+ {
4218
+ return ab;
4219
+ }
4220
+ }
4221
+
4222
+ return null;
4223
+ }
4224
+
4225
+
4226
+ public void Save()
4227
+ {
4228
+ //Save(true);
4229
+ Replace();
4230
+ SetVersionStates();
4231
+ }
4232
+
4233
+ private boolean Equal(byte[] compress, byte[] name)
4234
+ {
4235
+ if (compress.length != name.length)
4236
+ {
4237
+ return false;
4238
+ }
4239
+
4240
+ for (int i=compress.length; --i>=0;)
4241
+ {
4242
+ if (compress[i] != name[i])
4243
+ return false;
4244
+ }
4245
+
4246
+ return true;
4247
+ }
4248
+
4249
+ void DeleteVersion()
4250
+ {
4251
+ for (int i = copy.versionindex; i < copy.versionlist.length-1; i++)
4252
+ {
4253
+ copy.versionlist[i] = copy.versionlist[i+1];
4254
+ }
4255
+
4256
+ if (copy.versionlist[copy.versionindex] == null)
4257
+ copy.versionindex -= 1;
4258
+
4259
+ if (copy.versionindex != -1)
4260
+ CopyChanged();
4261
+
4262
+ SetVersionStates();
4263
+ }
4264
+
4265
+ public boolean Save(boolean user)
4266
+ {
4267
+ System.err.println("Save");
4268
+ Replace();
4269
+
4270
+ //cRadio tab = GetCurrentTab();
4271
+
4272
+ Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"?
4273
+
4274
+ boolean thesame = false;
4275
+
4276
+// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
4277
+// {
4278
+// thesame = true;
4279
+// }
4280
+
4281
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
4282
+ if (!thesame)
4283
+ {
4284
+ for (int i = copy.versionlist.length; --i > copy.versionindex+1;)
4285
+ {
4286
+ copy.versionlist[i] = copy.versionlist[i-1];
4287
+ }
4288
+
4289
+ //tab.user[tab.versionindex] = user;
4290
+ //boolean increment = true; // tab.graphs[tab.versionindex] == null;
4291
+
4292
+ copy.versionlist[++copy.versionindex] = compress;
4293
+
4294
+ // if (increment)
4295
+ // tab.versionindex++;
4296
+ }
4297
+
4298
+ //copy.RestoreBigData(versiontable);
4299
+
4300
+ //assert(hashtable.isEmpty());
4301
+
4302
+// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++)
4303
+// {
4304
+// //tab.user[i] = false;
4305
+// copy.versionlist[i] = null;
4306
+// }
4307
+
4308
+ SetVersionStates();
4309
+
4310
+ // test save
4311
+ if (false)
4312
+ {
4313
+ try
4314
+ {
4315
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
4316
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
4317
+
4318
+ p.writeObject(copy);
4319
+
4320
+ p.flush();
4321
+
4322
+ ostream.close();
4323
+ } catch (Exception e)
4324
+ {
4325
+ e.printStackTrace();
4326
+ }
4327
+ }
4328
+
4329
+ return !thesame;
4330
+ }
4331
+
4332
+ boolean flashIt = true;
4333
+
4334
+ void RefreshSelection()
4335
+ {
4336
+ Object3D selection = new Object3D();
4337
+
4338
+ for (int i = 0; i < copy.selection.size(); i++)
4339
+ {
4340
+ Object3D elem = copy.selection.elementAt(i);
4341
+
4342
+ Object3D obj = copy.GetObject(elem.GetUUID());
4343
+
4344
+ if (obj == null)
4345
+ {
4346
+ copy.selection.remove(i--);
4347
+ }
4348
+ else
4349
+ {
4350
+ selection.add(obj);
4351
+ copy.selection.setElementAt(obj, i);
4352
+ }
4353
+ }
4354
+
4355
+ flashIt = false;
4356
+ GetTree().clearSelection();
4357
+ for (int i = 0; i < selection.size(); i++)
4358
+ GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath());
4359
+ flashIt = true;
4360
+
4361
+ //refreshContents(false);
4362
+ }
4363
+
4364
+ void CopyChanged()
4365
+ {
4366
+ Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]);
4367
+
4368
+ SetVersionStates();
4369
+
4370
+ boolean temp = CameraPane.SWITCH;
4371
+ CameraPane.SWITCH = false;
4372
+
4373
+ copy.ExtractBigData(Grafreed.grafreed.universe.versiontable);
4374
+
4375
+ copy.clear();
4376
+
4377
+ copy.skyboxname = obj.skyboxname;
4378
+ copy.skyboxext = obj.skyboxext;
4379
+
4380
+ for (int i=0; i<obj.Size(); i++)
4381
+ {
4382
+ copy.add(obj.get(i));
4383
+ }
4384
+
4385
+ copy.RestoreBigData(Grafreed.grafreed.universe.versiontable);
4386
+
4387
+ CameraPane.SWITCH = temp;
4388
+
4389
+ RefreshSelection();
4390
+ //assert(hashtable.isEmpty());
4391
+
4392
+ copy.Touch();
4393
+
4394
+ ResetModel();
4395
+ copy.HardTouch(); // recompile?
4396
+
4397
+ cRadio ab;
4398
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4399
+ {
4400
+ ab = (cRadio)e.nextElement();
4401
+ Object3D test = copy.GetObject(ab.object.GetUUID());
4402
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
4403
+ if (test != null)
4404
+ {
4405
+ test.editWindow = ab.object.editWindow;
4406
+ ab.object = test;
4407
+ }
4408
+ }
4409
+
4410
+ refreshContents(true);
4411
+ }
4412
+
4413
+ cButton previousVersionButton;
4414
+ cButton restoreButton;
4415
+ cButton replaceButton;
4416
+ cButton nextVersionButton;
4417
+ cButton saveVersionButton;
4418
+ cButton deleteVersionButton;
4419
+
4420
+ boolean muteSlider;
4421
+
4422
+ int VersionCount()
4423
+ {
4424
+ int count = 0;
4425
+
4426
+ for (int i = copy.versionlist.length; --i >= 0;)
4427
+ {
4428
+ if (copy.versionlist[i] != null)
4429
+ count++;
4430
+ }
4431
+
4432
+ return count;
4433
+ }
4434
+
4435
+ void SetVersionStates()
4436
+ {
4437
+ //if (true)
4438
+ // return;
4439
+
4440
+ //cRadio tab = GetCurrentTab();
4441
+
4442
+ restoreButton.setEnabled(copy.versionindex != -1);
4443
+ replaceButton.setEnabled(copy.versionindex != -1);
4444
+
4445
+ previousVersionButton.setEnabled(copy.versionindex > 0);
4446
+ nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4447
+
4448
+ deleteVersionButton.setEnabled(copy.versionindex != -1);
4449
+ //copy.versionlist[copy.versionindex + 1] != null);
4450
+
4451
+ muteSlider = true;
4452
+ versionSlider.setMinimum(0);
4453
+ versionSlider.setMaximum(VersionCount() - 1);
4454
+ versionSlider.setInteger(copy.versionindex);
4455
+ versionSlider.setEnabled(copy.versionindex != -1);
4456
+ muteSlider = false;
4457
+ }
4458
+
4459
+ public boolean PreviousVersion()
4460
+ {
4461
+ // Option?
4462
+ Replace();
4463
+
4464
+ System.err.println("Undo");
4465
+
4466
+ //cRadio tab = GetCurrentTab();
4467
+
4468
+ if (copy.versionindex == 0)
4469
+ {
4470
+ java.awt.Toolkit.getDefaultToolkit().beep();
4471
+ return false;
4472
+ }
4473
+
4474
+// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex])
4475
+// {
4476
+// if (Save(false))
4477
+// tab.versionindex -= 1;
4478
+// else
4479
+// {
4480
+// if (tab.versionindex <= 0)
4481
+// return false;
4482
+// else
4483
+// tab.versionindex -= 1;
4484
+// }
4485
+// }
4486
+
4487
+ copy.versionindex -= 1;
4488
+
4489
+ CopyChanged();
4490
+
4491
+ return true;
4492
+ }
4493
+
4494
+ public boolean Restore()
4495
+ {
4496
+ System.err.println("Restore");
4497
+
4498
+ //cRadio tab = GetCurrentTab();
4499
+
4500
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4501
+ {
4502
+ java.awt.Toolkit.getDefaultToolkit().beep();
4503
+ return false;
4504
+ }
4505
+
4506
+ //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4507
+ CopyChanged();
4508
+
4509
+ return true;
4510
+ }
4511
+
4512
+ public boolean Replace()
4513
+ {
4514
+ //System.err.println("Replace");
4515
+
4516
+ //cRadio tab = GetCurrentTab();
4517
+
4518
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4519
+ {
4520
+ // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
4521
+ return false;
4522
+ }
4523
+
4524
+ copy.versionlist[copy.versionindex] = Duplicate(copy);
4525
+
4526
+ return true;
4527
+ }
4528
+
4529
+ public void NextVersion()
4530
+ {
4531
+ // Option?
4532
+ Replace();
4533
+
4534
+ //cRadio tab = GetCurrentTab();
4535
+
4536
+ if (copy.versionlist[copy.versionindex + 1] == null)
4537
+ {
4538
+ java.awt.Toolkit.getDefaultToolkit().beep();
4539
+ return;
4540
+ }
4541
+
4542
+ copy.versionindex += 1;
4543
+
4544
+ CopyChanged();
4545
+
4546
+ //if (!tab.user[tab.versionindex])
4547
+ // tab.graphs[tab.versionindex] = null;
4548
+ }
4549
+
4550
+ void ImportGFD()
4551
+ {
4552
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4553
+ browser.show();
4554
+ String filename = browser.getFile();
4555
+ if (filename != null && filename.length() > 0)
4556
+ {
4557
+ String fullname = browser.getDirectory() + filename;
4558
+
4559
+ //Object3D readobj =
4560
+ objEditor.ReadGFD(fullname, objEditor);
4561
+ //makeSomething(readobj);
4562
+ }
4563
+ }
4564
+
4565
+ void ImportVRMLX3D()
4566
+ {
4567
+ if (Grafreed.standAlone)
4568
+ {
4569
+ /**/
4570
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4571
+ browser.show();
4572
+ String filename = browser.getFile();
4573
+ if (filename != null && filename.length() > 0)
4574
+ {
4575
+ String fullname = browser.getDirectory() + filename;
4576
+ LoadVRMLX3D(fullname);
4577
+ }
4578
+ /**/
4579
+ }
4580
+ }
4581
+
32034582 void ToggleAnimation()
32044583 {
32054584 if (!Globals.ANIMATION)
32064585 {
32074586 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3208
- browser.show();
4587
+ browser.setVisible(true);
32094588 String filename = browser.getFile();
32104589 if (filename != null && filename.length() > 0)
32114590 {
....@@ -3215,8 +4594,8 @@
32154594
32164595 Globals.ANIMATION ^= true;
32174596
3218
- GrafreeD.wav.cursor = 0;
3219
- GrafreeD.wav.loop = 0;
4597
+ Grafreed.wav.cursor = 0;
4598
+ Grafreed.wav.loop = 0;
32204599 }
32214600 } else
32224601 {
....@@ -3237,7 +4616,6 @@
32374616 callee.refreshContents();
32384617 } else
32394618 {
3240
- new Exception().printStackTrace();
32414619 System.exit(0);
32424620 }
32434621 }
....@@ -3267,7 +4645,7 @@
32674645 void CreateMaterial()
32684646 {
32694647 //copy.ClearMaterial(); // PATCH
3270
- copy.CreateMaterialS(multiplyToggle.isSelected());
4648
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
32714649 if (copy.selection.size() > 0)
32724650 //SetMaterial(copy);
32734651 {
....@@ -3318,7 +4696,7 @@
33184696 assert false;
33194697 }
33204698
3321
- void EditSelection()
4699
+ void EditSelection(boolean newWindow)
33224700 {
33234701 }
33244702
....@@ -3326,11 +4704,11 @@
33264704 {
33274705 copy.ResetBlockLoop(); // temporary problem
33284706
3329
- boolean random = CameraPane.RANDOM;
3330
- CameraPane.RANDOM = false; // parse everything
4707
+ boolean random = CameraPane.SWITCH;
4708
+ CameraPane.SWITCH = false; // parse everything
33314709 copy.ResetDisplayList();
33324710 copy.HardTouch();
3333
- CameraPane.RANDOM = random;
4711
+ CameraPane.SWITCH = random;
33344712 }
33354713
33364714 // public void applySelf()
....@@ -3377,7 +4755,7 @@
33774755 //copy.material = new cMaterial(copy.GetMaterial());
33784756
33794757 current.color = (float) colorField.getFloat();
3380
- current.modulation = (float) modulationField.getFloat();
4758
+ current.modulation = (float) saturationField.getFloat();
33814759 current.metalness = (float) metalnessField.getFloat();
33824760 current.diffuse = (float) diffuseField.getFloat();
33834761 current.specular = (float) specularField.getFloat();
....@@ -3404,6 +4782,36 @@
34044782 {
34054783 //System.out.println("Propagate = " + propagate);
34064784 copy.UpdateMaterial(anchor, current, propagate);
4785
+
4786
+ if (copy.material != null)
4787
+ {
4788
+ cMaterial mat = copy.material;
4789
+
4790
+ colorField.SetToolTipValue((mat.color));
4791
+ saturationField.SetToolTipValue((mat.modulation));
4792
+ metalnessField.SetToolTipValue((mat.metalness));
4793
+ diffuseField.SetToolTipValue((mat.diffuse));
4794
+ specularField.SetToolTipValue((mat.specular));
4795
+ shininessField.SetToolTipValue((mat.shininess));
4796
+ shiftField.SetToolTipValue((mat.shift));
4797
+ ambientField.SetToolTipValue((mat.ambient));
4798
+ lightareaField.SetToolTipValue((mat.lightarea));
4799
+ diffusenessField.SetToolTipValue((mat.factor));
4800
+ velvetField.SetToolTipValue((mat.velvet));
4801
+ sheenField.SetToolTipValue((mat.sheen));
4802
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4803
+ backlitField.SetToolTipValue((mat.bump));
4804
+ anisoField.SetToolTipValue((mat.aniso));
4805
+ anisoVField.SetToolTipValue((mat.anisoV));
4806
+ cameraField.SetToolTipValue((mat.cameralight));
4807
+ selfshadowField.SetToolTipValue((mat.diffuseness));
4808
+ shadowField.SetToolTipValue((mat.shadow));
4809
+ textureField.SetToolTipValue((mat.texture));
4810
+ opacityField.SetToolTipValue((mat.opacity));
4811
+ fakedepthField.SetToolTipValue((mat.fakedepth));
4812
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
4813
+ }
4814
+
34074815 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34084816 {
34094817 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3432,9 +4840,28 @@
34324840 //copy.Touch();
34334841 }
34344842
4843
+ cNumberSlider versionSlider;
4844
+
34354845 public void stateChanged(ChangeEvent e)
34364846 {
34374847 // assert(false);
4848
+ if (e.getSource() == versionSlider)
4849
+ {
4850
+ if (muteSlider)
4851
+ return;
4852
+
4853
+ Replace();
4854
+
4855
+ int version = versionSlider.getInteger();
4856
+
4857
+ if (version != -1 && copy.versionlist[version] != null)
4858
+ {
4859
+ copy.versionindex = version;
4860
+ CopyChanged();
4861
+ }
4862
+
4863
+ return;
4864
+ }
34384865
34394866 if (freezematerial)
34404867 {
....@@ -3470,6 +4897,12 @@
34704897 {
34714898 //System.out.println("stateChanged = " + this);
34724899 materialtouched = true;
4900
+
4901
+ if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001)
4902
+ {
4903
+ saturationField.setFloat(1);
4904
+ }
4905
+
34734906 applySelf();
34744907 //System.out.println("this = " + this);
34754908 //System.out.println("PARENT = " + parent);
....@@ -3519,7 +4952,7 @@
35194952 }
35204953
35214954 if (normalpushField != null)
3522
- copy.NORMALPUSH = (float)normalpushField.getFloat()/1000;
4955
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35234956 }
35244957
35254958 void SnapObject()
....@@ -3769,6 +5202,7 @@
37695202 {
37705203 if (GetTree() != null)
37715204 {
5205
+ GetTree().revalidate();
37725206 GetTree().repaint();
37735207 }
37745208
....@@ -3777,12 +5211,19 @@
37775211 ctrlPanel.validate(); // ? new
37785212 ctrlPanel.repaint();
37795213 }
5214
+
5215
+ if (previousVersionButton != null && copy.versionlist != null)
5216
+ SetVersionStates();
5217
+
5218
+ cameraView.requestFocusInWindow();
37805219 }
37815220
37825221 static TweenManager tweenManager = new TweenManager();
37835222
37845223 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
37855224 {
5225
+ if (Globals.REPLACEONMAKE) // && resetmodel)
5226
+ Save();
37865227 //Tween.set(thing, 0).target(1).start(tweenManager);
37875228 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
37885229 // if (thing instanceof GenericJointDemo)
....@@ -3806,7 +5247,7 @@
38065247 // group = (Composite) group.get(0);
38075248 // }
38085249
3809
- System.out.println("makeSomething of " + thing);
5250
+ //System.out.println("makeSomething of " + thing);
38105251
38115252 /*
38125253 if (deselect && jList != null)
....@@ -3869,6 +5310,12 @@
38695310 {
38705311 ResetModel();
38715312 Select(thing.GetTreePath(), true, false); // unselect... false);
5313
+
5314
+ if (thing.Size() == 0)
5315
+ {
5316
+ //EditSelection(false);
5317
+ }
5318
+
38725319 refreshContents();
38735320 }
38745321
....@@ -3986,6 +5433,7 @@
39865433 }
39875434 }
39885435 }
5436
+
39895437 LoadGFDThread loadGFDThread;
39905438
39915439 void ReadGFD(String fullname, iCallBack cb)
....@@ -4005,8 +5453,10 @@
40055453
40065454 try
40075455 {
5456
+ // Try compressed version first.
40085457 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4009
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
5458
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
5459
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40105460
40115461 readobj = (Object3D) p.readObject();
40125462 istream.close();
....@@ -4014,7 +5464,22 @@
40145464 readobj.ResetDisplayList();
40155465 } catch (Exception e)
40165466 {
4017
- e.printStackTrace();
5467
+ if (!e.toString().contains("GZIP"))
5468
+ e.printStackTrace();
5469
+
5470
+ try
5471
+ {
5472
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
5473
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
5474
+
5475
+ readobj = (Object3D) p.readObject();
5476
+ istream.close();
5477
+
5478
+ readobj.ResetDisplayList();
5479
+ } catch (Exception e2)
5480
+ {
5481
+ e2.printStackTrace();
5482
+ }
40185483 }
40195484 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40205485 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4060,6 +5525,12 @@
40605525
40615526 void LoadIt(Object obj)
40625527 {
5528
+ if (obj == null)
5529
+ {
5530
+ // Invalid file
5531
+ return;
5532
+ }
5533
+
40635534 System.out.println("Loaded " + obj);
40645535 //new Exception().printStackTrace();
40655536 Object3D readobj = (Object3D) obj;
....@@ -4069,10 +5540,14 @@
40695540
40705541 if (readobj != null)
40715542 {
5543
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
5544
+ // Save();
40725545 try
40735546 {
40745547 //readobj.deepCopySelf(copy);
40755548 copy.clear(); // june 2014
5549
+ copy.skyboxname = readobj.skyboxname;
5550
+ copy.skyboxext = readobj.skyboxext;
40765551 for (int i = 0; i < readobj.size(); i++)
40775552 {
40785553 Object3D child = readobj.get(i); // reserve(i);
....@@ -4113,6 +5588,7 @@
41135588 }
41145589 } catch (ClassCastException e)
41155590 {
5591
+ e.printStackTrace();
41165592 assert (false);
41175593 Composite c = (Composite) copy;
41185594 c.children.clear();
....@@ -4123,17 +5599,32 @@
41235599 c.addChild(csg);
41245600 }
41255601
5602
+ copy.versionlist = readobj.versionlist;
5603
+ copy.versionindex = readobj.versionindex;
5604
+ copy.versiontable = readobj.versiontable;
5605
+
5606
+ if (copy.versionlist == null)
5607
+ {
5608
+ // Backward compatibility
5609
+ copy.versionlist = new Object3D[100];
5610
+ copy.versionindex = -1;
5611
+
5612
+ //Save(true);
5613
+ }
5614
+
5615
+ //? SetUndoStates();
5616
+
41265617 ResetModel();
41275618 copy.HardTouch(); // recompile?
41285619 refreshContents();
41295620 }
41305621 }
41315622
4132
- void load() // throws ClassNotFoundException
5623
+ void Open() // throws ClassNotFoundException
41335624 {
4134
- if (GrafreeD.standAlone)
5625
+ if (Grafreed.standAlone)
41355626 {
4136
- FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
5627
+ FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD);
41375628 browser.show();
41385629 String filename = browser.getFile();
41395630 if (filename != null && filename.length() > 0)
....@@ -4210,6 +5701,8 @@
42105701
42115702 void save()
42125703 {
5704
+ Replace();
5705
+
42135706 if (lastname == null)
42145707 {
42155708 return;
....@@ -4218,11 +5711,13 @@
42185711 try
42195712 {
42205713 FileOutputStream ostream = new FileOutputStream(lastname);
4221
- ObjectOutputStream p = new ObjectOutputStream(ostream);
5714
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5715
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42225716
42235717 p.writeObject(copy);
42245718 p.flush();
42255719
5720
+ zstream.close();
42265721 ostream.close();
42275722
42285723 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4230,19 +5725,23 @@
42305725 //ps.print(buffer.toString());
42315726 } catch (IOException e)
42325727 {
5728
+ e.printStackTrace();
42335729 }
42345730 }
5731
+
42355732 String lastname;
42365733
42375734 void saveAs()
42385735 {
4239
- if (GrafreeD.standAlone)
5736
+ if (Grafreed.standAlone)
42405737 {
42415738 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42425739 browser.setVisible(true);
42435740 String filename = browser.getFile();
42445741 if (filename != null && filename.length() > 0)
42455742 {
5743
+ if (!filename.endsWith(".gfd"))
5744
+ filename += ".gfd";
42465745 lastname = browser.getDirectory() + filename;
42475746 save();
42485747 }
....@@ -4341,13 +5840,13 @@
43415840 try
43425841 {
43435842 FileOutputStream ostream = new FileOutputStream(filename);
4344
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4345
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
5843
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5844
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43465845
43475846 Object3D objectparent = obj.parent;
43485847 obj.parent = null;
43495848
4350
- Object3D object = (Object3D) GrafreeD.clone(obj);
5849
+ Object3D object = (Object3D) Grafreed.clone(obj);
43515850
43525851 obj.parent = objectparent;
43535852
....@@ -4359,8 +5858,8 @@
43595858 p.writeObject(object);
43605859 p.flush();
43615860
5861
+ zstream.close();
43625862 ostream.close();
4363
- // zstream.close();
43645863
43655864 // group.selection.get(0).parent = parent;
43665865 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4381,7 +5880,7 @@
43815880 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43825881 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43835882 copy.generatePOV(buffer);
4384
- if (GrafreeD.standAlone)
5883
+ if (Grafreed.standAlone)
43855884 {
43865885 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43875886 browser.show();
....@@ -4407,19 +5906,18 @@
44075906 Object3D client;
44085907 Object3D copy;
44095908 MenuBar menuBar;
4410
- Menu windowMenu;
4411
- MenuItem loadItem;
5909
+ Menu fileMenu;
5910
+ MenuItem newItem;
5911
+ MenuItem openItem;
44125912 MenuItem saveItem;
44135913 MenuItem saveAsItem;
44145914 MenuItem exportAsItem;
44155915 MenuItem reexportItem;
44165916 MenuItem povItem;
44175917 MenuItem closeItem;
4418
- Menu cameraMenu;
5918
+
44195919 CheckboxMenuItem zBufferItem;
44205920 //MenuItem normalLensItem;
4421
- MenuItem editCameraItem;
4422
- MenuItem revertCameraItem;
44235921 MenuItem stepItem;
44245922 CheckboxMenuItem toggleLiveItem;
44255923 CheckboxMenuItem toggleFullScreenItem;
....@@ -4430,25 +5928,40 @@
44305928 CheckboxMenuItem toggleFootContactItem;
44315929 CheckboxMenuItem toggleDLItem;
44325930 CheckboxMenuItem toggleTextureItem;
4433
- CheckboxMenuItem toggleRandomItem;
5931
+ CheckboxMenuItem toggleSwitchItem;
44345932 CheckboxMenuItem toggleRootItem;
44355933 CheckboxMenuItem animationItem;
5934
+ MenuItem archiveItem;
44365935 CheckboxMenuItem toggleHandleItem;
44375936 CheckboxMenuItem togglePaintItem;
44385937 JSplitPane mainPanel;
44395938 JScrollPane scrollpane;
5939
+
44405940 JPanel toolbarPanel;
5941
+
44415942 cGridBag treePanel;
5943
+
44425944 JPanel radioPanel;
44435945 ButtonGroup buttonGroup;
4444
- cGridBag ctrlPanel;
5946
+
5947
+ cGridBag toolboxPanel;
5948
+ cGridBag skyboxPanel;
44455949 cGridBag materialPanel;
5950
+ cGridBag ctrlPanel;
5951
+
44465952 JScrollPane infoPanel;
5953
+
44475954 cGridBag optionsPanel;
5955
+
44485956 JTabbedPane objectPanel;
5957
+ boolean materialFlushed;
5958
+ Object3D latestObject;
5959
+
44495960 cGridBag XYZPanel;
5961
+
44505962 JSplitPane gridPanel;
44515963 JSplitPane bigPanel;
5964
+
44525965 cGridBag bigThree;
44535966 cGridBag scenePanel;
44545967 cGridBag centralPanel;
....@@ -4506,7 +6019,7 @@
45066019 JLabel colorLabel;
45076020 cNumberSlider colorField;
45086021 JLabel modulationLabel;
4509
- cNumberSlider modulationField;
6022
+ cNumberSlider saturationField;
45106023 JLabel metalnessLabel;
45116024 cNumberSlider metalnessField;
45126025 JLabel diffuseLabel;
....@@ -4537,6 +6050,7 @@
45376050 cNumberSlider anisoField;
45386051 JLabel anisoVLabel;
45396052 cNumberSlider anisoVField;
6053
+
45406054 JLabel cameraLabel;
45416055 cNumberSlider cameraField;
45426056 JLabel selfshadowLabel;
....@@ -4551,6 +6065,7 @@
45516065 cNumberSlider fakedepthField;
45526066 JLabel shadowbiasLabel;
45536067 cNumberSlider shadowbiasField;
6068
+
45546069 JLabel bumpLabel;
45556070 cNumberSlider bumpField;
45566071 JLabel noiseLabel;
....@@ -4563,8 +6078,13 @@
45636078 cNumberSlider fogField;
45646079 JLabel opacityPowerLabel;
45656080 cNumberSlider opacityPowerField;
4566
- JTree jTree;
6081
+ cTree jTree;
45676082 //ObjectUI parent;
45686083
45696084 cNumberSlider normalpushField;
6085
+
6086
+ private MenuItem importGFDItem;
6087
+ private MenuItem importVRMLX3DItem;
6088
+ private MenuItem import3DSItem;
6089
+ private MenuItem importOBJItem;
45706090 }