Normand Briere
2019-08-17 5892f05411c3d4dce2d8a59e0966dc2e1843a971
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
+ static 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(ObjEditor.class.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
....@@ -145,7 +266,7 @@
145266
146267 objEditor.ctrlPanel.remove(namePanel);
147268
148
- if (!GroupEditor.allparams)
269
+ if (!allparams)
149270 return;
150271
151272 // objEditor.ctrlPanel.remove(liveCB);
....@@ -168,7 +289,8 @@
168289 // objEditor.ctrlPanel.remove(remarkButton);
169290
170291 objEditor.ctrlPanel.remove(setupPanel);
171
- objEditor.ctrlPanel.remove(commandsPanel);
292
+ objEditor.ctrlPanel.remove(setupPanel2);
293
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
172294 objEditor.ctrlPanel.remove(pushPanel);
173295 //objEditor.ctrlPanel.remove(fillPanel);
174296
....@@ -216,6 +338,14 @@
216338 client = inClient;
217339 copy = client;
218340
341
+// if (copy.versionlist == null)
342
+// {
343
+// copy.versionlist = new Object3D[100];
344
+// copy.versionindex = -1;
345
+//
346
+// callee.Save(true);
347
+// }
348
+
219349 // "this" is not called: SetupUI2(objEditor);
220350 }
221351
....@@ -229,6 +359,14 @@
229359 client = inClient;
230360 copy = client;
231361
362
+ if (copy.versionlist == null)
363
+ {
364
+ copy.versionlist = new Object3D[100];
365
+ copy.versionindex = -1;
366
+
367
+// Save(true);
368
+ }
369
+
232370 SetupUI2(callee.GetEditor());
233371 }
234372
....@@ -243,13 +381,15 @@
243381 //localCopy.parent = null;
244382
245383 frame = new JFrame();
384
+ frame.setUndecorated(false);
246385 objEditor = this;
247386 this.callee = callee;
248387
249388 //parent = p;
250389
251390 GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
252
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
391
+ if (Globals.DEBUG)
392
+ System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
253393 //gd.setFullScreenWindow(this);
254394 //setResizable(false);
255395 //if (!isDisplayable())
....@@ -260,6 +400,14 @@
260400 copy = localCopy;
261401 copy.editWindow = this;
262402
403
+// if (copy.versionlist == null)
404
+// {
405
+// copy.versionlist = new Object3D[100];
406
+// copy.versionindex = -1;
407
+//
408
+// Save(true);
409
+// }
410
+
263411 SetupMenu();
264412
265413 //SetupName(objEditor); // new
....@@ -273,12 +421,20 @@
273421 return frame.action(event, obj);
274422 }
275423
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
+
276432 void SetupMenu()
277433 {
278434 frame.setMenuBar(menuBar = new MenuBar());
279435 menuBar.add(fileMenu = new Menu("File"));
280436 fileMenu.add(newItem = new MenuItem("New"));
281
- fileMenu.add(loadItem = new MenuItem("Load..."));
437
+ fileMenu.add(openItem = new MenuItem("Open..."));
282438
283439 //oe.menuBar.add(menu = new Menu("Include"));
284440 Menu menu = new Menu("Import");
....@@ -310,7 +466,7 @@
310466 }
311467
312468 newItem.addActionListener(this);
313
- loadItem.addActionListener(this);
469
+ openItem.addActionListener(this);
314470 saveItem.addActionListener(this);
315471 saveAsItem.addActionListener(this);
316472 exportAsItem.addActionListener(this);
....@@ -319,28 +475,102 @@
319475 closeItem.addActionListener(this);
320476
321477 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
+
322536 toolbarPanel = new JPanel();
323537 toolbarPanel.setName("Toolbar");
538
+
324539 treePanel = new cGridBag();
325540 treePanel.setName("Tree");
541
+
542
+ editPanel = new cGridBag().setVertical(true);
543
+ //editPanel.setName("Edit");
544
+
326545 ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
327
- ctrlPanel.setName("Edit");
328
- materialPanel = new cGridBag().setVertical(true);
329
- 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
+
330559 /*JTextPane*/
331560 infoarea = createTextPane();
332561 doc = infoarea.getStyledDocument();
333562
334563 infoarea.setEditable(true);
335564 SetText();
565
+
336566 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
337567 // infoarea.setOpaque(false);
338568 // //infoarea.setForeground(textcolor);
339569 // TEXTAREA infoarea.setLineWrap(true);
340570 // TEXTAREA infoarea.setWrapStyleWord(true);
341571 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
342
- infoPanel.setPreferredSize(new Dimension(50, 200));
343
- infoPanel.setName("Info");
572
+ infoPanel.setPreferredSize(new Dimension(1, 1));
573
+ //infoPanel.setName("Info");
344574 //infoPanel.setLayout(new BorderLayout());
345575 //infoPanel.add(createTextPane());
346576
....@@ -351,7 +581,14 @@
351581 mainPanel.setDividerSize(9);
352582 mainPanel.setDividerLocation(0.5); //1.0);
353583 mainPanel.setResizeWeight(0.5);
354
-
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
+
355592 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
356593 //mainPanel.setLayout(new GridBagLayout());
357594 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
....@@ -419,10 +656,10 @@
419656 e.printStackTrace();
420657 }
421658
422
- String selection = infoarea.getText();
423
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
424
- java.awt.datatransfer.Clipboard clipboard =
425
- 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();
426663 //clipboard.setContents(data, data);
427664 }
428665
....@@ -582,21 +819,164 @@
582819 }
583820 }
584821
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
+
585883 void ToggleFullScreen()
586884 {
587
- if (CameraPane.FULLSCREEN)
885
+ GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
886
+
887
+ cameraView.ToggleFullScreen();
888
+
889
+ if (!CameraPane.FULLSCREEN)
588890 {
589
- frame.getContentPane().remove(/*"Center",*/bigThree);
590
- framePanel.add(bigThree);
591
- 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
+
592914 } else
593915 {
594
- frame.getContentPane().remove(/*"Center",*/framePanel);
595
- framePanel.remove(bigThree);
596
- 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);
597938 }
598
- cameraView.ToggleFullScreen();
939
+ frame.validate();
940
+
941
+ cameraView.requestFocusInWindow();
599942 }
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
+ }
600980
601981 private JTextPane createTextPane()
602982 {
....@@ -719,6 +1099,7 @@
7191099 {
7201100 SetupMaterial(materialPanel);
7211101 }
1102
+
7221103 //SetupName();
7231104 //SetupViews();
7241105 }
....@@ -728,7 +1109,7 @@
7281109 // NumberSlider vDivsField;
7291110 // JCheckBox endcaps;
7301111 JCheckBox liveCB;
731
- JCheckBox selectCB;
1112
+ JCheckBox selectableCB;
7321113 JCheckBox hideCB;
7331114 JCheckBox link2masterCB;
7341115 JCheckBox markCB;
....@@ -736,7 +1117,12 @@
7361117 JCheckBox speedupCB;
7371118 JCheckBox rewindCB;
7381119 JCheckBox flipVCB;
1120
+
1121
+ cCheckBox toggleTextureCB;
1122
+ cCheckBox toggleSwitchCB;
1123
+
7391124 JComboBox texresMenu;
1125
+
7401126 JButton resetButton;
7411127 JButton stepButton;
7421128 JButton stepAllButton;
....@@ -745,9 +1131,13 @@
7451131 JButton fasterButton;
7461132 JButton remarkButton;
7471133
1134
+ cGridBag editPanel;
1135
+ cGridBag editCommandsPanel;
1136
+
7481137 cGridBag namePanel;
7491138 cGridBag setupPanel;
750
- cGridBag commandsPanel;
1139
+ cGridBag setupPanel2;
1140
+ cGridBag objectCommandsPanel;
7511141 cGridBag pushPanel;
7521142 cGridBag fillPanel;
7531143
....@@ -918,61 +1308,81 @@
9181308
9191309 namePanel = new cGridBag();
9201310
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
+
9211323 nameField = AddText(namePanel, copy.GetName());
922
- namePanel.add(nameField);
1324
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
9231325 oe.ctrlPanel.add(namePanel);
9241326
9251327 oe.ctrlPanel.Return();
9261328
927
- if (!GroupEditor.allparams)
1329
+ if (!allparams)
9281330 return;
9291331
9301332 setupPanel = new cGridBag().setVertical(false);
9311333
9321334 liveCB = AddCheckBox(setupPanel, "Live", copy.live);
9331335 liveCB.setToolTipText("Animate object");
934
- selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
935
- selectCB.setToolTipText("Make object selectable");
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");
9361340 // Return();
1341
+
9371342 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
9381343 hideCB.setToolTipText("Hide object");
939
- markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
940
- markCB.setToolTipText("Set the animation target transform");
9411344
942
- rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
1345
+ ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
1346
+
1347
+ setupPanel2 = new cGridBag().setVertical(false);
1348
+
1349
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
9431350 rewindCB.setToolTipText("Rewind animation");
9441351
945
- randomCB = AddCheckBox(setupPanel, "Random", copy.random);
946
- randomCB.setToolTipText("Option for switch node");
1352
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1353
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
9471354
1355
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1356
+ link2masterCB.setToolTipText("Attach to support");
1357
+
9481358 if (Globals.ADVANCED)
9491359 {
950
- link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
951
- link2masterCB.setToolTipText("Attach to support");
952
- speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
1360
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
9531361 speedupCB.setToolTipText("Option motion capture");
9541362 }
9551363
9561364 oe.ctrlPanel.add(setupPanel);
9571365 oe.ctrlPanel.Return();
1366
+ oe.ctrlPanel.add(setupPanel2);
1367
+ oe.ctrlPanel.Return();
9581368
959
- commandsPanel = new cGridBag().setVertical(false);
1369
+ objectCommandsPanel = new cGridBag().setVertical(false);
9601370
961
- resetButton = AddButton(commandsPanel, "Reset");
1371
+ resetButton = AddButton(objectCommandsPanel, "Reset");
9621372 resetButton.setToolTipText("Jump to frame zero");
963
- stepButton = AddButton(commandsPanel, "Step");
1373
+ stepButton = AddButton(objectCommandsPanel, "Step");
9641374 stepButton.setToolTipText("Step one frame");
9651375 // resetAllButton = AddButton(oe, "Reset All");
9661376 // stepAllButton = AddButton(oe, "Step All");
9671377 // Return();
968
- slowerButton = AddButton(commandsPanel, "Slow");
1378
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
9691379 slowerButton.setToolTipText("Decrease animation speed");
970
- fasterButton = AddButton(commandsPanel, "Fast");
1380
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
9711381 fasterButton.setToolTipText("Increase animation speed");
972
- remarkButton = AddButton(commandsPanel, "Remark");
1382
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
9731383 remarkButton.setToolTipText("Set the current transform as the target");
9741384
975
- oe.ctrlPanel.add(commandsPanel);
1385
+ oe.ctrlPanel.add(objectCommandsPanel);
9761386 oe.ctrlPanel.Return();
9771387
9781388 pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
....@@ -1132,6 +1542,7 @@
11321542
11331543 if (cam == null || !(copy.get(0) instanceof cGroup))
11341544 {
1545
+ if (Globals.DEBUG)
11351546 System.out.println("CREATE CAMERAS");
11361547 cams = new cTemplate();
11371548 cams.name = "Cameras";
....@@ -1178,8 +1589,11 @@
11781589 //worldPanel.setName("World");
11791590 centralPanel = new cGridBag();
11801591 centralPanel.preferredWidth = 20;
1181
- timelinePanel = new JPanel(new BorderLayout());
1182
- 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);
11831597
11841598 cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
11851599 cameraPanel.setContinuousLayout(true);
....@@ -1188,7 +1602,10 @@
11881602 // cameraPanel.setDividerSize(9);
11891603 cameraPanel.setResizeWeight(1.0);
11901604
1605
+ }
1606
+
11911607 centralPanel.add(cameraView);
1608
+ centralPanel.setFocusable(true);
11921609 //frame.setJMenuBar(timelineMenubar);
11931610 //centralPanel.add(timelinePanel);
11941611
....@@ -1214,6 +1631,7 @@
12141631 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
12151632 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
12161633 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1634
+ //XYZPanel.setName("XYZ");
12171635
12181636 /*
12191637 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1250,14 +1668,34 @@
12501668
12511669 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12521670 //tmp.setName("Edit");
1671
+ objectPanel.add(toolboxPanel);
1672
+ objectPanel.setIconAt(0, GetIcon("icons/primitives.png"));
1673
+ objectPanel.setToolTipTextAt(0, "Objects & textures");
1674
+
12531675 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
+
12541683 // JPanel north = new JPanel(new BorderLayout());
12551684 // north.setName("Edit");
12561685 // north.add(ctrlPanel, BorderLayout.NORTH);
12571686 // objectPanel.add(north);
1258
- objectPanel.add(ctrlPanel);
1259
- objectPanel.add(infoPanel);
1260
-
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
+
12611699 /*
12621700 aConstraints.gridx = 0;
12631701 aConstraints.gridwidth = 1;
....@@ -1265,7 +1703,7 @@
12651703 aConstraints.gridy += 1;
12661704 aConstraints.gridwidth = 1;
12671705 mainPanel.add(objectPanel, aConstraints);
1268
- */
1706
+ */
12691707
12701708 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12711709 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1282,9 +1720,7 @@
12821720 JTabbedPane tabbedPane = new JTabbedPane();
12831721 tabbedPane.add(scrollpane);
12841722
1285
- tabbedPane.add(FSPane = new cFileSystemPane(this));
1286
-
1287
- optionsPanel = new cGridBag().setVertical(true);
1723
+ optionsPanel = new cGridBag().setVertical(false);
12881724
12891725 optionsPanel.setName("Options");
12901726
....@@ -1292,8 +1728,15 @@
12921728
12931729 tabbedPane.add(optionsPanel);
12941730
1731
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
1732
+
12951733 scenePanel.add(tabbedPane);
12961734
1735
+ //if (Globals.ADVANCED)
1736
+// tabbedPane.add(infoPanel);
1737
+// tabbedPane.setIconAt(3, GetIcon("icons/info.png"));
1738
+// tabbedPane.setToolTipTextAt(3, "Information");
1739
+
12971740 /*
12981741 cTree jTree = new cTree(null);
12991742 ToolTipManager.sharedInstance().registerComponent(jTree);
....@@ -1355,7 +1798,7 @@
13551798 bigThree = new cGridBag();
13561799 bigThree.addComponent(scenePanel);
13571800 bigThree.addComponent(centralPanel);
1358
- bigThree.addComponent(XYZPanel);
1801
+ //bigThree.addComponent(XYZPanel);
13591802
13601803 // // SIDE EFFECT!!!
13611804 // aConstraints.gridx = 0;
....@@ -1364,16 +1807,33 @@
13641807 // aConstraints.gridheight = 1;
13651808
13661809 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1367
- framePanel.setContinuousLayout(true);
1368
- framePanel.setOneTouchExpandable(true);
1369
- 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);
13701830 //framePanel.setDividerSize(15);
13711831 //framePanel.setResizeWeight(0.15);
13721832 framePanel.setName("Frame");
13731833
13741834 frame.getContentPane().setLayout(new BorderLayout());
13751835 /**/
1376
- JTabbedPane worldPane = new JTabbedPane();
1836
+ //JTabbedPane worldPane = new JTabbedPane();
13771837 //worldPane.add(bigPanel);
13781838 //worldPane.add(worldPanel);
13791839 /**/
....@@ -1384,14 +1844,18 @@
13841844 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13851845
13861846 frame.setSize(1280, 860);
1387
- frame.setVisible(true);
1388
-
1847
+
1848
+ cameraView.requestFocusInWindow();
1849
+
13891850 gridPanel.setDividerLocation(1.0);
1851
+
1852
+ frame.validate();
1853
+
1854
+ frame.setVisible(true);
13901855
13911856 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
13921857 frame.addWindowListener(new WindowAdapter()
13931858 {
1394
-
13951859 public void windowClosing(WindowEvent e)
13961860 {
13971861 Close();
....@@ -1414,12 +1878,426 @@
14141878 ctrlPanel.removeAll();
14151879 }
14161880
1417
- void SetupMaterial(cGridBag panel)
1881
+ void SetupMaterial(cGridBag materialpanel)
14181882 {
1419
- /*
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
+ /*
14202298 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
14212299 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1422
- */
2300
+ */
14232301
14242302 cGridBag editBar = new cGridBag().setVertical(false);
14252303
....@@ -1453,45 +2331,61 @@
14532331 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14542332
14552333 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);
14562358
14572359 cGridBag color = new cGridBag();
1458
- color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1459
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1460
- 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
+
14612365 //colorField.preferredWidth = 200;
14622366 colorSection.add(color);
14632367
14642368 cGridBag modulation = new cGridBag();
14652369 modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
14662370 modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1467
- modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2371
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
14682372 colorSection.add(modulation);
14692373
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
+
14702382 cGridBag texture = new cGridBag();
14712383 texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
14722384 textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
14732385 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
14742386 colorSection.add(texture);
14752387
1476
- cGridBag anisoU = new cGridBag();
1477
- anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1478
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1479
- anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1480
- colorSection.add(anisoU);
1481
-
1482
- cGridBag anisoV = new cGridBag();
1483
- anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1484
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1485
- anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1486
- colorSection.add(anisoV);
1487
-
1488
- cGridBag shadowbias = new cGridBag();
1489
- shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1490
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1491
- shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1492
- colorSection.add(shadowbias);
1493
-
1494
- panel.add(new JSeparator());
2388
+ panel.add(GetSeparator());
14952389
14962390 panel.add(colorSection);
14972391
....@@ -1541,7 +2435,13 @@
15412435 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
15422436 diffuseSection.add(fakedepth);
15432437
1544
- 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());
15452445
15462446 panel.add(diffuseSection);
15472447
....@@ -1591,42 +2491,48 @@
15912491 // aConstraints.gridy += 1;
15922492 // aConstraints.gridwidth = 1;
15932493
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);
15942499
1595
- 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());
15962508
15972509 panel.add(specularSection);
15982510
15992511 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16002512
1601
- cGridBag globalSection = new cGridBag().setVertical(true);
2513
+ //cGridBag globalSection = new cGridBag().setVertical(true);
16022514
16032515 cGridBag camera = new cGridBag();
16042516 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
16052517 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16062518 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1607
- globalSection.add(camera);
2519
+ colorSection.add(camera);
16082520
16092521 cGridBag ambient = new cGridBag();
16102522 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
16112523 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16122524 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1613
- globalSection.add(ambient);
2525
+ colorSection.add(ambient);
16142526
16152527 cGridBag backlit = new cGridBag();
16162528 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
16172529 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16182530 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1619
- globalSection.add(backlit);
2531
+ colorSection.add(backlit);
16202532
1621
- cGridBag opacity = new cGridBag();
1622
- opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1623
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1624
- opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1625
- globalSection.add(opacity);
1626
-
1627
- panel.add(new JSeparator());
2533
+ //panel.add(new JSeparator());
16282534
1629
- panel.add(globalSection);
2535
+ //panel.add(globalSection);
16302536
16312537 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
16322538
....@@ -1668,7 +2574,7 @@
16682574 opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
16692575 textureSection.add(opacityPower);
16702576
1671
- panel.add(new JSeparator());
2577
+ panel.add(GetSeparator());
16722578
16732579 panel.add(textureSection);
16742580
....@@ -1733,8 +2639,9 @@
17332639 // 3D models
17342640 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
17352641 {
1736
- lastConverter = new com.jmex.model.converters.MaxToJme();
1737
- LoadFile(filename, lastConverter);
2642
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2643
+ //LoadFile(filename, lastConverter);
2644
+ LoadObjFile(filename); // New 3ds loader
17382645 continue;
17392646 }
17402647 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -2072,19 +2979,19 @@
20722979
20732980 void LoadObjFile(String fullname)
20742981 {
2075
- /*
2982
+ System.out.println("Loading " + fullname);
2983
+ /**/
20762984 //lastFilename = fullname;
20772985 if(loadObjThread == null)
20782986 {
2079
- loadObjThread = new LoadOBJThread();
2080
- loadObjThread.start();
2987
+ loadObjThread = new LoadOBJThread();
2988
+ loadObjThread.start();
20812989 }
20822990
20832991 loadObjThread.add(fullname);
2084
- */
2992
+ /**/
20852993
2086
- System.out.println("Loading " + fullname);
2087
- makeSomething(new FileObject(fullname, true), true);
2994
+ //makeSomething(new FileObject(fullname, true), true);
20882995 }
20892996
20902997 void LoadGFDFile(String fullname)
....@@ -2460,6 +3367,7 @@
24603367 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
24613368 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
24623369 }
3370
+
24633371 //cJME.count++;
24643372 //cJME.count %= 12;
24653373 if (gc)
....@@ -2643,6 +3551,7 @@
26433551 }
26443552 }
26453553 }
3554
+
26463555 cFileSystemPane FSPane;
26473556
26483557 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2652,7 +3561,7 @@
26523561
26533562 freezematerial = true;
26543563 colorField.setFloat(mat.color);
2655
- modulationField.setFloat(mat.modulation);
3564
+ saturationField.setFloat(mat.modulation);
26563565 metalnessField.setFloat(mat.metalness);
26573566 diffuseField.setFloat(mat.diffuse);
26583567 specularField.setFloat(mat.specular);
....@@ -2696,11 +3605,14 @@
26963605 }
26973606 }
26983607 }
3608
+
26993609 freezematerial = false;
27003610 }
27013611
27023612 void SetMaterial(Object3D object)
27033613 {
3614
+ latestObject = object;
3615
+
27043616 cMaterial mat = object.material;
27053617
27063618 if (mat == null)
....@@ -2711,32 +3623,8 @@
27113623
27123624 if (multiplyToggle != null)
27133625 multiplyToggle.setSelected(mat.multiply);
2714
-
2715
- assert (object.projectedVertices != null);
2716
-
2717
- if (object.projectedVertices.length <= 2)
2718
- {
2719
- // Side effect...
2720
- Object3D.cVector2[] keep = object.projectedVertices;
2721
- object.projectedVertices = new Object3D.cVector2[3];
2722
- for (int i = 0; i < 3; i++)
2723
- {
2724
- if (i < keep.length)
2725
- {
2726
- object.projectedVertices[i] = keep[i];
2727
- } else
2728
- {
2729
- object.projectedVertices[i] = new Object3D.cVector2();
2730
- }
2731
- /*
2732
- if(keep.length == 0)
2733
- object.projectedVertices[0] = new Object3D.cVector2();
2734
- else
2735
- object.projectedVertices[0] = keep[0];
2736
- object.projectedVertices[1] = new Object3D.cVector2();
2737
- */
2738
- }
2739
- }
3626
+
3627
+ AllocProjectedVertices(object);
27403628
27413629 SetMaterial(mat, object.projectedVertices);
27423630 }
....@@ -2812,12 +3700,17 @@
28123700 // }
28133701
28143702 /**/
2815
- if (deselect)
3703
+ if (deselect || child == null)
28163704 {
28173705 //group.deselectAll();
28183706 //freeze = true;
28193707 GetTree().clearSelection();
28203708 //freeze = false;
3709
+
3710
+ if (child == null)
3711
+ {
3712
+ return;
3713
+ }
28213714 }
28223715
28233716 //group.addSelectee(child);
....@@ -2851,6 +3744,17 @@
28513744 public void itemStateChanged(ItemEvent event)
28523745 {
28533746 // 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
28543758 if (event.getSource() == propagateToggle)
28553759 {
28563760 propagate ^= true;
....@@ -2886,7 +3790,7 @@
28863790 cameraView.ToggleDL();
28873791 cameraView.repaint();
28883792 return;
2889
- } else if (event.getSource() == toggleTextureItem)
3793
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
28903794 {
28913795 cameraView.ToggleTexture();
28923796 // june 2013 copy.HardTouch();
....@@ -2925,7 +3829,7 @@
29253829 frame.validate();
29263830
29273831 return;
2928
- } else if (event.getSource() == toggleSwitchItem)
3832
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29293833 {
29303834 cameraView.ToggleSwitch();
29313835 cameraView.repaint();
....@@ -2955,8 +3859,9 @@
29553859 } else if (event.getSource() == liveCB)
29563860 {
29573861 copy.live ^= true;
3862
+ objEditor.refreshContents(true); // To show item colors
29583863 return;
2959
- } else if (event.getSource() == selectCB)
3864
+ } else if (event.getSource() == selectableCB)
29603865 {
29613866 copy.dontselect ^= true;
29623867 return;
....@@ -2964,7 +3869,7 @@
29643869 {
29653870 copy.hide ^= true;
29663871 copy.Touch(); // display list issue
2967
- objEditor.refreshContents();
3872
+ objEditor.refreshContents(true); // To show item colors
29683873 return;
29693874 } else if (event.getSource() == link2masterCB)
29703875 {
....@@ -3029,7 +3934,7 @@
30293934 //System.out.println("ObjEditor " + event);
30303935 applySelf0(true);
30313936 //parent.applySelf();
3032
- objEditor.refreshContents();
3937
+ // conflicts with requestFocus objEditor.refreshContents();
30333938 } else if (source == resetButton)
30343939 {
30353940 CameraPane.fullreset = true;
....@@ -3141,9 +4046,9 @@
31414046 {
31424047 Close();
31434048 //return true;
3144
- } else if (source == loadItem)
4049
+ } else if (source == openItem)
31454050 {
3146
- load();
4051
+ Open();
31474052 //return true;
31484053 } else if (source == newItem)
31494054 {
....@@ -3168,6 +4073,10 @@
31684073 {
31694074 generatePOV();
31704075 //return true;
4076
+ } else if (event.getSource() == archiveItem)
4077
+ {
4078
+ cTools.Archive(frame);
4079
+ return;
31714080 } else if (source == zBufferItem)
31724081 {
31734082 try
....@@ -3214,22 +4123,32 @@
32144123 objEditor.refreshContents();
32154124 }
32164125
3217
- static public byte[] Compress(Object o)
4126
+ static public byte[] Compress(Object3D o)
32184127 {
4128
+ // Slower to actually compress.
32194129 try
32204130 {
32214131 ByteArrayOutputStream baos = new ByteArrayOutputStream();
3222
- java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3223
- ObjectOutputStream out = new ObjectOutputStream(zstream);
4132
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
4133
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
32244134
4135
+ Object3D parent = o.parent;
4136
+ o.parent = null;
4137
+
32254138 out.writeObject(o);
32264139
4140
+ o.parent = parent;
4141
+
32274142 out.flush();
32284143
3229
- zstream.close();
4144
+ baos //zstream
4145
+ .close();
32304146 out.close();
32314147
3232
- return baos.toByteArray();
4148
+ byte[] bytes = baos.toByteArray();
4149
+
4150
+ System.out.println("save #bytes = " + bytes.length);
4151
+ return bytes;
32334152 } catch (Exception e)
32344153 {
32354154 System.err.println(e);
....@@ -3239,13 +4158,16 @@
32394158
32404159 static public Object Uncompress(byte[] bytes)
32414160 {
3242
- System.out.println("#bytes = " + bytes.length);
4161
+ System.out.println("restore #bytes = " + bytes.length);
32434162 try
32444163 {
32454164 ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3246
- java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3247
- ObjectInputStream in = new ObjectInputStream(istream);
4165
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
4166
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
32484167 Object obj = in.readObject();
4168
+
4169
+ bais //istream
4170
+ .close();
32494171 in.close();
32504172
32514173 return obj;
....@@ -3300,37 +4222,97 @@
33004222 return null;
33014223 }
33024224
3303
- java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>();
33044225
33054226 public void Save()
33064227 {
3307
- cRadio tab = GetCurrentTab();
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
+ }
33084239
3309
- boolean temp = CameraPane.SWITCH;
3310
- CameraPane.SWITCH = false;
4240
+ for (int i=compress.length; --i>=0;)
4241
+ {
4242
+ if (compress[i] != name[i])
4243
+ return false;
4244
+ }
33114245
3312
- copy.ExtractBigData(hashtable);
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
+// }
33134280
33144281 //EditorFrame.m_MainFrame.requestFocusInWindow();
3315
- tab.graphs[tab.undoindex++] = Compress(copy);
3316
-
3317
- copy.RestoreBigData(hashtable);
3318
-
3319
- CameraPane.SWITCH = temp;
3320
-
3321
- //assert(hashtable.isEmpty());
3322
-
3323
- for (int i = tab.undoindex; i < tab.graphs.length; i++)
4282
+ if (!thesame)
33244283 {
3325
- tab.graphs[i] = null;
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++;
33264296 }
33274297
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
+
33284310 // test save
33294311 if (false)
33304312 {
33314313 try
33324314 {
3333
- FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
4315
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
33344316 ObjectOutputStream p = new ObjectOutputStream(ostream);
33354317
33364318 p.writeObject(copy);
....@@ -3343,26 +4325,68 @@
33434325 e.printStackTrace();
33444326 }
33454327 }
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);
33464362 }
33474363
3348
- void CopyChanged(Object3D obj)
4364
+ void CopyChanged()
33494365 {
4366
+ Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]);
4367
+
4368
+ SetVersionStates();
4369
+
33504370 boolean temp = CameraPane.SWITCH;
33514371 CameraPane.SWITCH = false;
33524372
3353
- copy.ExtractBigData(hashtable);
4373
+ copy.ExtractBigData(Grafreed.grafreed.universe.versiontable);
33544374
33554375 copy.clear();
33564376
4377
+ copy.skyboxname = obj.skyboxname;
4378
+ copy.skyboxext = obj.skyboxext;
4379
+
33574380 for (int i=0; i<obj.Size(); i++)
33584381 {
33594382 copy.add(obj.get(i));
33604383 }
33614384
3362
- copy.RestoreBigData(hashtable);
4385
+ copy.RestoreBigData(Grafreed.grafreed.universe.versiontable);
33634386
33644387 CameraPane.SWITCH = temp;
33654388
4389
+ RefreshSelection();
33664390 //assert(hashtable.isEmpty());
33674391
33684392 copy.Touch();
....@@ -3383,43 +4407,144 @@
33834407 }
33844408 }
33854409
3386
- refreshContents();
4410
+ refreshContents(true);
33874411 }
33884412
3389
- public void Undo()
3390
- {
3391
- cRadio tab = GetCurrentTab();
4413
+ cButton previousVersionButton;
4414
+ cButton restoreButton;
4415
+ cButton replaceButton;
4416
+ cButton nextVersionButton;
4417
+ cButton saveVersionButton;
4418
+ cButton deleteVersionButton;
33924419
3393
- if (tab.undoindex == 0)
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)
33944469 {
33954470 java.awt.Toolkit.getDefaultToolkit().beep();
3396
- return;
4471
+ return false;
33974472 }
33984473
3399
- if (tab.graphs[tab.undoindex] == null)
3400
- {
3401
- Save();
3402
- tab.undoindex -= 1;
3403
- }
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
+// }
34044486
3405
- tab.undoindex -= 1;
4487
+ copy.versionindex -= 1;
34064488
3407
- CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
4489
+ CopyChanged();
4490
+
4491
+ return true;
34084492 }
34094493
3410
- public void Redo()
4494
+ public boolean Restore()
34114495 {
3412
- cRadio tab = GetCurrentTab();
4496
+ System.err.println("Restore");
34134497
3414
- if (tab.graphs[tab.undoindex + 1] == null)
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)
34154537 {
34164538 java.awt.Toolkit.getDefaultToolkit().beep();
34174539 return;
34184540 }
34194541
3420
- tab.undoindex += 1;
4542
+ copy.versionindex += 1;
34214543
3422
- CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
4544
+ CopyChanged();
4545
+
4546
+ //if (!tab.user[tab.versionindex])
4547
+ // tab.graphs[tab.versionindex] = null;
34234548 }
34244549
34254550 void ImportGFD()
....@@ -3571,7 +4696,7 @@
35714696 assert false;
35724697 }
35734698
3574
- void EditSelection()
4699
+ void EditSelection(boolean newWindow)
35754700 {
35764701 }
35774702
....@@ -3613,6 +4738,12 @@
36134738 // else
36144739 // applySelf(true);
36154740 // }
4741
+
4742
+ boolean Equal(double a, double b)
4743
+ {
4744
+ return Math.abs(a - b) < 0.001;
4745
+ }
4746
+
36164747 void applySelf0(boolean name)
36174748 {
36184749 if (name)
....@@ -3630,7 +4761,7 @@
36304761 //copy.material = new cMaterial(copy.GetMaterial());
36314762
36324763 current.color = (float) colorField.getFloat();
3633
- current.modulation = (float) modulationField.getFloat();
4764
+ current.modulation = (float) saturationField.getFloat();
36344765 current.metalness = (float) metalnessField.getFloat();
36354766 current.diffuse = (float) diffuseField.getFloat();
36364767 current.specular = (float) specularField.getFloat();
....@@ -3662,29 +4793,52 @@
36624793 {
36634794 cMaterial mat = copy.material;
36644795
3665
- colorField.SetToolTipValue((mat.color));
3666
- modulationField.SetToolTipValue((mat.modulation));
3667
- metalnessField.SetToolTipValue((mat.metalness));
3668
- diffuseField.SetToolTipValue((mat.diffuse));
3669
- specularField.SetToolTipValue((mat.specular));
3670
- shininessField.SetToolTipValue((mat.shininess));
3671
- shiftField.SetToolTipValue((mat.shift));
3672
- ambientField.SetToolTipValue((mat.ambient));
3673
- lightareaField.SetToolTipValue((mat.lightarea));
3674
- diffusenessField.SetToolTipValue((mat.factor));
3675
- velvetField.SetToolTipValue((mat.velvet));
3676
- sheenField.SetToolTipValue((mat.sheen));
3677
- subsurfaceField.SetToolTipValue((mat.subsurface));
3678
- backlitField.SetToolTipValue((mat.bump));
3679
- anisoField.SetToolTipValue((mat.aniso));
3680
- anisoVField.SetToolTipValue((mat.anisoV));
3681
- cameraField.SetToolTipValue((mat.cameralight));
3682
- selfshadowField.SetToolTipValue((mat.diffuseness));
3683
- shadowField.SetToolTipValue((mat.shadow));
3684
- textureField.SetToolTipValue((mat.texture));
3685
- opacityField.SetToolTipValue((mat.opacity));
3686
- fakedepthField.SetToolTipValue((mat.fakedepth));
3687
- shadowbiasField.SetToolTipValue((mat.shadowbias));
4796
+ if (!Equal(colorField.getFloat(), mat.color))
4797
+ colorField.SetToolTipValue((mat.color));
4798
+ if (!Equal(saturationField.getFloat(), mat.modulation))
4799
+ saturationField.SetToolTipValue((mat.modulation));
4800
+ if (!Equal(metalnessField.getFloat(), mat.metalness))
4801
+ metalnessField.SetToolTipValue((mat.metalness));
4802
+ if (!Equal(diffuseField.getFloat(), mat.diffuse))
4803
+ diffuseField.SetToolTipValue((mat.diffuse));
4804
+ if (!Equal(specularField.getFloat(), mat.specular))
4805
+ specularField.SetToolTipValue((mat.specular));
4806
+ if (!Equal(shininessField.getFloat(), mat.shininess))
4807
+ shininessField.SetToolTipValue((mat.shininess));
4808
+ if (!Equal(shiftField.getFloat(), mat.shift))
4809
+ shiftField.SetToolTipValue((mat.shift));
4810
+ if (!Equal(ambientField.getFloat(), mat.ambient))
4811
+ ambientField.SetToolTipValue((mat.ambient));
4812
+ if (!Equal(lightareaField.getFloat(), mat.lightarea))
4813
+ lightareaField.SetToolTipValue((mat.lightarea));
4814
+ if (!Equal(diffusenessField.getFloat(), mat.factor))
4815
+ diffusenessField.SetToolTipValue((mat.factor));
4816
+ if (!Equal(velvetField.getFloat(), mat.velvet))
4817
+ velvetField.SetToolTipValue((mat.velvet));
4818
+ if (!Equal(sheenField.getFloat(), mat.sheen))
4819
+ sheenField.SetToolTipValue((mat.sheen));
4820
+ if (!Equal(subsurfaceField.getFloat(), mat.subsurface))
4821
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4822
+ if (!Equal(backlitField.getFloat(), mat.bump))
4823
+ backlitField.SetToolTipValue((mat.bump));
4824
+ if (!Equal(anisoField.getFloat(), mat.aniso))
4825
+ anisoField.SetToolTipValue((mat.aniso));
4826
+ if (!Equal(anisoVField.getFloat(), mat.anisoV))
4827
+ anisoVField.SetToolTipValue((mat.anisoV));
4828
+ if (!Equal(cameraField.getFloat(), mat.cameralight))
4829
+ cameraField.SetToolTipValue((mat.cameralight));
4830
+ if (!Equal(selfshadowField.getFloat(), mat.diffuseness))
4831
+ selfshadowField.SetToolTipValue((mat.diffuseness));
4832
+ if (!Equal(shadowField.getFloat(), mat.shadow))
4833
+ shadowField.SetToolTipValue((mat.shadow));
4834
+ if (!Equal(textureField.getFloat(), mat.texture))
4835
+ textureField.SetToolTipValue((mat.texture));
4836
+ if (!Equal(opacityField.getFloat(), mat.opacity))
4837
+ opacityField.SetToolTipValue((mat.opacity));
4838
+ if (!Equal(fakedepthField.getFloat(), mat.fakedepth))
4839
+ fakedepthField.SetToolTipValue((mat.fakedepth));
4840
+ if (!Equal(shadowbiasField.getFloat(), mat.shadowbias))
4841
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
36884842 }
36894843
36904844 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
....@@ -3715,9 +4869,28 @@
37154869 //copy.Touch();
37164870 }
37174871
4872
+ cNumberSlider versionSlider;
4873
+
37184874 public void stateChanged(ChangeEvent e)
37194875 {
37204876 // assert(false);
4877
+ if (e.getSource() == versionSlider)
4878
+ {
4879
+ if (muteSlider)
4880
+ return;
4881
+
4882
+ Replace();
4883
+
4884
+ int version = versionSlider.getInteger();
4885
+
4886
+ if (version != -1 && copy.versionlist[version] != null)
4887
+ {
4888
+ copy.versionindex = version;
4889
+ CopyChanged();
4890
+ }
4891
+
4892
+ return;
4893
+ }
37214894
37224895 if (freezematerial)
37234896 {
....@@ -3753,6 +4926,12 @@
37534926 {
37544927 //System.out.println("stateChanged = " + this);
37554928 materialtouched = true;
4929
+
4930
+ if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001)
4931
+ {
4932
+ saturationField.setFloat(1);
4933
+ }
4934
+
37564935 applySelf();
37574936 //System.out.println("this = " + this);
37584937 //System.out.println("PARENT = " + parent);
....@@ -4052,6 +5231,7 @@
40525231 {
40535232 if (GetTree() != null)
40545233 {
5234
+ GetTree().revalidate();
40555235 GetTree().repaint();
40565236 }
40575237
....@@ -4060,13 +5240,19 @@
40605240 ctrlPanel.validate(); // ? new
40615241 ctrlPanel.repaint();
40625242 }
5243
+
5244
+ if (previousVersionButton != null && copy.versionlist != null)
5245
+ SetVersionStates();
5246
+
5247
+ cameraView.requestFocusInWindow();
40635248 }
40645249
40655250 static TweenManager tweenManager = new TweenManager();
40665251
40675252 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
40685253 {
4069
- Save();
5254
+ if (Globals.REPLACEONMAKE) // && resetmodel)
5255
+ Save();
40705256 //Tween.set(thing, 0).target(1).start(tweenManager);
40715257 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
40725258 // if (thing instanceof GenericJointDemo)
....@@ -4090,7 +5276,7 @@
40905276 // group = (Composite) group.get(0);
40915277 // }
40925278
4093
- System.out.println("makeSomething of " + thing);
5279
+ //System.out.println("makeSomething of " + thing);
40945280
40955281 /*
40965282 if (deselect && jList != null)
....@@ -4153,6 +5339,12 @@
41535339 {
41545340 ResetModel();
41555341 Select(thing.GetTreePath(), true, false); // unselect... false);
5342
+
5343
+ if (thing.Size() == 0)
5344
+ {
5345
+ //EditSelection(false);
5346
+ }
5347
+
41565348 refreshContents();
41575349 }
41585350
....@@ -4290,6 +5482,7 @@
42905482
42915483 try
42925484 {
5485
+ // Try compressed version first.
42935486 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
42945487 java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
42955488 java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
....@@ -4300,7 +5493,9 @@
43005493 readobj.ResetDisplayList();
43015494 } catch (Exception e)
43025495 {
4303
- //e.printStackTrace();
5496
+ if (!e.toString().contains("GZIP"))
5497
+ e.printStackTrace();
5498
+
43045499 try
43055500 {
43065501 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
....@@ -4359,6 +5554,12 @@
43595554
43605555 void LoadIt(Object obj)
43615556 {
5557
+ if (obj == null)
5558
+ {
5559
+ // Invalid file
5560
+ return;
5561
+ }
5562
+
43625563 System.out.println("Loaded " + obj);
43635564 //new Exception().printStackTrace();
43645565 Object3D readobj = (Object3D) obj;
....@@ -4368,11 +5569,14 @@
43685569
43695570 if (readobj != null)
43705571 {
4371
- Save();
5572
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
5573
+ // Save();
43725574 try
43735575 {
43745576 //readobj.deepCopySelf(copy);
43755577 copy.clear(); // june 2014
5578
+ copy.skyboxname = readobj.skyboxname;
5579
+ copy.skyboxext = readobj.skyboxext;
43765580 for (int i = 0; i < readobj.size(); i++)
43775581 {
43785582 Object3D child = readobj.get(i); // reserve(i);
....@@ -4413,6 +5617,7 @@
44135617 }
44145618 } catch (ClassCastException e)
44155619 {
5620
+ e.printStackTrace();
44165621 assert (false);
44175622 Composite c = (Composite) copy;
44185623 c.children.clear();
....@@ -4423,17 +5628,32 @@
44235628 c.addChild(csg);
44245629 }
44255630
5631
+ copy.versionlist = readobj.versionlist;
5632
+ copy.versionindex = readobj.versionindex;
5633
+ copy.versiontable = readobj.versiontable;
5634
+
5635
+ if (copy.versionlist == null)
5636
+ {
5637
+ // Backward compatibility
5638
+ copy.versionlist = new Object3D[100];
5639
+ copy.versionindex = -1;
5640
+
5641
+ //Save(true);
5642
+ }
5643
+
5644
+ //? SetUndoStates();
5645
+
44265646 ResetModel();
44275647 copy.HardTouch(); // recompile?
44285648 refreshContents();
44295649 }
44305650 }
44315651
4432
- void load() // throws ClassNotFoundException
5652
+ void Open() // throws ClassNotFoundException
44335653 {
44345654 if (Grafreed.standAlone)
44355655 {
4436
- FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
5656
+ FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD);
44375657 browser.show();
44385658 String filename = browser.getFile();
44395659 if (filename != null && filename.length() > 0)
....@@ -4510,6 +5730,8 @@
45105730
45115731 void save()
45125732 {
5733
+ Replace();
5734
+
45135735 if (lastname == null)
45145736 {
45155737 return;
....@@ -4532,6 +5754,7 @@
45325754 //ps.print(buffer.toString());
45335755 } catch (IOException e)
45345756 {
5757
+ e.printStackTrace();
45355758 }
45365759 }
45375760
....@@ -4546,6 +5769,8 @@
45465769 String filename = browser.getFile();
45475770 if (filename != null && filename.length() > 0)
45485771 {
5772
+ if (!filename.endsWith(".gfd"))
5773
+ filename += ".gfd";
45495774 lastname = browser.getDirectory() + filename;
45505775 save();
45515776 }
....@@ -4712,7 +5937,7 @@
47125937 MenuBar menuBar;
47135938 Menu fileMenu;
47145939 MenuItem newItem;
4715
- MenuItem loadItem;
5940
+ MenuItem openItem;
47165941 MenuItem saveItem;
47175942 MenuItem saveAsItem;
47185943 MenuItem exportAsItem;
....@@ -4735,22 +5960,37 @@
47355960 CheckboxMenuItem toggleSwitchItem;
47365961 CheckboxMenuItem toggleRootItem;
47375962 CheckboxMenuItem animationItem;
5963
+ MenuItem archiveItem;
47385964 CheckboxMenuItem toggleHandleItem;
47395965 CheckboxMenuItem togglePaintItem;
47405966 JSplitPane mainPanel;
47415967 JScrollPane scrollpane;
5968
+
47425969 JPanel toolbarPanel;
5970
+
47435971 cGridBag treePanel;
5972
+
47445973 JPanel radioPanel;
47455974 ButtonGroup buttonGroup;
4746
- cGridBag ctrlPanel;
5975
+
5976
+ cGridBag toolboxPanel;
5977
+ cGridBag skyboxPanel;
47475978 cGridBag materialPanel;
5979
+ cGridBag ctrlPanel;
5980
+
47485981 JScrollPane infoPanel;
5982
+
47495983 cGridBag optionsPanel;
5984
+
47505985 JTabbedPane objectPanel;
5986
+ boolean materialFlushed;
5987
+ Object3D latestObject;
5988
+
47515989 cGridBag XYZPanel;
5990
+
47525991 JSplitPane gridPanel;
47535992 JSplitPane bigPanel;
5993
+
47545994 cGridBag bigThree;
47555995 cGridBag scenePanel;
47565996 cGridBag centralPanel;
....@@ -4808,7 +6048,7 @@
48086048 JLabel colorLabel;
48096049 cNumberSlider colorField;
48106050 JLabel modulationLabel;
4811
- cNumberSlider modulationField;
6051
+ cNumberSlider saturationField;
48126052 JLabel metalnessLabel;
48136053 cNumberSlider metalnessField;
48146054 JLabel diffuseLabel;
....@@ -4839,6 +6079,7 @@
48396079 cNumberSlider anisoField;
48406080 JLabel anisoVLabel;
48416081 cNumberSlider anisoVField;
6082
+
48426083 JLabel cameraLabel;
48436084 cNumberSlider cameraField;
48446085 JLabel selfshadowLabel;
....@@ -4853,6 +6094,7 @@
48536094 cNumberSlider fakedepthField;
48546095 JLabel shadowbiasLabel;
48556096 cNumberSlider shadowbiasField;
6097
+
48566098 JLabel bumpLabel;
48576099 cNumberSlider bumpField;
48586100 JLabel noiseLabel;
....@@ -4865,7 +6107,7 @@
48656107 cNumberSlider fogField;
48666108 JLabel opacityPowerLabel;
48676109 cNumberSlider opacityPowerField;
4868
- JTree jTree;
6110
+ cTree jTree;
48696111 //ObjectUI parent;
48706112
48716113 cNumberSlider normalpushField;