Normand Briere
2019-08-18 480ad70047e54b2b92f974e6c2ac5a6c0bdc5a5c
ObjEditor.java
....@@ -15,6 +15,9 @@
1515 //import javax.swing.plaf.ColorUIResource;
1616 //import javax.swing.plaf.metal.DefaultMetalTheme;
1717
18
+import javax.swing.plaf.basic.BasicSplitPaneDivider;
19
+import javax.swing.plaf.basic.BasicSplitPaneUI;
20
+
1821 //import javax.media.opengl.GLCanvas;
1922
2023 import //weka.core.
....@@ -31,6 +34,7 @@
3134 iSendInfo
3235 //KeyListener
3336 {
37
+ public cToggleButton pinButton;
3438 boolean timeline;
3539 boolean wasFullScreen;
3640
....@@ -38,64 +42,137 @@
3842 JFrame frame;
3943
4044 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 Composite CreateCameras()
76
+ {
77
+ Composite cams = new cTemplate();
78
+ cams.name = "Cameras";
79
+ copy.insertElementAt(cams, 0);
80
+
81
+ cams.addChild(new Camera());
82
+ cams.addChild(new Camera(1));
83
+ cams.addChild(new Camera(2));
84
+ cams.addChild(new Camera(3));
85
+ cams.addChild(new Camera(4));
86
+
87
+ return cams;
88
+ }
89
+
90
+ public cGridBag GetSeparator()
91
+ {
92
+ cGridBag separator = new cGridBag();
93
+ separator.add(new JSeparator());
94
+ separator.preferredHeight = 5;
95
+ return separator;
96
+ }
4197
4298 cButton GetButton(String name, boolean border)
4399 {
44
- try
45
- {
46
- ImageIcon icon = GetIcon(name);
100
+ ImageIcon icon = GetIcon(name);
101
+ if (icon != null || name.contains("/"))
47102 return new cButton(icon, border);
48
- }
49
- catch (Exception e)
50
- {
103
+ else
51104 return new cButton(name, border);
52
- }
105
+ }
106
+
107
+ cLabel GetLabel(String name, boolean border)
108
+ {
109
+ //ImageIcon icon = GetIcon(name);
110
+ return new cLabel(GetImage(name), border);
53111 }
54112
55113 cToggleButton GetToggleButton(String name, boolean border)
56114 {
57
- try
58
- {
59
- ImageIcon icon = GetIcon(name);
60
- return new cToggleButton(icon, border);
61
- }
62
- catch (Exception e)
63
- {
64
- return new cToggleButton(name, border);
65
- }
115
+ ImageIcon icon = GetIcon(name);
116
+ return new cToggleButton(icon, border);
66117 }
67118
68119 cCheckBox GetCheckBox(String name, boolean border)
69120 {
121
+ ImageIcon icon = GetIcon(name);
122
+ return new cCheckBox(icon, border);
123
+ }
124
+
125
+ static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>();
126
+
127
+ static ImageIcon GetIcon(String name)
128
+ {
129
+ javax.swing.ImageIcon iconCache = icons.get(name);
130
+ if (iconCache != null)
131
+ {
132
+ return iconCache;
133
+ }
134
+
70135 try
71136 {
72
- ImageIcon icon = GetIcon(name);
73
- return new cCheckBox(icon, border);
137
+ BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name));
138
+
139
+// if (image.getWidth() > 48 && image.getHeight() > 48)
140
+// {
141
+// BufferedImage resized = new BufferedImage(48, 48, image.getType());
142
+// Graphics2D g = resized.createGraphics();
143
+// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
144
+// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
145
+// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
146
+// g.dispose();
147
+//
148
+// image = resized;
149
+// }
150
+
151
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
152
+
153
+ icons.put(name, icon);
154
+
155
+ return icon;
74156 }
75157 catch (Exception e)
76158 {
77
- return new cCheckBox(name, border);
159
+ //icons.put(name, null);
160
+ return null;
78161 }
79162 }
80
-
81
- private ImageIcon GetIcon(String name) throws IOException
163
+
164
+ BufferedImage GetImage(String name)
82165 {
83
- BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
84
-
85
- if (image.getWidth() != 24 && image.getHeight() != 24)
166
+ try
86167 {
87
- BufferedImage resized = new BufferedImage(24, 24, image.getType());
88
- Graphics2D g = resized.createGraphics();
89
- g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
90
- //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
91
- g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
92
- g.dispose();
93
-
94
- image = resized;
168
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
169
+
170
+ return image;
95171 }
96
-
97
- javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
98
- return icon;
172
+ catch (Exception e)
173
+ {
174
+ return null;
175
+ }
99176 }
100177
101178 // SCRIPT
....@@ -279,6 +356,14 @@
279356 client = inClient;
280357 copy = client;
281358
359
+// if (copy.versionlist == null)
360
+// {
361
+// copy.versionlist = new Object3D[100];
362
+// copy.versionindex = -1;
363
+//
364
+// callee.Save(true);
365
+// }
366
+
282367 // "this" is not called: SetupUI2(objEditor);
283368 }
284369
....@@ -292,6 +377,14 @@
292377 client = inClient;
293378 copy = client;
294379
380
+ if (copy.versionlist == null)
381
+ {
382
+ copy.versionlist = new Object3D[100];
383
+ copy.versionindex = -1;
384
+
385
+// Save(true);
386
+ }
387
+
295388 SetupUI2(callee.GetEditor());
296389 }
297390
....@@ -306,14 +399,15 @@
306399 //localCopy.parent = null;
307400
308401 frame = new JFrame();
309
- frame.setUndecorated(true);
402
+ frame.setUndecorated(false);
310403 objEditor = this;
311404 this.callee = callee;
312405
313406 //parent = p;
314407
315408 GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
316
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
409
+ if (Globals.DEBUG)
410
+ System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
317411 //gd.setFullScreenWindow(this);
318412 //setResizable(false);
319413 //if (!isDisplayable())
....@@ -324,6 +418,14 @@
324418 copy = localCopy;
325419 copy.editWindow = this;
326420
421
+// if (copy.versionlist == null)
422
+// {
423
+// copy.versionlist = new Object3D[100];
424
+// copy.versionindex = -1;
425
+//
426
+// Save(true);
427
+// }
428
+
327429 SetupMenu();
328430
329431 //SetupName(objEditor); // new
....@@ -342,12 +444,15 @@
342444
343445 static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
344446
447
+ // This is to refresh the UI of the material panel.
448
+ boolean patchMaterial;
449
+
345450 void SetupMenu()
346451 {
347452 frame.setMenuBar(menuBar = new MenuBar());
348453 menuBar.add(fileMenu = new Menu("File"));
349454 fileMenu.add(newItem = new MenuItem("New"));
350
- fileMenu.add(loadItem = new MenuItem("Open..."));
455
+ fileMenu.add(openItem = new MenuItem("Open..."));
351456
352457 //oe.menuBar.add(menu = new Menu("Include"));
353458 Menu menu = new Menu("Import");
....@@ -379,7 +484,7 @@
379484 }
380485
381486 newItem.addActionListener(this);
382
- loadItem.addActionListener(this);
487
+ openItem.addActionListener(this);
383488 saveItem.addActionListener(this);
384489 saveAsItem.addActionListener(this);
385490 exportAsItem.addActionListener(this);
....@@ -391,6 +496,8 @@
391496
392497 ChangeListener changeListener = new ChangeListener()
393498 {
499
+ //String name;
500
+
394501 public void stateChanged(ChangeEvent changeEvent)
395502 {
396503 // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
....@@ -409,18 +516,49 @@
409516 // EditSelection(false);
410517 // }
411518
412
- refreshContents(false); // To refresh Info tab
519
+// if (objectPanel.getSelectedIndex() == 4)
520
+// {
521
+// name = copy.skyboxname;
522
+//
523
+// if (name == null)
524
+// {
525
+// name = "";
526
+// }
527
+//
528
+// copy.skyboxname = "cubemaps/default-skyboxes/rgb";
529
+// copy.skyboxext = "jpg";
530
+// }
531
+// else
532
+// {
533
+// if (name != null)
534
+// {
535
+// if (name.equals(""))
536
+// {
537
+// copy.skyboxname = null;
538
+// copy.skyboxext = null;
539
+// }
540
+// else
541
+// {
542
+// copy.skyboxname = name;
543
+// }
544
+// }
545
+// }
546
+ cameraView.transformMode = objectPanel.getSelectedIndex() == 4;
547
+
548
+// refreshContents(false); // To refresh Info tab
549
+ cameraView.repaint();
413550 }
414551 };
415552 objectPanel.addChangeListener(changeListener);
416553
417554 toolbarPanel = new JPanel();
418555 toolbarPanel.setName("Toolbar");
556
+
419557 treePanel = new cGridBag();
420558 treePanel.setName("Tree");
421559
422560 editPanel = new cGridBag().setVertical(true);
423
- editPanel.setName("Edit");
561
+ //editPanel.setName("Edit");
424562
425563 ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
426564
....@@ -428,11 +566,13 @@
428566 editPanel.add(editCommandsPanel);
429567 editPanel.add(ctrlPanel);
430568
431
- toolboxPanel = new cGridBag().setVertical(false);
432
- toolboxPanel.setName("Toolbox");
569
+ toolboxPanel = new cGridBag().setVertical(true);
570
+ //toolboxPanel.setName("Toolbox");
433571
434
- materialPanel = new cGridBag().setVertical(true);
435
- materialPanel.setName("Material");
572
+ skyboxPanel = new cGridBag().setVertical(true);
573
+
574
+ materialPanel = new cGridBag().setVertical(false);
575
+ //materialPanel.setName("Material");
436576
437577 /*JTextPane*/
438578 infoarea = createTextPane();
....@@ -440,14 +580,15 @@
440580
441581 infoarea.setEditable(true);
442582 SetText();
583
+
443584 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
444585 // infoarea.setOpaque(false);
445586 // //infoarea.setForeground(textcolor);
446587 // TEXTAREA infoarea.setLineWrap(true);
447588 // TEXTAREA infoarea.setWrapStyleWord(true);
448589 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
449
- infoPanel.setPreferredSize(new Dimension(50, 200));
450
- infoPanel.setName("Info");
590
+ infoPanel.setPreferredSize(new Dimension(1, 1));
591
+ //infoPanel.setName("Info");
451592 //infoPanel.setLayout(new BorderLayout());
452593 //infoPanel.add(createTextPane());
453594
....@@ -458,7 +599,14 @@
458599 mainPanel.setDividerSize(9);
459600 mainPanel.setDividerLocation(0.5); //1.0);
460601 mainPanel.setResizeWeight(0.5);
461
-
602
+
603
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
604
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
605
+ divider.setDividerSize(15);
606
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
607
+
608
+ mainPanel.setUI(new BasicSplitPaneUI());
609
+
462610 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
463611 //mainPanel.setLayout(new GridBagLayout());
464612 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
....@@ -689,8 +837,8 @@
689837 }
690838 }
691839
692
-static GraphicsDevice device = GraphicsEnvironment
693
- .getLocalGraphicsEnvironment().getScreenDevices()[0];
840
+//static GraphicsDevice device = GraphicsEnvironment
841
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
694842
695843 Rectangle keeprect;
696844 cRadio radio;
....@@ -707,14 +855,24 @@
707855 boolean maximized;
708856
709857 cButton fullscreenLayout;
858
+ cButton expandedLayout;
710859
711860 void Minimize()
712861 {
713862 frame.setState(Frame.ICONIFIED);
863
+ frame.validate();
714864 }
715865
866
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
867
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
868
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
716869 void Maximize()
717870 {
871
+ if (CameraPane.FULLSCREEN)
872
+ {
873
+ ToggleFullScreen();
874
+ }
875
+
718876 if (maximized)
719877 {
720878 frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
....@@ -722,22 +880,38 @@
722880 else
723881 {
724882 keeprect = frame.getBounds();
725
- Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
726
- Dimension rect2 = frame.getToolkit().getScreenSize();
727
- frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
883
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
884
+// Dimension rect2 = frame.getToolkit().getScreenSize();
885
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
728886 // frame.setState(Frame.MAXIMIZED_BOTH);
887
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
729888 }
730889
731890 maximized ^= true;
891
+
892
+ frame.validate();
732893 }
894
+
895
+ cButton minButton;
896
+ cButton maxButton;
897
+ cButton fullButton;
898
+ cButton collapseButton;
899
+ cButton maximize3DButton;
733900
734901 void ToggleFullScreen()
735902 {
903
+ GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
904
+
736905 cameraView.ToggleFullScreen();
737906
738907 if (!CameraPane.FULLSCREEN)
739908 {
740909 device.setFullScreenWindow(null);
910
+ frame.dispose();
911
+ frame.setUndecorated(false);
912
+ frame.validate();
913
+ frame.setVisible(true);
914
+
741915 //frame.setVisible(false);
742916 // frame.removeNotify();
743917 // frame.setUndecorated(false);
....@@ -747,13 +921,13 @@
747921 // X frame.getContentPane().remove(/*"Center",*/bigThree);
748922 // X framePanel.add(bigThree);
749923 // X frame.getContentPane().add(/*"Center",*/framePanel);
750
- framePanel.setDividerLocation(1);
924
+// framePanel.setDividerLocation(46); // icons are 24x24
751925
752926 //frame.setVisible(true);
753
- radio.layout = keepButton;
927
+// radio.layout = keepButton;
754928 //theFrame = null;
755929 keepButton = null;
756
- radio.layout.doClick();
930
+// radio.layout.doClick();
757931
758932 } else
759933 {
....@@ -762,20 +936,70 @@
762936 // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
763937 // frame.getToolkit().getScreenSize().height);
764938 //frame.setVisible(false);
939
+
940
+ frame.dispose();
941
+ frame.setUndecorated(true);
765942 device.setFullScreenWindow(frame);
943
+ frame.validate();
944
+ frame.setVisible(true);
766945 // frame.removeNotify();
767946 // frame.setUndecorated(true);
768947 // frame.addNotify();
769948 // X frame.getContentPane().remove(/*"Center",*/framePanel);
770949 // X framePanel.remove(bigThree);
771950 // X frame.getContentPane().add(/*"Center",*/bigThree);
772
- framePanel.setDividerLocation(0);
951
+// framePanel.setDividerLocation(0);
773952
774
- radio.layout = fullscreenLayout;
775
- radio.layout.doClick();
953
+// radio.layout = fullscreenLayout;
954
+// radio.layout.doClick();
776955 //frame.setVisible(true);
777956 }
957
+ frame.validate();
958
+
959
+ cameraView.requestFocusInWindow();
778960 }
961
+
962
+ void CollapseToolbar()
963
+ {
964
+ framePanel.setDividerLocation(0);
965
+ //frame.validate();
966
+
967
+ cameraView.requestFocusInWindow();
968
+ }
969
+
970
+ private Object3D Duplicate(Object3D object)
971
+ {
972
+ boolean temp = CameraPane.SWITCH;
973
+ CameraPane.SWITCH = false;
974
+
975
+ if (Grafreed.grafreed.universe.versiontable == null)
976
+ Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
977
+
978
+ object.ExtractBigData(Grafreed.grafreed.universe.versiontable);
979
+ // if (copy == client)
980
+
981
+ Object3D versions[] = object.versionlist;
982
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe
983
+ object.versionlist = null;
984
+ object.versiontable = null;
985
+
986
+ Object3D parent = object.parent;
987
+ object.parent = null;
988
+
989
+ //byte[] compress = Compress(copy);
990
+ Object3D compress = (Object3D)Grafreed.clone(object);
991
+
992
+ object.parent = parent;
993
+
994
+ object.versionlist = versions;
995
+ object.versiontable = versiontable; // if Grafreed.grafreed.universe
996
+
997
+ object.RestoreBigData(Grafreed.grafreed.universe.versiontable);
998
+
999
+ CameraPane.SWITCH = temp;
1000
+
1001
+ return compress;
1002
+ }
7791003
7801004 private JTextPane createTextPane()
7811005 {
....@@ -898,6 +1122,7 @@
8981122 {
8991123 SetupMaterial(materialPanel);
9001124 }
1125
+
9011126 //SetupName();
9021127 //SetupViews();
9031128 }
....@@ -907,7 +1132,7 @@
9071132 // NumberSlider vDivsField;
9081133 // JCheckBox endcaps;
9091134 JCheckBox liveCB;
910
- JCheckBox selectCB;
1135
+ JCheckBox selectableCB;
9111136 JCheckBox hideCB;
9121137 JCheckBox link2masterCB;
9131138 JCheckBox markCB;
....@@ -1106,8 +1331,20 @@
11061331
11071332 namePanel = new cGridBag();
11081333
1334
+ //if (copy.pinned)
1335
+ {
1336
+ pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF);
1337
+ pinButton.setSelected(copy.pinned);
1338
+ cGridBag t = new cGridBag();
1339
+ t.preferredWidth = 2;
1340
+ t.add(pinButton);
1341
+ namePanel.add(t);
1342
+
1343
+ pinButton.addItemListener(this);
1344
+ }
1345
+
11091346 nameField = AddText(namePanel, copy.GetName());
1110
- namePanel.add(nameField);
1347
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
11111348 oe.ctrlPanel.add(namePanel);
11121349
11131350 oe.ctrlPanel.Return();
....@@ -1119,26 +1356,30 @@
11191356
11201357 liveCB = AddCheckBox(setupPanel, "Live", copy.live);
11211358 liveCB.setToolTipText("Animate object");
1122
- selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1123
- selectCB.setToolTipText("Make object selectable");
1359
+ markCB = AddCheckBox(setupPanel, "Anim", copy.marked);
1360
+ markCB.setToolTipText("Set target transform");
1361
+ selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1362
+ selectableCB.setToolTipText("Make object selectable");
11241363 // Return();
1364
+
11251365 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
11261366 hideCB.setToolTipText("Hide object");
1127
- markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1128
- markCB.setToolTipText("Set the animation target transform");
1367
+
1368
+ ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
11291369
11301370 setupPanel2 = new cGridBag().setVertical(false);
11311371
11321372 rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
11331373 rewindCB.setToolTipText("Rewind animation");
11341374
1135
- randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1136
- randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1375
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1376
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
11371377
1378
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1379
+ link2masterCB.setToolTipText("Attach to support");
1380
+
11381381 if (Globals.ADVANCED)
11391382 {
1140
- link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master);
1141
- link2masterCB.setToolTipText("Attach to support");
11421383 speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
11431384 speedupCB.setToolTipText("Option motion capture");
11441385 }
....@@ -1324,22 +1565,9 @@
13241565
13251566 if (cam == null || !(copy.get(0) instanceof cGroup))
13261567 {
1327
- System.out.println("CREATE CAMERAS");
1328
- cams = new cTemplate();
1329
- cams.name = "Cameras";
1330
- copy.insertElementAt(cams, 0);
1331
- //cams.parent = copy;
1332
-
1333
- cam = new Camera(); // LA.newVector(3, 2, 1));
1334
- cams.addChild(cam);
1335
- cam = new Camera(1);
1336
- cams.addChild(cam);
1337
- cam = new Camera(2);
1338
- cams.addChild(cam);
1339
- cam = new Camera(3);
1340
- cams.addChild(cam);
1341
- cam = new Camera(4); // Light
1342
- cams.addChild(cam);
1568
+ if (Globals.DEBUG)
1569
+ System.out.println("CREATE CAMERAS");
1570
+ cams = CreateCameras();
13431571 } else
13441572 {
13451573 cams = (cGroup) copy.get(0);
....@@ -1405,6 +1633,45 @@
14051633 //frontView.object = copy;
14061634 //sideView.object = copy;
14071635
1636
+ transformPanel = new cGridBag().setVertical(true);
1637
+
1638
+ cGridBag resetTransformPanel = new cGridBag();
1639
+
1640
+ resetTransformPanel.preferredHeight = 2;
1641
+
1642
+ cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF);
1643
+ resetTransform.setToolTipText("Reset Translation, Rotation and Scale");
1644
+ resetTransform.addMouseListener(new MouseAdapter()
1645
+ {
1646
+ public void mouseClicked(MouseEvent e)
1647
+ {
1648
+ ResetTransform();
1649
+ }
1650
+ });
1651
+ resetTransformPanel.add(resetTransform);
1652
+
1653
+ resetTransform = GetButton("T only", !Globals.NIMBUSLAF);
1654
+ resetTransform.setToolTipText("Reset Translation only");
1655
+ resetTransform.addMouseListener(new MouseAdapter()
1656
+ {
1657
+ public void mouseClicked(MouseEvent e)
1658
+ {
1659
+ ResetTransform(1);
1660
+ }
1661
+ });
1662
+ resetTransformPanel.add(resetTransform);
1663
+
1664
+ resetTransform = GetButton("RS only", !Globals.NIMBUSLAF);
1665
+ resetTransform.setToolTipText("Reset Rotation and Scale only");
1666
+ resetTransform.addMouseListener(new MouseAdapter()
1667
+ {
1668
+ public void mouseClicked(MouseEvent e)
1669
+ {
1670
+ ResetTransform(2);
1671
+ }
1672
+ });
1673
+ resetTransformPanel.add(resetTransform);
1674
+
14081675 XYZPanel = new cGridBag().setVertical(true);
14091676 //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
14101677
....@@ -1412,7 +1679,11 @@
14121679 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
14131680 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
14141681 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1682
+ //XYZPanel.setName("XYZ");
14151683
1684
+ transformPanel.add(resetTransformPanel);
1685
+ transformPanel.add(XYZPanel);
1686
+
14161687 /*
14171688 gridPanel = new JPanel(); //new BorderLayout());
14181689 gridPanel.setLayout(new GridLayout(1, 2));
....@@ -1420,12 +1691,12 @@
14201691 gridPanel.add(cameraView);
14211692 gridPanel.add(XYZPanel);
14221693 */
1423
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1424
- gridPanel.setContinuousLayout(true);
1425
- gridPanel.setOneTouchExpandable(true);
1426
- gridPanel.setDividerLocation(1.0);
1427
- gridPanel.setDividerSize(9);
1428
- gridPanel.setResizeWeight(0.85);
1694
+// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
1695
+// gridPanel.setContinuousLayout(true);
1696
+// gridPanel.setOneTouchExpandable(true);
1697
+// gridPanel.setDividerLocation(1.0);
1698
+// gridPanel.setDividerSize(9);
1699
+// gridPanel.setResizeWeight(0.85);
14291700
14301701 // aConstraints.weighty = 0;
14311702 //System.out.println("THIS = " + this);
....@@ -1448,15 +1719,34 @@
14481719
14491720 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
14501721 //tmp.setName("Edit");
1722
+ objectPanel.add(skyboxPanel);
1723
+ objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg"));
1724
+ objectPanel.setToolTipTextAt(0, "Backgrounds");
1725
+
1726
+ objectPanel.add(toolboxPanel);
1727
+ objectPanel.setIconAt(1, GetIcon("icons/primitives.png"));
1728
+ objectPanel.setToolTipTextAt(1, "Objects & textures");
1729
+
14511730 objectPanel.add(materialPanel);
1731
+ objectPanel.setIconAt(2, GetIcon("icons/material.png"));
1732
+ objectPanel.setToolTipTextAt(2, "Material");
1733
+
14521734 // JPanel north = new JPanel(new BorderLayout());
14531735 // north.setName("Edit");
14541736 // north.add(ctrlPanel, BorderLayout.NORTH);
14551737 // objectPanel.add(north);
14561738 objectPanel.add(editPanel);
1457
- objectPanel.add(infoPanel);
1458
- objectPanel.add(toolboxPanel);
1459
-
1739
+ objectPanel.setIconAt(3, GetIcon("icons/writewhite.png"));
1740
+ objectPanel.setToolTipTextAt(3, "Edit controls");
1741
+
1742
+ objectPanel.add(transformPanel);
1743
+ objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
1744
+ objectPanel.setToolTipTextAt(4, "TRS transform");
1745
+
1746
+ patchMaterial = true;
1747
+ cameraView.patchMaterial = this;
1748
+ objectPanel.setSelectedIndex(2);
1749
+
14601750 /*
14611751 aConstraints.gridx = 0;
14621752 aConstraints.gridwidth = 1;
....@@ -1487,11 +1777,51 @@
14871777
14881778 AddOptions(optionsPanel); //, aConstraints);
14891779
1490
- tabbedPane.add(optionsPanel);
1491
-
14921780 tabbedPane.add(FSPane = new cFileSystemPane(this));
14931781
1782
+ tabbedPane.add(optionsPanel);
1783
+
14941784 scenePanel.add(tabbedPane);
1785
+
1786
+ cGridBag creditsPanel = new cGridBag().setVertical(true);
1787
+ creditsPanel.setName("Credits");
1788
+
1789
+ cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
1790
+ creditsPanel.add(ogaLabel);
1791
+
1792
+ cButton opengameartButton;
1793
+ creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
1794
+ opengameartButton.setToolTipText("https://opengameart.org");
1795
+
1796
+ opengameartButton.addMouseListener(new MouseAdapter()
1797
+ {
1798
+ public void mouseClicked(MouseEvent e)
1799
+ {
1800
+ try
1801
+ {
1802
+ Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/"));
1803
+ } catch (Exception e1)
1804
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1805
+ {
1806
+ e1.printStackTrace();
1807
+ }
1808
+ }
1809
+ });
1810
+
1811
+ for (int i=10; --i>=0;)
1812
+ {
1813
+ creditsPanel.add(new cGridBag());
1814
+ }
1815
+
1816
+ tabbedPane.add(creditsPanel);
1817
+ tabbedPane.setToolTipTextAt(3, "Credits");
1818
+
1819
+ if (Globals.ADVANCED)
1820
+ {
1821
+ tabbedPane.add(infoPanel);
1822
+ tabbedPane.setIconAt(4, GetIcon("icons/info.png"));
1823
+ tabbedPane.setToolTipTextAt(4, "Information");
1824
+ }
14951825
14961826 /*
14971827 cTree jTree = new cTree(null);
....@@ -1513,13 +1843,13 @@
15131843 jtp.add(tree);
15141844 */
15151845
1516
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1517
- bigPanel.setContinuousLayout(true);
1518
- bigPanel.setOneTouchExpandable(true);
1519
- bigPanel.setDividerLocation(0.8);
1520
- bigPanel.setDividerSize(15);
1521
- bigPanel.setResizeWeight(0.15);
1522
- bigPanel.setName("Scene");
1846
+// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
1847
+// bigPanel.setContinuousLayout(true);
1848
+// bigPanel.setOneTouchExpandable(true);
1849
+// bigPanel.setDividerLocation(0.8);
1850
+// bigPanel.setDividerSize(15);
1851
+// bigPanel.setResizeWeight(0.15);
1852
+// bigPanel.setName("Scene");
15231853
15241854 //bigPanel.setLayout(new BorderLayout());
15251855 //bigPanel.setSize(new Dimension(10,10));
....@@ -1554,7 +1884,7 @@
15541884 bigThree = new cGridBag();
15551885 bigThree.addComponent(scenePanel);
15561886 bigThree.addComponent(centralPanel);
1557
- bigThree.addComponent(XYZPanel);
1887
+ //bigThree.addComponent(XYZPanel);
15581888
15591889 // // SIDE EFFECT!!!
15601890 // aConstraints.gridx = 0;
....@@ -1563,16 +1893,33 @@
15631893 // aConstraints.gridheight = 1;
15641894
15651895 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1566
- framePanel.setContinuousLayout(true);
1567
- framePanel.setOneTouchExpandable(true);
1568
- framePanel.setDividerLocation(0.8);
1896
+
1897
+ framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,
1898
+ new java.beans.PropertyChangeListener()
1899
+ {
1900
+ public void propertyChange(java.beans.PropertyChangeEvent pce)
1901
+ {
1902
+ if ((Integer)pce.getOldValue() == 1)
1903
+ {
1904
+ if (radio.layout != expandedLayout)
1905
+ {
1906
+ radio.layout = expandedLayout;
1907
+ radio.layout.doClick();
1908
+ }
1909
+ }
1910
+ }
1911
+ });
1912
+
1913
+ framePanel.setContinuousLayout(false);
1914
+ framePanel.setOneTouchExpandable(false);
1915
+ //.setDividerLocation(0.8);
15691916 //framePanel.setDividerSize(15);
15701917 //framePanel.setResizeWeight(0.15);
15711918 framePanel.setName("Frame");
15721919
15731920 frame.getContentPane().setLayout(new BorderLayout());
15741921 /**/
1575
- JTabbedPane worldPane = new JTabbedPane();
1922
+ //JTabbedPane worldPane = new JTabbedPane();
15761923 //worldPane.add(bigPanel);
15771924 //worldPane.add(worldPanel);
15781925 /**/
....@@ -1584,17 +1931,17 @@
15841931
15851932 frame.setSize(1280, 860);
15861933
1587
- frame.validate();
1588
- frame.setVisible(true);
1589
-
15901934 cameraView.requestFocusInWindow();
15911935
1592
- gridPanel.setDividerLocation(1.0);
1936
+// gridPanel.setDividerLocation(1.0);
1937
+
1938
+ frame.validate();
1939
+
1940
+ frame.setVisible(true);
15931941
15941942 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
15951943 frame.addWindowListener(new WindowAdapter()
15961944 {
1597
-
15981945 public void windowClosing(WindowEvent e)
15991946 {
16001947 Close();
....@@ -1617,28 +1964,442 @@
16171964 ctrlPanel.removeAll();
16181965 }
16191966
1620
- void SetupMaterial(cGridBag panel)
1967
+ void SetupMaterial(cGridBag materialpanel)
16211968 {
1622
- /*
1969
+ cGridBag presetpanel = new cGridBag().setVertical(true);
1970
+
1971
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF);
1972
+ skin.setToolTipText("Skin");
1973
+ skin.addMouseListener(new MouseAdapter()
1974
+ {
1975
+ public void mouseClicked(MouseEvent e)
1976
+ {
1977
+ Object3D object = Grafreed.materials.versionlist[0].get(0);
1978
+ cMaterial material = object.material;
1979
+
1980
+ // Skin
1981
+ colorField.setFloat(material.color);
1982
+ float saturation = material.modulation;
1983
+
1984
+ if (!cameraView.Skinshader)
1985
+ {
1986
+ saturation /= 1.5;
1987
+ }
1988
+
1989
+ saturationField.setFloat(saturation);
1990
+
1991
+ subsurfaceField.setFloat(material.subsurface);
1992
+ selfshadowField.setFloat(material.diffuseness);
1993
+ diffusenessField.setFloat(material.factor);
1994
+ shininessField.setFloat(material.shininess);
1995
+ shadowbiasField.setFloat(material.shadowbias);
1996
+ diffuseField.setFloat(material.diffuse);
1997
+ specularField.setFloat(material.specular);
1998
+
1999
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2000
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2001
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2002
+
2003
+ materialtouched = true;
2004
+ applySelf();
2005
+ }
2006
+ });
2007
+ presetpanel.add(skin);
2008
+
2009
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF);
2010
+ lambert.setToolTipText("Diffuse");
2011
+ lambert.addMouseListener(new MouseAdapter()
2012
+ {
2013
+ public void mouseClicked(MouseEvent e)
2014
+ {
2015
+ Object3D object = Grafreed.materials.versionlist[2].get(0);
2016
+ cMaterial material = object.material;
2017
+
2018
+ diffusenessField.setFloat(material.factor);
2019
+ selfshadowField.setFloat(material.diffuseness);
2020
+
2021
+ materialtouched = true;
2022
+ applySelf();
2023
+ }
2024
+ });
2025
+ presetpanel.add(lambert);
2026
+
2027
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF);
2028
+ diffuse2.setToolTipText("Diffuse2");
2029
+ diffuse2.addMouseListener(new MouseAdapter()
2030
+ {
2031
+ public void mouseClicked(MouseEvent e)
2032
+ {
2033
+ Object3D object = Grafreed.materials.versionlist[3].get(0);
2034
+ cMaterial material = object.material;
2035
+
2036
+ diffusenessField.setFloat(material.factor);
2037
+ selfshadowField.setFloat(material.diffuseness);
2038
+
2039
+ materialtouched = true;
2040
+ applySelf();
2041
+ }
2042
+ });
2043
+ presetpanel.add(diffuse2);
2044
+
2045
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF);
2046
+ diffusemoon.setToolTipText("Moon");
2047
+ diffusemoon.addMouseListener(new MouseAdapter()
2048
+ {
2049
+ public void mouseClicked(MouseEvent e)
2050
+ {
2051
+ Object3D object = Grafreed.materials.versionlist[4].get(0);
2052
+ cMaterial material = object.material;
2053
+
2054
+ diffusenessField.setFloat(material.factor);
2055
+ selfshadowField.setFloat(material.diffuseness);
2056
+
2057
+ materialtouched = true;
2058
+ applySelf();
2059
+ }
2060
+ });
2061
+ presetpanel.add(diffusemoon);
2062
+
2063
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF);
2064
+ diffusemoon2.setToolTipText("Moon2");
2065
+ diffusemoon2.addMouseListener(new MouseAdapter()
2066
+ {
2067
+ public void mouseClicked(MouseEvent e)
2068
+ {
2069
+ Object3D object = Grafreed.materials.versionlist[5].get(0);
2070
+ cMaterial material = object.material;
2071
+
2072
+ diffusenessField.setFloat(material.factor);
2073
+ selfshadowField.setFloat(material.diffuseness);
2074
+
2075
+ materialtouched = true;
2076
+ applySelf();
2077
+ }
2078
+ });
2079
+ presetpanel.add(diffusemoon2);
2080
+
2081
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF);
2082
+ diffusemoon3.setToolTipText("Moon3");
2083
+ diffusemoon3.addMouseListener(new MouseAdapter()
2084
+ {
2085
+ public void mouseClicked(MouseEvent e)
2086
+ {
2087
+ Object3D object = Grafreed.materials.versionlist[6].get(0);
2088
+ cMaterial material = object.material;
2089
+
2090
+ diffusenessField.setFloat(material.factor);
2091
+ selfshadowField.setFloat(material.diffuseness);
2092
+
2093
+ materialtouched = true;
2094
+ applySelf();
2095
+ }
2096
+ });
2097
+ presetpanel.add(diffusemoon3);
2098
+
2099
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF);
2100
+ diffusesheen.setToolTipText("Sheen");
2101
+ diffusesheen.addMouseListener(new MouseAdapter()
2102
+ {
2103
+ public void mouseClicked(MouseEvent e)
2104
+ {
2105
+ Object3D object = Grafreed.materials.versionlist[7].get(0);
2106
+ cMaterial material = object.material;
2107
+
2108
+ sheenField.setFloat(material.sheen);
2109
+
2110
+ materialtouched = true;
2111
+ applySelf();
2112
+ }
2113
+ });
2114
+ presetpanel.add(diffusesheen);
2115
+
2116
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF);
2117
+ rough.setToolTipText("Rough metal");
2118
+ rough.addMouseListener(new MouseAdapter()
2119
+ {
2120
+ public void mouseClicked(MouseEvent e)
2121
+ {
2122
+ Object3D object = Grafreed.materials.versionlist[1].get(0);
2123
+ cMaterial material = object.material;
2124
+
2125
+ shininessField.setFloat(material.shininess);
2126
+ velvetField.setFloat(material.velvet);
2127
+
2128
+ materialtouched = true;
2129
+ applySelf();
2130
+ }
2131
+ });
2132
+ presetpanel.add(rough);
2133
+
2134
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF);
2135
+ rough2.setToolTipText("Medium metal");
2136
+ rough2.addMouseListener(new MouseAdapter()
2137
+ {
2138
+ public void mouseClicked(MouseEvent e)
2139
+ {
2140
+ Object3D object = Grafreed.materials.versionlist[13].get(0);
2141
+ cMaterial material = object.material;
2142
+
2143
+ shininessField.setFloat(material.shininess);
2144
+ lightareaField.setFloat(material.lightarea);
2145
+
2146
+ materialtouched = true;
2147
+ applySelf();
2148
+ }
2149
+ });
2150
+ presetpanel.add(rough2);
2151
+
2152
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF);
2153
+ shini0.setToolTipText("Shiny");
2154
+ shini0.addMouseListener(new MouseAdapter()
2155
+ {
2156
+ public void mouseClicked(MouseEvent e)
2157
+ {
2158
+ Object3D object = Grafreed.materials.versionlist[14].get(0);
2159
+ cMaterial material = object.material;
2160
+
2161
+ shininessField.setFloat(material.shininess);
2162
+ lightareaField.setFloat(material.lightarea);
2163
+
2164
+ materialtouched = true;
2165
+ applySelf();
2166
+ }
2167
+ });
2168
+ presetpanel.add(shini0);
2169
+
2170
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF);
2171
+ shini1.setToolTipText("Shiny2");
2172
+ shini1.addMouseListener(new MouseAdapter()
2173
+ {
2174
+ public void mouseClicked(MouseEvent e)
2175
+ {
2176
+ Object3D object = Grafreed.materials.versionlist[11].get(0);
2177
+ cMaterial material = object.material;
2178
+
2179
+ shininessField.setFloat(material.shininess);
2180
+ lightareaField.setFloat(material.lightarea);
2181
+
2182
+ materialtouched = true;
2183
+ applySelf();
2184
+ }
2185
+ });
2186
+ presetpanel.add(shini1);
2187
+
2188
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF);
2189
+ shini2.setToolTipText("Shiny3");
2190
+ shini2.addMouseListener(new MouseAdapter()
2191
+ {
2192
+ public void mouseClicked(MouseEvent e)
2193
+ {
2194
+ Object3D object = Grafreed.materials.versionlist[12].get(0);
2195
+ cMaterial material = object.material;
2196
+
2197
+ shininessField.setFloat(material.shininess);
2198
+ lightareaField.setFloat(material.lightarea);
2199
+
2200
+ materialtouched = true;
2201
+ applySelf();
2202
+ }
2203
+ });
2204
+ presetpanel.add(shini2);
2205
+
2206
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF);
2207
+ aniso.setToolTipText("AnisoU");
2208
+ aniso.addMouseListener(new MouseAdapter()
2209
+ {
2210
+ public void mouseClicked(MouseEvent e)
2211
+ {
2212
+ Object3D object = Grafreed.materials.versionlist[8].get(0);
2213
+ cMaterial material = object.material;
2214
+
2215
+ anisoField.setFloat(material.aniso);
2216
+ anisoVField.setFloat(material.anisoV);
2217
+
2218
+ materialtouched = true;
2219
+ applySelf();
2220
+ }
2221
+ });
2222
+ presetpanel.add(aniso);
2223
+
2224
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF);
2225
+ aniso2.setToolTipText("AnisoV");
2226
+ aniso2.addMouseListener(new MouseAdapter()
2227
+ {
2228
+ public void mouseClicked(MouseEvent e)
2229
+ {
2230
+ Object3D object = Grafreed.materials.versionlist[9].get(0);
2231
+ cMaterial material = object.material;
2232
+
2233
+ anisoField.setFloat(material.aniso);
2234
+ anisoVField.setFloat(material.anisoV);
2235
+
2236
+ materialtouched = true;
2237
+ applySelf();
2238
+ }
2239
+ });
2240
+ presetpanel.add(aniso2);
2241
+
2242
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF);
2243
+ aniso3.setToolTipText("AnisoUV");
2244
+ aniso3.addMouseListener(new MouseAdapter()
2245
+ {
2246
+ public void mouseClicked(MouseEvent e)
2247
+ {
2248
+ Object3D object = Grafreed.materials.versionlist[10].get(0);
2249
+ cMaterial material = object.material;
2250
+
2251
+ anisoField.setFloat(material.aniso);
2252
+ anisoVField.setFloat(material.anisoV);
2253
+
2254
+ materialtouched = true;
2255
+ applySelf();
2256
+ }
2257
+ });
2258
+ presetpanel.add(aniso3);
2259
+
2260
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF);
2261
+ velvet0.setToolTipText("Velvet");
2262
+ velvet0.addMouseListener(new MouseAdapter()
2263
+ {
2264
+ public void mouseClicked(MouseEvent e)
2265
+ {
2266
+ Object3D object = Grafreed.materials.versionlist[15].get(0);
2267
+ cMaterial material = object.material;
2268
+
2269
+ diffusenessField.setFloat(material.factor);
2270
+ selfshadowField.setFloat(material.diffuseness);
2271
+ sheenField.setFloat(material.sheen);
2272
+ shininessField.setFloat(material.shininess);
2273
+ velvetField.setFloat(material.velvet);
2274
+ shiftField.setFloat(material.shift);
2275
+
2276
+ materialtouched = true;
2277
+ applySelf();
2278
+ }
2279
+ });
2280
+ presetpanel.add(velvet0);
2281
+
2282
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF);
2283
+ bump0.setToolTipText("Bump texture");
2284
+ bump0.addMouseListener(new MouseAdapter()
2285
+ {
2286
+ public void mouseClicked(MouseEvent e)
2287
+ {
2288
+ Object3D object = Grafreed.materials.versionlist[16].get(0);
2289
+ cMaterial material = object.material;
2290
+
2291
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2292
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2293
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2294
+
2295
+ materialtouched = true;
2296
+ applySelf();
2297
+ }
2298
+ });
2299
+ presetpanel.add(bump0);
2300
+
2301
+ cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF);
2302
+ borderShader.setToolTipText("Border fade");
2303
+ borderShader.addMouseListener(new MouseAdapter()
2304
+ {
2305
+ public void mouseClicked(MouseEvent e)
2306
+ {
2307
+ borderfadeField.setFloat(0.5);
2308
+ opacityField.setFloat(0.75);
2309
+
2310
+ materialtouched = true;
2311
+ applySelf();
2312
+ }
2313
+ });
2314
+ presetpanel.add(borderShader);
2315
+
2316
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF);
2317
+ halo.setToolTipText("Halo");
2318
+ halo.addMouseListener(new MouseAdapter()
2319
+ {
2320
+ public void mouseClicked(MouseEvent e)
2321
+ {
2322
+ Object3D object = Grafreed.materials.versionlist[17].get(0);
2323
+ cMaterial material = object.material;
2324
+
2325
+ opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0);
2326
+
2327
+ materialtouched = true;
2328
+ applySelf();
2329
+ }
2330
+ });
2331
+ presetpanel.add(halo);
2332
+
2333
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF);
2334
+ candle.setToolTipText("Candle");
2335
+ candle.addMouseListener(new MouseAdapter()
2336
+ {
2337
+ public void mouseClicked(MouseEvent e)
2338
+ {
2339
+ Object3D object = Grafreed.materials.versionlist[18].get(0);
2340
+ cMaterial material = object.material;
2341
+
2342
+ subsurfaceField.setFloat(material.subsurface);
2343
+ shadowbiasField.setFloat(material.shadowbias);
2344
+ ambientField.setFloat(material.ambient);
2345
+ specularField.setFloat(material.specular);
2346
+ lightareaField.setFloat(material.lightarea);
2347
+ shininessField.setFloat(material.shininess);
2348
+
2349
+ materialtouched = true;
2350
+ applySelf();
2351
+ }
2352
+ });
2353
+ presetpanel.add(candle);
2354
+
2355
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF);
2356
+ shadowShader.setToolTipText("Shadow");
2357
+ shadowShader.addMouseListener(new MouseAdapter()
2358
+ {
2359
+ public void mouseClicked(MouseEvent e)
2360
+ {
2361
+ diffuseField.setFloat(0.001);
2362
+ ambientField.setFloat(0.001);
2363
+ cameraField.setFloat(0.001);
2364
+ specularField.setFloat(0.001);
2365
+ fakedepthField.setFloat(0.001);
2366
+ opacityField.setFloat(0.6);
2367
+
2368
+ materialtouched = true;
2369
+ applySelf();
2370
+ }
2371
+ });
2372
+ presetpanel.add(shadowShader);
2373
+
2374
+ cGridBag panel = new cGridBag().setVertical(true);
2375
+
2376
+ presetpanel.preferredWidth = 1;
2377
+
2378
+ materialpanel.add(presetpanel);
2379
+ materialpanel.add(panel);
2380
+
2381
+ panel.preferredWidth = 8;
2382
+
2383
+ /*
16232384 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
16242385 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1625
- */
2386
+ */
16262387
16272388 cGridBag editBar = new cGridBag().setVertical(false);
16282389
1629
- editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
2390
+ editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints);
16302391 createMaterialButton.setToolTipText("Create material");
16312392
16322393 /*
16332394 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
16342395 */
16352396
1636
- editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
2397
+ editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints);
16372398 clearMaterialButton.setToolTipText("Clear material");
16382399
16392400 if (Globals.ADVANCED)
16402401 {
1641
- editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
2402
+ editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints);
16422403 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
16432404 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
16442405 }
....@@ -1656,45 +2417,61 @@
16562417 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16572418
16582419 cGridBag colorSection = new cGridBag().setVertical(true);
2420
+
2421
+ cGridBag huepanel = new cGridBag();
2422
+ cGridBag huelabel = new cGridBag();
2423
+ cLabel hue = GetLabel("icons/hue.png", false);
2424
+ hue.fit = true;
2425
+
2426
+ hue.addMouseListener(new MouseAdapter()
2427
+ {
2428
+ public void mousePressed(MouseEvent e)
2429
+ {
2430
+ int x = e.getX();
2431
+
2432
+ colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth());
2433
+ }
2434
+ });
2435
+
2436
+ huelabel.add(hue);
2437
+ huelabel.preferredWidth = 20;
2438
+ huepanel.add(new cGridBag()); // Label
2439
+ huepanel.add(huelabel); // Field/slider
2440
+
2441
+ huepanel.preferredHeight = 7;
2442
+
2443
+ colorSection.add(huepanel);
16592444
16602445 cGridBag color = new cGridBag();
1661
- color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1662
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1663
- color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2446
+
2447
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
2448
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2449
+ color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2450
+
16642451 //colorField.preferredWidth = 200;
16652452 colorSection.add(color);
16662453
16672454 cGridBag modulation = new cGridBag();
16682455 modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
16692456 modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1670
- modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2457
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
16712458 colorSection.add(modulation);
16722459
2460
+ cGridBag opacity = new cGridBag();
2461
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
2462
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2463
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2464
+ colorSection.add(opacity);
2465
+
2466
+ colorSection.add(GetSeparator());
2467
+
16732468 cGridBag texture = new cGridBag();
16742469 texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
16752470 textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16762471 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16772472 colorSection.add(texture);
16782473
1679
- cGridBag anisoU = new cGridBag();
1680
- anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1681
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1683
- colorSection.add(anisoU);
1684
-
1685
- cGridBag anisoV = new cGridBag();
1686
- anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1687
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1688
- anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1689
- colorSection.add(anisoV);
1690
-
1691
- cGridBag shadowbias = new cGridBag();
1692
- shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1693
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1694
- shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1695
- colorSection.add(shadowbias);
1696
-
1697
- panel.add(new JSeparator());
2474
+ panel.add(GetSeparator());
16982475
16992476 panel.add(colorSection);
17002477
....@@ -1744,7 +2521,13 @@
17442521 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
17452522 diffuseSection.add(fakedepth);
17462523
1747
- panel.add(new JSeparator());
2524
+ cGridBag shadowbias = new cGridBag();
2525
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
2526
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2527
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2528
+ diffuseSection.add(shadowbias);
2529
+
2530
+ panel.add(GetSeparator());
17482531
17492532 panel.add(diffuseSection);
17502533
....@@ -1794,42 +2577,48 @@
17942577 // aConstraints.gridy += 1;
17952578 // aConstraints.gridwidth = 1;
17962579
2580
+ cGridBag anisoU = new cGridBag();
2581
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
2582
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2583
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2584
+ specularSection.add(anisoU);
17972585
1798
- panel.add(new JSeparator());
2586
+ cGridBag anisoV = new cGridBag();
2587
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
2588
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2589
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2590
+ specularSection.add(anisoV);
2591
+
2592
+
2593
+ panel.add(GetSeparator());
17992594
18002595 panel.add(specularSection);
18012596
18022597 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18032598
1804
- cGridBag globalSection = new cGridBag().setVertical(true);
2599
+ //cGridBag globalSection = new cGridBag().setVertical(true);
18052600
18062601 cGridBag camera = new cGridBag();
18072602 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
18082603 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18092604 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1810
- globalSection.add(camera);
2605
+ colorSection.add(camera);
18112606
18122607 cGridBag ambient = new cGridBag();
18132608 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
18142609 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18152610 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1816
- globalSection.add(ambient);
2611
+ colorSection.add(ambient);
18172612
18182613 cGridBag backlit = new cGridBag();
18192614 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
18202615 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18212616 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1822
- globalSection.add(backlit);
2617
+ colorSection.add(backlit);
18232618
1824
- cGridBag opacity = new cGridBag();
1825
- opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1826
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1827
- opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1828
- globalSection.add(opacity);
1829
-
1830
- panel.add(new JSeparator());
2619
+ //panel.add(new JSeparator());
18312620
1832
- panel.add(globalSection);
2621
+ //panel.add(globalSection);
18332622
18342623 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18352624
....@@ -1871,7 +2660,7 @@
18712660 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
18722661 textureSection.add(opacityPower);
18732662
1874
- panel.add(new JSeparator());
2663
+ panel.add(GetSeparator());
18752664
18762665 panel.add(textureSection);
18772666
....@@ -1936,8 +2725,9 @@
19362725 // 3D models
19372726 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
19382727 {
1939
- lastConverter = new com.jmex.model.converters.MaxToJme();
1940
- LoadFile(filename, lastConverter);
2728
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2729
+ //LoadFile(filename, lastConverter);
2730
+ LoadObjFile(filename); // New 3ds loader
19412731 continue;
19422732 }
19432733 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -2663,6 +3453,7 @@
26633453 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
26643454 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
26653455 }
3456
+
26663457 //cJME.count++;
26673458 //cJME.count %= 12;
26683459 if (gc)
....@@ -2846,6 +3637,7 @@
28463637 }
28473638 }
28483639 }
3640
+
28493641 cFileSystemPane FSPane;
28503642
28513643 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2855,7 +3647,7 @@
28553647
28563648 freezematerial = true;
28573649 colorField.setFloat(mat.color);
2858
- modulationField.setFloat(mat.modulation);
3650
+ saturationField.setFloat(mat.modulation);
28593651 metalnessField.setFloat(mat.metalness);
28603652 diffuseField.setFloat(mat.diffuse);
28613653 specularField.setFloat(mat.specular);
....@@ -2899,6 +3691,7 @@
28993691 }
29003692 }
29013693 }
3694
+
29023695 freezematerial = false;
29033696 }
29043697
....@@ -2916,32 +3709,8 @@
29163709
29173710 if (multiplyToggle != null)
29183711 multiplyToggle.setSelected(mat.multiply);
2919
-
2920
- assert (object.projectedVertices != null);
2921
-
2922
- if (object.projectedVertices.length <= 2)
2923
- {
2924
- // Side effect...
2925
- Object3D.cVector2[] keep = object.projectedVertices;
2926
- object.projectedVertices = new Object3D.cVector2[3];
2927
- for (int i = 0; i < 3; i++)
2928
- {
2929
- if (i < keep.length)
2930
- {
2931
- object.projectedVertices[i] = keep[i];
2932
- } else
2933
- {
2934
- object.projectedVertices[i] = new Object3D.cVector2();
2935
- }
2936
- /*
2937
- if(keep.length == 0)
2938
- object.projectedVertices[0] = new Object3D.cVector2();
2939
- else
2940
- object.projectedVertices[0] = keep[0];
2941
- object.projectedVertices[1] = new Object3D.cVector2();
2942
- */
2943
- }
2944
- }
3712
+
3713
+ AllocProjectedVertices(object);
29453714
29463715 SetMaterial(mat, object.projectedVertices);
29473716 }
....@@ -3017,12 +3786,17 @@
30173786 // }
30183787
30193788 /**/
3020
- if (deselect)
3789
+ if (deselect || child == null)
30213790 {
30223791 //group.deselectAll();
30233792 //freeze = true;
30243793 GetTree().clearSelection();
30253794 //freeze = false;
3795
+
3796
+ if (child == null)
3797
+ {
3798
+ return;
3799
+ }
30263800 }
30273801
30283802 //group.addSelectee(child);
....@@ -3056,6 +3830,17 @@
30563830 public void itemStateChanged(ItemEvent event)
30573831 {
30583832 // System.out.println("Propagate = " + propagate);
3833
+ if (event.getSource() == pinButton)
3834
+ {
3835
+ copy.pinned ^= true;
3836
+ if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy))
3837
+ {
3838
+ ((GroupEditor)copy.editWindow).listUI.remove(copy);
3839
+ copy.CloseUI();
3840
+ //copy.editWindow.refreshContents();
3841
+ }
3842
+ }
3843
+ else
30593844 if (event.getSource() == propagateToggle)
30603845 {
30613846 propagate ^= true;
....@@ -3160,8 +3945,9 @@
31603945 } else if (event.getSource() == liveCB)
31613946 {
31623947 copy.live ^= true;
3948
+ objEditor.refreshContents(true); // To show item colors
31633949 return;
3164
- } else if (event.getSource() == selectCB)
3950
+ } else if (event.getSource() == selectableCB)
31653951 {
31663952 copy.dontselect ^= true;
31673953 return;
....@@ -3169,7 +3955,7 @@
31693955 {
31703956 copy.hide ^= true;
31713957 copy.Touch(); // display list issue
3172
- objEditor.refreshContents();
3958
+ objEditor.refreshContents(true); // To show item colors
31733959 return;
31743960 } else if (event.getSource() == link2masterCB)
31753961 {
....@@ -3234,7 +4020,7 @@
32344020 //System.out.println("ObjEditor " + event);
32354021 applySelf0(true);
32364022 //parent.applySelf();
3237
- objEditor.refreshContents();
4023
+ // conflicts with requestFocus objEditor.refreshContents();
32384024 } else if (source == resetButton)
32394025 {
32404026 CameraPane.fullreset = true;
....@@ -3346,9 +4132,9 @@
33464132 {
33474133 Close();
33484134 //return true;
3349
- } else if (source == loadItem)
4135
+ } else if (source == openItem)
33504136 {
3351
- load();
4137
+ Open();
33524138 //return true;
33534139 } else if (source == newItem)
33544140 {
....@@ -3373,6 +4159,10 @@
33734159 {
33744160 generatePOV();
33754161 //return true;
4162
+ } else if (event.getSource() == archiveItem)
4163
+ {
4164
+ cTools.Archive(frame);
4165
+ return;
33764166 } else if (source == zBufferItem)
33774167 {
33784168 try
....@@ -3410,22 +4200,30 @@
34104200
34114201 void New()
34124202 {
3413
- while (copy.Size() > 1)
4203
+ while (copy.Size() > 0)
34144204 {
3415
- copy.remove(1);
4205
+ copy.remove(0);
34164206 }
34174207
4208
+ copy.selection.clear();
4209
+
4210
+ if (copy == Grafreed.grafreed.universe)
4211
+ {
4212
+ CreateCameras();
4213
+ cameraView.SetCamera(GetCamera(copy, 0));
4214
+ }
34184215 ResetModel();
34194216 objEditor.refreshContents();
34204217 }
34214218
34224219 static public byte[] Compress(Object3D o)
34234220 {
4221
+ // Slower to actually compress.
34244222 try
34254223 {
34264224 ByteArrayOutputStream baos = new ByteArrayOutputStream();
3427
- java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3428
- ObjectOutputStream out = new ObjectOutputStream(zstream);
4225
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
4226
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
34294227
34304228 Object3D parent = o.parent;
34314229 o.parent = null;
....@@ -3436,10 +4234,14 @@
34364234
34374235 out.flush();
34384236
3439
- zstream.close();
4237
+ baos //zstream
4238
+ .close();
34404239 out.close();
34414240
3442
- return baos.toByteArray();
4241
+ byte[] bytes = baos.toByteArray();
4242
+
4243
+ System.out.println("save #bytes = " + bytes.length);
4244
+ return bytes;
34434245 } catch (Exception e)
34444246 {
34454247 System.err.println(e);
....@@ -3449,13 +4251,16 @@
34494251
34504252 static public Object Uncompress(byte[] bytes)
34514253 {
3452
- System.out.println("#bytes = " + bytes.length);
4254
+ System.out.println("restore #bytes = " + bytes.length);
34534255 try
34544256 {
34554257 ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3456
- java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3457
- ObjectInputStream in = new ObjectInputStream(istream);
4258
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
4259
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
34584260 Object obj = in.readObject();
4261
+
4262
+ bais //istream
4263
+ .close();
34594264 in.close();
34604265
34614266 return obj;
....@@ -3510,41 +4315,97 @@
35104315 return null;
35114316 }
35124317
3513
- java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
35144318
35154319 public void Save()
35164320 {
4321
+ //Save(true);
4322
+ Replace();
4323
+ SetVersionStates();
4324
+ }
4325
+
4326
+ private boolean Equal(byte[] compress, byte[] name)
4327
+ {
4328
+ if (compress.length != name.length)
4329
+ {
4330
+ return false;
4331
+ }
4332
+
4333
+ for (int i=compress.length; --i>=0;)
4334
+ {
4335
+ if (compress[i] != name[i])
4336
+ return false;
4337
+ }
4338
+
4339
+ return true;
4340
+ }
4341
+
4342
+ void DeleteVersion()
4343
+ {
4344
+ for (int i = copy.versionindex; i < copy.versionlist.length-1; i++)
4345
+ {
4346
+ copy.versionlist[i] = copy.versionlist[i+1];
4347
+ }
4348
+
4349
+ if (copy.versionlist[copy.versionindex] == null)
4350
+ copy.versionindex -= 1;
4351
+
4352
+ if (copy.versionindex != -1)
4353
+ CopyChanged();
4354
+
4355
+ SetVersionStates();
4356
+ }
4357
+
4358
+ public boolean Save(boolean user)
4359
+ {
35174360 System.err.println("Save");
4361
+ Replace();
35184362
3519
- cRadio tab = GetCurrentTab();
4363
+ //cRadio tab = GetCurrentTab();
35204364
3521
- boolean temp = CameraPane.SWITCH;
3522
- CameraPane.SWITCH = false;
4365
+ Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"?
35234366
3524
- copy.ExtractBigData(hashtable);
4367
+ boolean thesame = false;
4368
+
4369
+// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
4370
+// {
4371
+// thesame = true;
4372
+// }
35254373
35264374 //EditorFrame.m_MainFrame.requestFocusInWindow();
3527
- tab.graphs[tab.undoindex++] = Compress(copy);
3528
-
3529
- copy.RestoreBigData(hashtable);
3530
-
3531
- CameraPane.SWITCH = temp;
3532
-
3533
- //assert(hashtable.isEmpty());
3534
-
3535
- for (int i = tab.undoindex; i < tab.graphs.length; i++)
4375
+ if (!thesame)
35364376 {
3537
- tab.graphs[i] = null;
4377
+ for (int i = copy.versionlist.length; --i > copy.versionindex+1;)
4378
+ {
4379
+ copy.versionlist[i] = copy.versionlist[i-1];
4380
+ }
4381
+
4382
+ //tab.user[tab.versionindex] = user;
4383
+ //boolean increment = true; // tab.graphs[tab.versionindex] == null;
4384
+
4385
+ copy.versionlist[++copy.versionindex] = compress;
4386
+
4387
+ // if (increment)
4388
+ // tab.versionindex++;
35384389 }
35394390
3540
- SetUndoStates();
4391
+ //copy.RestoreBigData(versiontable);
4392
+
4393
+ //assert(hashtable.isEmpty());
4394
+
4395
+// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++)
4396
+// {
4397
+// //tab.user[i] = false;
4398
+// copy.versionlist[i] = null;
4399
+// }
4400
+
4401
+ SetVersionStates();
35414402
35424403 // test save
35434404 if (false)
35444405 {
35454406 try
35464407 {
3547
- FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
4408
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
35484409 ObjectOutputStream p = new ObjectOutputStream(ostream);
35494410
35504411 p.writeObject(copy);
....@@ -3557,28 +4418,68 @@
35574418 e.printStackTrace();
35584419 }
35594420 }
4421
+
4422
+ return !thesame;
4423
+ }
4424
+
4425
+ boolean flashIt = true;
4426
+
4427
+ void RefreshSelection()
4428
+ {
4429
+ Object3D selection = new Object3D();
4430
+
4431
+ for (int i = 0; i < copy.selection.size(); i++)
4432
+ {
4433
+ Object3D elem = copy.selection.elementAt(i);
4434
+
4435
+ Object3D obj = copy.GetObject(elem.GetUUID());
4436
+
4437
+ if (obj == null)
4438
+ {
4439
+ copy.selection.remove(i--);
4440
+ }
4441
+ else
4442
+ {
4443
+ selection.add(obj);
4444
+ copy.selection.setElementAt(obj, i);
4445
+ }
4446
+ }
4447
+
4448
+ flashIt = false;
4449
+ GetTree().clearSelection();
4450
+ for (int i = 0; i < selection.size(); i++)
4451
+ GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath());
4452
+ flashIt = true;
4453
+
4454
+ //refreshContents(false);
35604455 }
35614456
3562
- void CopyChanged(Object3D obj)
4457
+ void CopyChanged()
35634458 {
3564
- SetUndoStates();
4459
+ Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]);
4460
+
4461
+ SetVersionStates();
35654462
35664463 boolean temp = CameraPane.SWITCH;
35674464 CameraPane.SWITCH = false;
35684465
3569
- copy.ExtractBigData(hashtable);
4466
+ copy.ExtractBigData(Grafreed.grafreed.universe.versiontable);
35704467
35714468 copy.clear();
35724469
4470
+ copy.skyboxname = obj.skyboxname;
4471
+ copy.skyboxext = obj.skyboxext;
4472
+
35734473 for (int i=0; i<obj.Size(); i++)
35744474 {
35754475 copy.add(obj.get(i));
35764476 }
35774477
3578
- copy.RestoreBigData(hashtable);
4478
+ copy.RestoreBigData(Grafreed.grafreed.universe.versiontable);
35794479
35804480 CameraPane.SWITCH = temp;
35814481
4482
+ RefreshSelection();
35824483 //assert(hashtable.isEmpty());
35834484
35844485 copy.Touch();
....@@ -3599,56 +4500,161 @@
35994500 }
36004501 }
36014502
3602
- refreshContents();
4503
+ refreshContents(true);
36034504 }
36044505
3605
- cButton undoButton;
3606
- cButton redoButton;
4506
+ cButton previousVersionButton;
4507
+ cButton restoreButton;
4508
+ cButton replaceButton;
4509
+ cButton nextVersionButton;
4510
+ cButton saveVersionButton;
4511
+ cButton deleteVersionButton;
36074512
3608
- void SetUndoStates()
4513
+ boolean muteSlider;
4514
+
4515
+ int VersionCount()
36094516 {
3610
- cRadio tab = GetCurrentTab();
4517
+ int count = 0;
36114518
3612
- undoButton.setEnabled(tab.undoindex > 0);
3613
- redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null);
4519
+ for (int i = copy.versionlist.length; --i >= 0;)
4520
+ {
4521
+ if (copy.versionlist[i] != null)
4522
+ count++;
4523
+ }
4524
+
4525
+ return count;
36144526 }
36154527
3616
- public void Undo()
4528
+ public cGridBag versionSliderPane;
4529
+
4530
+ void SetVersionStates()
36174531 {
4532
+ //if (true)
4533
+ // return;
4534
+
4535
+ //cRadio tab = GetCurrentTab();
4536
+
4537
+ if (copy.versionlist == null)
4538
+ {
4539
+ saveVersionButton.setEnabled(false);
4540
+ restoreButton.setEnabled(false);
4541
+ replaceButton.setEnabled(false);
4542
+ previousVersionButton.setEnabled(false);
4543
+ nextVersionButton.setEnabled(false);
4544
+ deleteVersionButton.setEnabled(false);
4545
+ versionSliderPane.setVisible(false);
4546
+ }
4547
+ else
4548
+ {
4549
+ restoreButton.setEnabled(copy.versionindex != -1);
4550
+ replaceButton.setEnabled(copy.versionindex != -1);
4551
+
4552
+ previousVersionButton.setEnabled(copy.versionindex > 0);
4553
+ nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4554
+
4555
+ deleteVersionButton.setEnabled(copy.versionindex != -1);
4556
+ //copy.versionlist[copy.versionindex + 1] != null);
4557
+
4558
+ muteSlider = true;
4559
+ versionSlider.setMinimum(0);
4560
+ versionSlider.setMaximum(VersionCount() - 1);
4561
+ versionSlider.setInteger(copy.versionindex);
4562
+ versionSlider.setEnabled(copy.versionindex != -1);
4563
+ muteSlider = false;
4564
+
4565
+ versionSliderPane.setVisible(true);
4566
+ }
4567
+ }
4568
+
4569
+ public boolean PreviousVersion()
4570
+ {
4571
+ // Option?
4572
+ Replace();
4573
+
36184574 System.err.println("Undo");
36194575
3620
- cRadio tab = GetCurrentTab();
4576
+ //cRadio tab = GetCurrentTab();
36214577
3622
- if (tab.undoindex == 0)
4578
+ if (copy.versionindex == 0)
36234579 {
36244580 java.awt.Toolkit.getDefaultToolkit().beep();
3625
- return;
4581
+ return false;
36264582 }
36274583
3628
- if (tab.graphs[tab.undoindex] == null)
3629
- {
3630
- Save();
3631
- tab.undoindex -= 1;
3632
- }
4584
+// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex])
4585
+// {
4586
+// if (Save(false))
4587
+// tab.versionindex -= 1;
4588
+// else
4589
+// {
4590
+// if (tab.versionindex <= 0)
4591
+// return false;
4592
+// else
4593
+// tab.versionindex -= 1;
4594
+// }
4595
+// }
36334596
3634
- tab.undoindex -= 1;
4597
+ copy.versionindex -= 1;
36354598
3636
- CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
4599
+ CopyChanged();
4600
+
4601
+ return true;
36374602 }
36384603
3639
- public void Redo()
4604
+ public boolean Restore()
36404605 {
3641
- cRadio tab = GetCurrentTab();
4606
+ System.err.println("Restore");
36424607
3643
- if (tab.graphs[tab.undoindex + 1] == null)
4608
+ //cRadio tab = GetCurrentTab();
4609
+
4610
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4611
+ {
4612
+ java.awt.Toolkit.getDefaultToolkit().beep();
4613
+ return false;
4614
+ }
4615
+
4616
+ //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4617
+ CopyChanged();
4618
+
4619
+ return true;
4620
+ }
4621
+
4622
+ public boolean Replace()
4623
+ {
4624
+ //System.err.println("Replace");
4625
+
4626
+ //cRadio tab = GetCurrentTab();
4627
+
4628
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4629
+ {
4630
+ // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
4631
+ return false;
4632
+ }
4633
+
4634
+ copy.versionlist[copy.versionindex] = Duplicate(copy);
4635
+
4636
+ return true;
4637
+ }
4638
+
4639
+ public void NextVersion()
4640
+ {
4641
+ // Option?
4642
+ Replace();
4643
+
4644
+ //cRadio tab = GetCurrentTab();
4645
+
4646
+ if (copy.versionlist[copy.versionindex + 1] == null)
36444647 {
36454648 java.awt.Toolkit.getDefaultToolkit().beep();
36464649 return;
36474650 }
36484651
3649
- tab.undoindex += 1;
4652
+ copy.versionindex += 1;
36504653
3651
- CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
4654
+ CopyChanged();
4655
+
4656
+ //if (!tab.user[tab.versionindex])
4657
+ // tab.graphs[tab.versionindex] = null;
36524658 }
36534659
36544660 void ImportGFD()
....@@ -3842,6 +4848,12 @@
38424848 // else
38434849 // applySelf(true);
38444850 // }
4851
+
4852
+ boolean Equal(double a, double b)
4853
+ {
4854
+ return Math.abs(a - b) < 0.001;
4855
+ }
4856
+
38454857 void applySelf0(boolean name)
38464858 {
38474859 if (name)
....@@ -3859,7 +4871,7 @@
38594871 //copy.material = new cMaterial(copy.GetMaterial());
38604872
38614873 current.color = (float) colorField.getFloat();
3862
- current.modulation = (float) modulationField.getFloat();
4874
+ current.modulation = (float) saturationField.getFloat();
38634875 current.metalness = (float) metalnessField.getFloat();
38644876 current.diffuse = (float) diffuseField.getFloat();
38654877 current.specular = (float) specularField.getFloat();
....@@ -3891,29 +4903,52 @@
38914903 {
38924904 cMaterial mat = copy.material;
38934905
3894
- colorField.SetToolTipValue((mat.color));
3895
- modulationField.SetToolTipValue((mat.modulation));
3896
- metalnessField.SetToolTipValue((mat.metalness));
3897
- diffuseField.SetToolTipValue((mat.diffuse));
3898
- specularField.SetToolTipValue((mat.specular));
3899
- shininessField.SetToolTipValue((mat.shininess));
3900
- shiftField.SetToolTipValue((mat.shift));
3901
- ambientField.SetToolTipValue((mat.ambient));
3902
- lightareaField.SetToolTipValue((mat.lightarea));
3903
- diffusenessField.SetToolTipValue((mat.factor));
3904
- velvetField.SetToolTipValue((mat.velvet));
3905
- sheenField.SetToolTipValue((mat.sheen));
3906
- subsurfaceField.SetToolTipValue((mat.subsurface));
3907
- backlitField.SetToolTipValue((mat.bump));
3908
- anisoField.SetToolTipValue((mat.aniso));
3909
- anisoVField.SetToolTipValue((mat.anisoV));
3910
- cameraField.SetToolTipValue((mat.cameralight));
3911
- selfshadowField.SetToolTipValue((mat.diffuseness));
3912
- shadowField.SetToolTipValue((mat.shadow));
3913
- textureField.SetToolTipValue((mat.texture));
3914
- opacityField.SetToolTipValue((mat.opacity));
3915
- fakedepthField.SetToolTipValue((mat.fakedepth));
3916
- shadowbiasField.SetToolTipValue((mat.shadowbias));
4906
+ if (!Equal(colorField.getFloat(), mat.color))
4907
+ colorField.SetToolTipValue((mat.color));
4908
+ if (!Equal(saturationField.getFloat(), mat.modulation))
4909
+ saturationField.SetToolTipValue((mat.modulation));
4910
+ if (!Equal(metalnessField.getFloat(), mat.metalness))
4911
+ metalnessField.SetToolTipValue((mat.metalness));
4912
+ if (!Equal(diffuseField.getFloat(), mat.diffuse))
4913
+ diffuseField.SetToolTipValue((mat.diffuse));
4914
+ if (!Equal(specularField.getFloat(), mat.specular))
4915
+ specularField.SetToolTipValue((mat.specular));
4916
+ if (!Equal(shininessField.getFloat(), mat.shininess))
4917
+ shininessField.SetToolTipValue((mat.shininess));
4918
+ if (!Equal(shiftField.getFloat(), mat.shift))
4919
+ shiftField.SetToolTipValue((mat.shift));
4920
+ if (!Equal(ambientField.getFloat(), mat.ambient))
4921
+ ambientField.SetToolTipValue((mat.ambient));
4922
+ if (!Equal(lightareaField.getFloat(), mat.lightarea))
4923
+ lightareaField.SetToolTipValue((mat.lightarea));
4924
+ if (!Equal(diffusenessField.getFloat(), mat.factor))
4925
+ diffusenessField.SetToolTipValue((mat.factor));
4926
+ if (!Equal(velvetField.getFloat(), mat.velvet))
4927
+ velvetField.SetToolTipValue((mat.velvet));
4928
+ if (!Equal(sheenField.getFloat(), mat.sheen))
4929
+ sheenField.SetToolTipValue((mat.sheen));
4930
+ if (!Equal(subsurfaceField.getFloat(), mat.subsurface))
4931
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4932
+ if (!Equal(backlitField.getFloat(), mat.bump))
4933
+ backlitField.SetToolTipValue((mat.bump));
4934
+ if (!Equal(anisoField.getFloat(), mat.aniso))
4935
+ anisoField.SetToolTipValue((mat.aniso));
4936
+ if (!Equal(anisoVField.getFloat(), mat.anisoV))
4937
+ anisoVField.SetToolTipValue((mat.anisoV));
4938
+ if (!Equal(cameraField.getFloat(), mat.cameralight))
4939
+ cameraField.SetToolTipValue((mat.cameralight));
4940
+ if (!Equal(selfshadowField.getFloat(), mat.diffuseness))
4941
+ selfshadowField.SetToolTipValue((mat.diffuseness));
4942
+ if (!Equal(shadowField.getFloat(), mat.shadow))
4943
+ shadowField.SetToolTipValue((mat.shadow));
4944
+ if (!Equal(textureField.getFloat(), mat.texture))
4945
+ textureField.SetToolTipValue((mat.texture));
4946
+ if (!Equal(opacityField.getFloat(), mat.opacity))
4947
+ opacityField.SetToolTipValue((mat.opacity));
4948
+ if (!Equal(fakedepthField.getFloat(), mat.fakedepth))
4949
+ fakedepthField.SetToolTipValue((mat.fakedepth));
4950
+ if (!Equal(shadowbiasField.getFloat(), mat.shadowbias))
4951
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
39174952 }
39184953
39194954 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
....@@ -3944,9 +4979,28 @@
39444979 //copy.Touch();
39454980 }
39464981
4982
+ cNumberSlider versionSlider;
4983
+
39474984 public void stateChanged(ChangeEvent e)
39484985 {
3949
- // assert(false);
4986
+ // assert(false);
4987
+ if (e.getSource() == versionSlider)
4988
+ {
4989
+ if (muteSlider)
4990
+ return;
4991
+
4992
+ Replace();
4993
+
4994
+ int version = versionSlider.getInteger();
4995
+
4996
+ if (version != -1 && copy.versionlist[version] != null)
4997
+ {
4998
+ copy.versionindex = version;
4999
+ CopyChanged();
5000
+ }
5001
+
5002
+ return;
5003
+ }
39505004
39515005 if (freezematerial)
39525006 {
....@@ -3982,6 +5036,12 @@
39825036 {
39835037 //System.out.println("stateChanged = " + this);
39845038 materialtouched = true;
5039
+
5040
+ if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001)
5041
+ {
5042
+ saturationField.setFloat(1);
5043
+ }
5044
+
39855045 applySelf();
39865046 //System.out.println("this = " + this);
39875047 //System.out.println("PARENT = " + parent);
....@@ -4281,6 +5341,7 @@
42815341 {
42825342 if (GetTree() != null)
42835343 {
5344
+ GetTree().revalidate();
42845345 GetTree().repaint();
42855346 }
42865347
....@@ -4289,13 +5350,18 @@
42895350 ctrlPanel.validate(); // ? new
42905351 ctrlPanel.repaint();
42915352 }
5353
+
5354
+ if (previousVersionButton != null && copy.versionlist != null)
5355
+ SetVersionStates();
5356
+
5357
+ cameraView.requestFocusInWindow();
42925358 }
42935359
42945360 static TweenManager tweenManager = new TweenManager();
42955361
42965362 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
42975363 {
4298
- if (Globals.SAVEONMAKE) // && resetmodel)
5364
+ if (Globals.REPLACEONMAKE) // && resetmodel)
42995365 Save();
43005366 //Tween.set(thing, 0).target(1).start(tweenManager);
43015367 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
....@@ -4320,7 +5386,7 @@
43205386 // group = (Composite) group.get(0);
43215387 // }
43225388
4323
- System.out.println("makeSomething of " + thing);
5389
+ //System.out.println("makeSomething of " + thing);
43245390
43255391 /*
43265392 if (deselect && jList != null)
....@@ -4537,7 +5603,9 @@
45375603 readobj.ResetDisplayList();
45385604 } catch (Exception e)
45395605 {
4540
- //e.printStackTrace();
5606
+ if (!e.toString().contains("GZIP"))
5607
+ e.printStackTrace();
5608
+
45415609 try
45425610 {
45435611 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
....@@ -4611,12 +5679,14 @@
46115679
46125680 if (readobj != null)
46135681 {
4614
- if (Globals.SAVEONMAKE)
4615
- Save();
5682
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
5683
+ // Save();
46165684 try
46175685 {
46185686 //readobj.deepCopySelf(copy);
46195687 copy.clear(); // june 2014
5688
+ copy.skyboxname = readobj.skyboxname;
5689
+ copy.skyboxext = readobj.skyboxext;
46205690 for (int i = 0; i < readobj.size(); i++)
46215691 {
46225692 Object3D child = readobj.get(i); // reserve(i);
....@@ -4657,6 +5727,7 @@
46575727 }
46585728 } catch (ClassCastException e)
46595729 {
5730
+ e.printStackTrace();
46605731 assert (false);
46615732 Composite c = (Composite) copy;
46625733 c.children.clear();
....@@ -4667,17 +5738,32 @@
46675738 c.addChild(csg);
46685739 }
46695740
5741
+ copy.versionlist = readobj.versionlist;
5742
+ copy.versionindex = readobj.versionindex;
5743
+ copy.versiontable = readobj.versiontable;
5744
+
5745
+ if (copy.versionlist == null)
5746
+ {
5747
+ // Backward compatibility
5748
+ copy.versionlist = new Object3D[100];
5749
+ copy.versionindex = -1;
5750
+
5751
+ //Save(true);
5752
+ }
5753
+
5754
+ //? SetUndoStates();
5755
+
46705756 ResetModel();
46715757 copy.HardTouch(); // recompile?
46725758 refreshContents();
46735759 }
46745760 }
46755761
4676
- void load() // throws ClassNotFoundException
5762
+ void Open() // throws ClassNotFoundException
46775763 {
46785764 if (Grafreed.standAlone)
46795765 {
4680
- FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
5766
+ FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD);
46815767 browser.show();
46825768 String filename = browser.getFile();
46835769 if (filename != null && filename.length() > 0)
....@@ -4754,6 +5840,8 @@
47545840
47555841 void save()
47565842 {
5843
+ Replace();
5844
+
47575845 if (lastname == null)
47585846 {
47595847 return;
....@@ -4776,6 +5864,7 @@
47765864 //ps.print(buffer.toString());
47775865 } catch (IOException e)
47785866 {
5867
+ e.printStackTrace();
47795868 }
47805869 }
47815870
....@@ -4958,7 +6047,7 @@
49586047 MenuBar menuBar;
49596048 Menu fileMenu;
49606049 MenuItem newItem;
4961
- MenuItem loadItem;
6050
+ MenuItem openItem;
49626051 MenuItem saveItem;
49636052 MenuItem saveAsItem;
49646053 MenuItem exportAsItem;
....@@ -4981,6 +6070,7 @@
49816070 CheckboxMenuItem toggleSwitchItem;
49826071 CheckboxMenuItem toggleRootItem;
49836072 CheckboxMenuItem animationItem;
6073
+ MenuItem archiveItem;
49846074 CheckboxMenuItem toggleHandleItem;
49856075 CheckboxMenuItem togglePaintItem;
49866076 JSplitPane mainPanel;
....@@ -4994,6 +6084,7 @@
49946084 ButtonGroup buttonGroup;
49956085
49966086 cGridBag toolboxPanel;
6087
+ cGridBag skyboxPanel;
49976088 cGridBag materialPanel;
49986089 cGridBag ctrlPanel;
49996090
....@@ -5005,6 +6096,7 @@
50056096 boolean materialFlushed;
50066097 Object3D latestObject;
50076098
6099
+ cGridBag transformPanel;
50086100 cGridBag XYZPanel;
50096101
50106102 JSplitPane gridPanel;
....@@ -5067,7 +6159,7 @@
50676159 JLabel colorLabel;
50686160 cNumberSlider colorField;
50696161 JLabel modulationLabel;
5070
- cNumberSlider modulationField;
6162
+ cNumberSlider saturationField;
50716163 JLabel metalnessLabel;
50726164 cNumberSlider metalnessField;
50736165 JLabel diffuseLabel;
....@@ -5098,6 +6190,7 @@
50986190 cNumberSlider anisoField;
50996191 JLabel anisoVLabel;
51006192 cNumberSlider anisoVField;
6193
+
51016194 JLabel cameraLabel;
51026195 cNumberSlider cameraField;
51036196 JLabel selfshadowLabel;
....@@ -5112,6 +6205,7 @@
51126205 cNumberSlider fakedepthField;
51136206 JLabel shadowbiasLabel;
51146207 cNumberSlider shadowbiasField;
6208
+
51156209 JLabel bumpLabel;
51166210 cNumberSlider bumpField;
51176211 JLabel noiseLabel;