Normand Briere
2019-06-29 a69bb4474a3264a9a7a7f8b8d8154ea771f167c8
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.
....@@ -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));
....@@ -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);
....@@ -729,7 +748,13 @@
729748 }
730749
731750 maximized ^= true;
751
+
752
+ frame.validate();
732753 }
754
+
755
+ cButton minButton;
756
+ cButton maxButton;
757
+ cButton fullButton;
733758
734759 void ToggleFullScreen()
735760 {
....@@ -738,6 +763,8 @@
738763 if (!CameraPane.FULLSCREEN)
739764 {
740765 device.setFullScreenWindow(null);
766
+ frame.validate();
767
+
741768 //frame.setVisible(false);
742769 // frame.removeNotify();
743770 // frame.setUndecorated(false);
....@@ -763,6 +790,7 @@
763790 // frame.getToolkit().getScreenSize().height);
764791 //frame.setVisible(false);
765792 device.setFullScreenWindow(frame);
793
+ frame.validate();
766794 // frame.removeNotify();
767795 // frame.setUndecorated(true);
768796 // frame.addNotify();
....@@ -775,6 +803,7 @@
775803 radio.layout.doClick();
776804 //frame.setVisible(true);
777805 }
806
+ frame.validate();
778807 }
779808
780809 private JTextPane createTextPane()
....@@ -1107,7 +1136,7 @@
11071136 namePanel = new cGridBag();
11081137
11091138 nameField = AddText(namePanel, copy.GetName());
1110
- namePanel.add(nameField);
1139
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
11111140 oe.ctrlPanel.add(namePanel);
11121141
11131142 oe.ctrlPanel.Return();
....@@ -1125,15 +1154,15 @@
11251154 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
11261155 hideCB.setToolTipText("Hide object");
11271156 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1128
- markCB.setToolTipText("Set the animation target transform");
1157
+ markCB.setToolTipText("As animation target transform");
11291158
11301159 setupPanel2 = new cGridBag().setVertical(false);
11311160
11321161 rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
11331162 rewindCB.setToolTipText("Rewind animation");
11341163
1135
- randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1136
- randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1164
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1165
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
11371166
11381167 if (Globals.ADVANCED)
11391168 {
....@@ -1676,24 +1705,6 @@
16761705 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16771706 colorSection.add(texture);
16781707
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
-
16971708 panel.add(new JSeparator());
16981709
16991710 panel.add(colorSection);
....@@ -1743,6 +1754,12 @@
17431754 fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17441755 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
17451756 diffuseSection.add(fakedepth);
1757
+
1758
+ cGridBag shadowbias = new cGridBag();
1759
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1760
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1761
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1762
+ diffuseSection.add(shadowbias);
17461763
17471764 panel.add(new JSeparator());
17481765
....@@ -1794,6 +1811,18 @@
17941811 // aConstraints.gridy += 1;
17951812 // aConstraints.gridwidth = 1;
17961813
1814
+ cGridBag anisoU = new cGridBag();
1815
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1816
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1817
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1818
+ specularSection.add(anisoU);
1819
+
1820
+ cGridBag anisoV = new cGridBag();
1821
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1822
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1823
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1824
+ specularSection.add(anisoV);
1825
+
17971826
17981827 panel.add(new JSeparator());
17991828
....@@ -1801,35 +1830,35 @@
18011830
18021831 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18031832
1804
- cGridBag globalSection = new cGridBag().setVertical(true);
1833
+ //cGridBag globalSection = new cGridBag().setVertical(true);
18051834
18061835 cGridBag camera = new cGridBag();
18071836 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
18081837 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18091838 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1810
- globalSection.add(camera);
1839
+ colorSection.add(camera);
18111840
18121841 cGridBag ambient = new cGridBag();
18131842 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
18141843 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18151844 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1816
- globalSection.add(ambient);
1845
+ colorSection.add(ambient);
18171846
18181847 cGridBag backlit = new cGridBag();
18191848 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
18201849 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18211850 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1822
- globalSection.add(backlit);
1851
+ colorSection.add(backlit);
18231852
18241853 cGridBag opacity = new cGridBag();
18251854 opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
18261855 opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18271856 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1828
- globalSection.add(opacity);
1857
+ colorSection.add(opacity);
18291858
1830
- panel.add(new JSeparator());
1859
+ //panel.add(new JSeparator());
18311860
1832
- panel.add(globalSection);
1861
+ //panel.add(globalSection);
18331862
18341863 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18351864
....@@ -3017,12 +3046,17 @@
30173046 // }
30183047
30193048 /**/
3020
- if (deselect)
3049
+ if (deselect || child == null)
30213050 {
30223051 //group.deselectAll();
30233052 //freeze = true;
30243053 GetTree().clearSelection();
30253054 //freeze = false;
3055
+
3056
+ if (child == null)
3057
+ {
3058
+ return;
3059
+ }
30263060 }
30273061
30283062 //group.addSelectee(child);
....@@ -3523,8 +3557,10 @@
35233557
35243558 copy.ExtractBigData(hashtable);
35253559
3560
+ byte[] compress = Compress(copy);
3561
+
35263562 //EditorFrame.m_MainFrame.requestFocusInWindow();
3527
- tab.graphs[tab.undoindex++] = Compress(copy);
3563
+ tab.graphs[tab.undoindex++] = compress;
35283564
35293565 copy.RestoreBigData(hashtable);
35303566