Normand Briere
2019-07-01 6600d22461ccc1cb602f238a9ffa83cf07dd830e
ObjEditor.java
....@@ -309,7 +309,7 @@
309309 //localCopy.parent = null;
310310
311311 frame = new JFrame();
312
- frame.setUndecorated(true);
312
+ frame.setUndecorated(false);
313313 objEditor = this;
314314 this.callee = callee;
315315
....@@ -350,7 +350,7 @@
350350 frame.setMenuBar(menuBar = new MenuBar());
351351 menuBar.add(fileMenu = new Menu("File"));
352352 fileMenu.add(newItem = new MenuItem("New"));
353
- fileMenu.add(loadItem = new MenuItem("Open..."));
353
+ fileMenu.add(openItem = new MenuItem("Open..."));
354354
355355 //oe.menuBar.add(menu = new Menu("Include"));
356356 Menu menu = new Menu("Import");
....@@ -382,7 +382,7 @@
382382 }
383383
384384 newItem.addActionListener(this);
385
- loadItem.addActionListener(this);
385
+ openItem.addActionListener(this);
386386 saveItem.addActionListener(this);
387387 saveAsItem.addActionListener(this);
388388 exportAsItem.addActionListener(this);
....@@ -449,7 +449,7 @@
449449 // TEXTAREA infoarea.setLineWrap(true);
450450 // TEXTAREA infoarea.setWrapStyleWord(true);
451451 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
452
- infoPanel.setPreferredSize(new Dimension(50, 200));
452
+ infoPanel.setPreferredSize(new Dimension(1, 1));
453453 infoPanel.setName("Info");
454454 //infoPanel.setLayout(new BorderLayout());
455455 //infoPanel.add(createTextPane());
....@@ -463,10 +463,11 @@
463463 mainPanel.setResizeWeight(0.5);
464464
465465 //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!"));
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!"));
469469
470
+ mainPanel.setUI(new BasicSplitPaneUI());
470471
471472 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
472473 //mainPanel.setLayout(new GridBagLayout());
....@@ -698,8 +699,8 @@
698699 }
699700 }
700701
701
-static GraphicsDevice device = GraphicsEnvironment
702
- .getLocalGraphicsEnvironment().getScreenDevices()[0];
702
+//static GraphicsDevice device = GraphicsEnvironment
703
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
703704
704705 Rectangle keeprect;
705706 cRadio radio;
....@@ -720,10 +721,19 @@
720721 void Minimize()
721722 {
722723 frame.setState(Frame.ICONIFIED);
724
+ frame.validate();
723725 }
724726
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={}
725730 void Maximize()
726731 {
732
+ if (CameraPane.FULLSCREEN)
733
+ {
734
+ ToggleFullScreen();
735
+ }
736
+
727737 if (maximized)
728738 {
729739 frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
....@@ -731,22 +741,36 @@
731741 else
732742 {
733743 keeprect = frame.getBounds();
734
- Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
735
- Dimension rect2 = frame.getToolkit().getScreenSize();
736
- 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);
737747 // frame.setState(Frame.MAXIMIZED_BOTH);
748
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
738749 }
739750
740751 maximized ^= true;
752
+
753
+ frame.validate();
741754 }
755
+
756
+ cButton minButton;
757
+ cButton maxButton;
758
+ cButton fullButton;
742759
743760 void ToggleFullScreen()
744761 {
762
+GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
763
+
745764 cameraView.ToggleFullScreen();
746765
747766 if (!CameraPane.FULLSCREEN)
748767 {
749768 device.setFullScreenWindow(null);
769
+ frame.dispose();
770
+ frame.setUndecorated(false);
771
+ frame.validate();
772
+ frame.setVisible(true);
773
+
750774 //frame.setVisible(false);
751775 // frame.removeNotify();
752776 // frame.setUndecorated(false);
....@@ -756,7 +780,7 @@
756780 // X frame.getContentPane().remove(/*"Center",*/bigThree);
757781 // X framePanel.add(bigThree);
758782 // X frame.getContentPane().add(/*"Center",*/framePanel);
759
- framePanel.setDividerLocation(1);
783
+ framePanel.setDividerLocation(46);
760784
761785 //frame.setVisible(true);
762786 radio.layout = keepButton;
....@@ -771,7 +795,12 @@
771795 // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
772796 // frame.getToolkit().getScreenSize().height);
773797 //frame.setVisible(false);
798
+
799
+ frame.dispose();
800
+ frame.setUndecorated(true);
774801 device.setFullScreenWindow(frame);
802
+ frame.validate();
803
+ frame.setVisible(true);
775804 // frame.removeNotify();
776805 // frame.setUndecorated(true);
777806 // frame.addNotify();
....@@ -784,6 +813,7 @@
784813 radio.layout.doClick();
785814 //frame.setVisible(true);
786815 }
816
+ frame.validate();
787817 }
788818
789819 private JTextPane createTextPane()
....@@ -1116,7 +1146,7 @@
11161146 namePanel = new cGridBag();
11171147
11181148 nameField = AddText(namePanel, copy.GetName());
1119
- namePanel.add(nameField);
1149
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
11201150 oe.ctrlPanel.add(namePanel);
11211151
11221152 oe.ctrlPanel.Return();
....@@ -1141,7 +1171,7 @@
11411171 rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
11421172 rewindCB.setToolTipText("Rewind animation");
11431173
1144
- randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1174
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
11451175 randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
11461176
11471177 if (Globals.ADVANCED)
....@@ -1463,7 +1493,10 @@
14631493 // north.add(ctrlPanel, BorderLayout.NORTH);
14641494 // objectPanel.add(north);
14651495 objectPanel.add(editPanel);
1466
- objectPanel.add(infoPanel);
1496
+
1497
+ //if (Globals.ADVANCED)
1498
+ objectPanel.add(infoPanel);
1499
+
14671500 objectPanel.add(toolboxPanel);
14681501
14691502 /*
....@@ -1572,9 +1605,9 @@
15721605 // aConstraints.gridheight = 1;
15731606
15741607 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1575
- framePanel.setContinuousLayout(true);
1576
- framePanel.setOneTouchExpandable(true);
1577
- framePanel.setDividerLocation(0.8);
1608
+ framePanel.setContinuousLayout(false);
1609
+ framePanel.setOneTouchExpandable(false);
1610
+ //.setDividerLocation(0.8);
15781611 //framePanel.setDividerSize(15);
15791612 //framePanel.setResizeWeight(0.15);
15801613 framePanel.setName("Frame");
....@@ -1593,12 +1626,13 @@
15931626
15941627 frame.setSize(1280, 860);
15951628
1596
- frame.validate();
1597
- frame.setVisible(true);
1598
-
15991629 cameraView.requestFocusInWindow();
16001630
16011631 gridPanel.setDividerLocation(1.0);
1632
+
1633
+ frame.validate();
1634
+
1635
+ frame.setVisible(true);
16021636
16031637 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
16041638 frame.addWindowListener(new WindowAdapter()
....@@ -1685,24 +1719,6 @@
16851719 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16861720 colorSection.add(texture);
16871721
1688
- cGridBag anisoU = new cGridBag();
1689
- anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1690
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1691
- anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1692
- colorSection.add(anisoU);
1693
-
1694
- cGridBag anisoV = new cGridBag();
1695
- anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1696
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1697
- anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1698
- colorSection.add(anisoV);
1699
-
1700
- cGridBag shadowbias = new cGridBag();
1701
- shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1702
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1703
- shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1704
- colorSection.add(shadowbias);
1705
-
17061722 panel.add(new JSeparator());
17071723
17081724 panel.add(colorSection);
....@@ -1752,6 +1768,12 @@
17521768 fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17531769 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
17541770 diffuseSection.add(fakedepth);
1771
+
1772
+ cGridBag shadowbias = new cGridBag();
1773
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1774
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1775
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1776
+ diffuseSection.add(shadowbias);
17551777
17561778 panel.add(new JSeparator());
17571779
....@@ -1803,6 +1825,18 @@
18031825 // aConstraints.gridy += 1;
18041826 // aConstraints.gridwidth = 1;
18051827
1828
+ cGridBag anisoU = new cGridBag();
1829
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1830
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1831
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1832
+ specularSection.add(anisoU);
1833
+
1834
+ cGridBag anisoV = new cGridBag();
1835
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1836
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1837
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1838
+ specularSection.add(anisoV);
1839
+
18061840
18071841 panel.add(new JSeparator());
18081842
....@@ -1810,35 +1844,35 @@
18101844
18111845 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18121846
1813
- cGridBag globalSection = new cGridBag().setVertical(true);
1847
+ //cGridBag globalSection = new cGridBag().setVertical(true);
18141848
18151849 cGridBag camera = new cGridBag();
18161850 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
18171851 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18181852 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1819
- globalSection.add(camera);
1853
+ colorSection.add(camera);
18201854
18211855 cGridBag ambient = new cGridBag();
18221856 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
18231857 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18241858 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1825
- globalSection.add(ambient);
1859
+ colorSection.add(ambient);
18261860
18271861 cGridBag backlit = new cGridBag();
18281862 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
18291863 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18301864 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1831
- globalSection.add(backlit);
1865
+ colorSection.add(backlit);
18321866
18331867 cGridBag opacity = new cGridBag();
18341868 opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
18351869 opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18361870 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1837
- globalSection.add(opacity);
1871
+ colorSection.add(opacity);
18381872
1839
- panel.add(new JSeparator());
1873
+ //panel.add(new JSeparator());
18401874
1841
- panel.add(globalSection);
1875
+ //panel.add(globalSection);
18421876
18431877 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18441878
....@@ -3360,9 +3394,9 @@
33603394 {
33613395 Close();
33623396 //return true;
3363
- } else if (source == loadItem)
3397
+ } else if (source == openItem)
33643398 {
3365
- load();
3399
+ Open();
33663400 //return true;
33673401 } else if (source == newItem)
33683402 {
....@@ -3387,6 +3421,10 @@
33873421 {
33883422 generatePOV();
33893423 //return true;
3424
+ } else if (event.getSource() == archiveItem)
3425
+ {
3426
+ cTools.Archive(frame);
3427
+ return;
33903428 } else if (source == zBufferItem)
33913429 {
33923430 try
....@@ -3537,8 +3575,10 @@
35373575
35383576 copy.ExtractBigData(hashtable);
35393577
3578
+ byte[] compress = Compress(copy);
3579
+
35403580 //EditorFrame.m_MainFrame.requestFocusInWindow();
3541
- tab.graphs[tab.undoindex++] = Compress(copy);
3581
+ tab.graphs[tab.undoindex++] = compress;
35423582
35433583 copy.RestoreBigData(hashtable);
35443584
....@@ -4687,7 +4727,7 @@
46874727 }
46884728 }
46894729
4690
- void load() // throws ClassNotFoundException
4730
+ void Open() // throws ClassNotFoundException
46914731 {
46924732 if (Grafreed.standAlone)
46934733 {
....@@ -4972,7 +5012,7 @@
49725012 MenuBar menuBar;
49735013 Menu fileMenu;
49745014 MenuItem newItem;
4975
- MenuItem loadItem;
5015
+ MenuItem openItem;
49765016 MenuItem saveItem;
49775017 MenuItem saveAsItem;
49785018 MenuItem exportAsItem;
....@@ -4995,6 +5035,7 @@
49955035 CheckboxMenuItem toggleSwitchItem;
49965036 CheckboxMenuItem toggleRootItem;
49975037 CheckboxMenuItem animationItem;
5038
+ MenuItem archiveItem;
49985039 CheckboxMenuItem toggleHandleItem;
49995040 CheckboxMenuItem togglePaintItem;
50005041 JSplitPane mainPanel;