Normand Briere
2019-06-30 cfd7a643cb5a445016ddb15595158ecc59b184fd
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.
....@@ -306,7 +309,7 @@
306309 //localCopy.parent = null;
307310
308311 frame = new JFrame();
309
- frame.setUndecorated(true);
312
+ frame.setUndecorated(false);
310313 objEditor = this;
311314 this.callee = callee;
312315
....@@ -446,7 +449,7 @@
446449 // TEXTAREA infoarea.setLineWrap(true);
447450 // TEXTAREA infoarea.setWrapStyleWord(true);
448451 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
449
- infoPanel.setPreferredSize(new Dimension(50, 200));
452
+ //infoPanel.setPreferredSize(new Dimension(50, 200));
450453 infoPanel.setName("Info");
451454 //infoPanel.setLayout(new BorderLayout());
452455 //infoPanel.add(createTextPane());
....@@ -458,7 +461,14 @@
458461 mainPanel.setDividerSize(9);
459462 mainPanel.setDividerLocation(0.5); //1.0);
460463 mainPanel.setResizeWeight(0.5);
461
-
464
+
465
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
466
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
467
+ divider.setDividerSize(15);
468
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
469
+
470
+ mainPanel.setUI(new BasicSplitPaneUI());
471
+
462472 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
463473 //mainPanel.setLayout(new GridBagLayout());
464474 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
....@@ -689,8 +699,8 @@
689699 }
690700 }
691701
692
-static GraphicsDevice device = GraphicsEnvironment
693
- .getLocalGraphicsEnvironment().getScreenDevices()[0];
702
+//static GraphicsDevice device = GraphicsEnvironment
703
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
694704
695705 Rectangle keeprect;
696706 cRadio radio;
....@@ -711,10 +721,19 @@
711721 void Minimize()
712722 {
713723 frame.setState(Frame.ICONIFIED);
724
+ frame.validate();
714725 }
715726
727
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
728
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
729
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
716730 void Maximize()
717731 {
732
+ if (CameraPane.FULLSCREEN)
733
+ {
734
+ ToggleFullScreen();
735
+ }
736
+
718737 if (maximized)
719738 {
720739 frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
....@@ -722,22 +741,36 @@
722741 else
723742 {
724743 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);
744
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
745
+// Dimension rect2 = frame.getToolkit().getScreenSize();
746
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
728747 // frame.setState(Frame.MAXIMIZED_BOTH);
748
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
729749 }
730750
731751 maximized ^= true;
752
+
753
+ frame.validate();
732754 }
755
+
756
+ cButton minButton;
757
+ cButton maxButton;
758
+ cButton fullButton;
733759
734760 void ToggleFullScreen()
735761 {
762
+GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
763
+
736764 cameraView.ToggleFullScreen();
737765
738766 if (!CameraPane.FULLSCREEN)
739767 {
740768 device.setFullScreenWindow(null);
769
+ frame.dispose();
770
+ frame.setUndecorated(false);
771
+ frame.validate();
772
+ frame.setVisible(true);
773
+
741774 //frame.setVisible(false);
742775 // frame.removeNotify();
743776 // frame.setUndecorated(false);
....@@ -762,7 +795,12 @@
762795 // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
763796 // frame.getToolkit().getScreenSize().height);
764797 //frame.setVisible(false);
798
+
799
+ frame.dispose();
800
+ frame.setUndecorated(true);
765801 device.setFullScreenWindow(frame);
802
+ frame.validate();
803
+ frame.setVisible(true);
766804 // frame.removeNotify();
767805 // frame.setUndecorated(true);
768806 // frame.addNotify();
....@@ -775,6 +813,7 @@
775813 radio.layout.doClick();
776814 //frame.setVisible(true);
777815 }
816
+ frame.validate();
778817 }
779818
780819 private JTextPane createTextPane()
....@@ -1107,7 +1146,7 @@
11071146 namePanel = new cGridBag();
11081147
11091148 nameField = AddText(namePanel, copy.GetName());
1110
- namePanel.add(nameField);
1149
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
11111150 oe.ctrlPanel.add(namePanel);
11121151
11131152 oe.ctrlPanel.Return();
....@@ -1125,15 +1164,15 @@
11251164 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
11261165 hideCB.setToolTipText("Hide object");
11271166 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1128
- markCB.setToolTipText("Set the animation target transform");
1167
+ markCB.setToolTipText("As animation target transform");
11291168
11301169 setupPanel2 = new cGridBag().setVertical(false);
11311170
11321171 rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
11331172 rewindCB.setToolTipText("Rewind animation");
11341173
1135
- randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1136
- randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1174
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1175
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
11371176
11381177 if (Globals.ADVANCED)
11391178 {
....@@ -1584,12 +1623,13 @@
15841623
15851624 frame.setSize(1280, 860);
15861625
1587
- frame.validate();
1588
- frame.setVisible(true);
1589
-
15901626 cameraView.requestFocusInWindow();
15911627
15921628 gridPanel.setDividerLocation(1.0);
1629
+
1630
+ frame.validate();
1631
+
1632
+ frame.setVisible(true);
15931633
15941634 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
15951635 frame.addWindowListener(new WindowAdapter()
....@@ -1676,24 +1716,6 @@
16761716 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16771717 colorSection.add(texture);
16781718
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
-
16971719 panel.add(new JSeparator());
16981720
16991721 panel.add(colorSection);
....@@ -1743,6 +1765,12 @@
17431765 fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17441766 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
17451767 diffuseSection.add(fakedepth);
1768
+
1769
+ cGridBag shadowbias = new cGridBag();
1770
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1771
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1772
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1773
+ diffuseSection.add(shadowbias);
17461774
17471775 panel.add(new JSeparator());
17481776
....@@ -1794,6 +1822,18 @@
17941822 // aConstraints.gridy += 1;
17951823 // aConstraints.gridwidth = 1;
17961824
1825
+ cGridBag anisoU = new cGridBag();
1826
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1827
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1828
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1829
+ specularSection.add(anisoU);
1830
+
1831
+ cGridBag anisoV = new cGridBag();
1832
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1833
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1834
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1835
+ specularSection.add(anisoV);
1836
+
17971837
17981838 panel.add(new JSeparator());
17991839
....@@ -1801,35 +1841,35 @@
18011841
18021842 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18031843
1804
- cGridBag globalSection = new cGridBag().setVertical(true);
1844
+ //cGridBag globalSection = new cGridBag().setVertical(true);
18051845
18061846 cGridBag camera = new cGridBag();
18071847 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
18081848 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18091849 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1810
- globalSection.add(camera);
1850
+ colorSection.add(camera);
18111851
18121852 cGridBag ambient = new cGridBag();
18131853 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
18141854 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18151855 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1816
- globalSection.add(ambient);
1856
+ colorSection.add(ambient);
18171857
18181858 cGridBag backlit = new cGridBag();
18191859 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
18201860 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18211861 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1822
- globalSection.add(backlit);
1862
+ colorSection.add(backlit);
18231863
18241864 cGridBag opacity = new cGridBag();
18251865 opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
18261866 opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18271867 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1828
- globalSection.add(opacity);
1868
+ colorSection.add(opacity);
18291869
1830
- panel.add(new JSeparator());
1870
+ //panel.add(new JSeparator());
18311871
1832
- panel.add(globalSection);
1872
+ //panel.add(globalSection);
18331873
18341874 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18351875
....@@ -3017,12 +3057,17 @@
30173057 // }
30183058
30193059 /**/
3020
- if (deselect)
3060
+ if (deselect || child == null)
30213061 {
30223062 //group.deselectAll();
30233063 //freeze = true;
30243064 GetTree().clearSelection();
30253065 //freeze = false;
3066
+
3067
+ if (child == null)
3068
+ {
3069
+ return;
3070
+ }
30263071 }
30273072
30283073 //group.addSelectee(child);
....@@ -3523,8 +3568,10 @@
35233568
35243569 copy.ExtractBigData(hashtable);
35253570
3571
+ byte[] compress = Compress(copy);
3572
+
35263573 //EditorFrame.m_MainFrame.requestFocusInWindow();
3527
- tab.graphs[tab.undoindex++] = Compress(copy);
3574
+ tab.graphs[tab.undoindex++] = compress;
35283575
35293576 copy.RestoreBigData(hashtable);
35303577