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());
....@@ -699,8 +699,8 @@
699699 }
700700 }
701701
702
-static GraphicsDevice device = GraphicsEnvironment
703
- .getLocalGraphicsEnvironment().getScreenDevices()[0];
702
+//static GraphicsDevice device = GraphicsEnvironment
703
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
704704
705705 Rectangle keeprect;
706706 cRadio radio;
....@@ -721,10 +721,19 @@
721721 void Minimize()
722722 {
723723 frame.setState(Frame.ICONIFIED);
724
+ frame.validate();
724725 }
725726
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={}
726730 void Maximize()
727731 {
732
+ if (CameraPane.FULLSCREEN)
733
+ {
734
+ ToggleFullScreen();
735
+ }
736
+
728737 if (maximized)
729738 {
730739 frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
....@@ -732,22 +741,36 @@
732741 else
733742 {
734743 keeprect = frame.getBounds();
735
- Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
736
- Dimension rect2 = frame.getToolkit().getScreenSize();
737
- 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);
738747 // frame.setState(Frame.MAXIMIZED_BOTH);
748
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
739749 }
740750
741751 maximized ^= true;
752
+
753
+ frame.validate();
742754 }
755
+
756
+ cButton minButton;
757
+ cButton maxButton;
758
+ cButton fullButton;
743759
744760 void ToggleFullScreen()
745761 {
762
+GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
763
+
746764 cameraView.ToggleFullScreen();
747765
748766 if (!CameraPane.FULLSCREEN)
749767 {
750768 device.setFullScreenWindow(null);
769
+ frame.dispose();
770
+ frame.setUndecorated(false);
771
+ frame.validate();
772
+ frame.setVisible(true);
773
+
751774 //frame.setVisible(false);
752775 // frame.removeNotify();
753776 // frame.setUndecorated(false);
....@@ -757,7 +780,7 @@
757780 // X frame.getContentPane().remove(/*"Center",*/bigThree);
758781 // X framePanel.add(bigThree);
759782 // X frame.getContentPane().add(/*"Center",*/framePanel);
760
- framePanel.setDividerLocation(1);
783
+ framePanel.setDividerLocation(46);
761784
762785 //frame.setVisible(true);
763786 radio.layout = keepButton;
....@@ -772,7 +795,12 @@
772795 // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
773796 // frame.getToolkit().getScreenSize().height);
774797 //frame.setVisible(false);
798
+
799
+ frame.dispose();
800
+ frame.setUndecorated(true);
775801 device.setFullScreenWindow(frame);
802
+ frame.validate();
803
+ frame.setVisible(true);
776804 // frame.removeNotify();
777805 // frame.setUndecorated(true);
778806 // frame.addNotify();
....@@ -785,6 +813,7 @@
785813 radio.layout.doClick();
786814 //frame.setVisible(true);
787815 }
816
+ frame.validate();
788817 }
789818
790819 private JTextPane createTextPane()
....@@ -1117,7 +1146,7 @@
11171146 namePanel = new cGridBag();
11181147
11191148 nameField = AddText(namePanel, copy.GetName());
1120
- namePanel.add(nameField);
1149
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
11211150 oe.ctrlPanel.add(namePanel);
11221151
11231152 oe.ctrlPanel.Return();
....@@ -1142,7 +1171,7 @@
11421171 rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
11431172 rewindCB.setToolTipText("Rewind animation");
11441173
1145
- randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1174
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
11461175 randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
11471176
11481177 if (Globals.ADVANCED)
....@@ -1464,7 +1493,10 @@
14641493 // north.add(ctrlPanel, BorderLayout.NORTH);
14651494 // objectPanel.add(north);
14661495 objectPanel.add(editPanel);
1467
- objectPanel.add(infoPanel);
1496
+
1497
+ //if (Globals.ADVANCED)
1498
+ objectPanel.add(infoPanel);
1499
+
14681500 objectPanel.add(toolboxPanel);
14691501
14701502 /*
....@@ -1573,9 +1605,9 @@
15731605 // aConstraints.gridheight = 1;
15741606
15751607 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1576
- framePanel.setContinuousLayout(true);
1577
- framePanel.setOneTouchExpandable(true);
1578
- framePanel.setDividerLocation(0.8);
1608
+ framePanel.setContinuousLayout(false);
1609
+ framePanel.setOneTouchExpandable(false);
1610
+ //.setDividerLocation(0.8);
15791611 //framePanel.setDividerSize(15);
15801612 //framePanel.setResizeWeight(0.15);
15811613 framePanel.setName("Frame");
....@@ -1594,12 +1626,13 @@
15941626
15951627 frame.setSize(1280, 860);
15961628
1597
- frame.validate();
1598
- frame.setVisible(true);
1599
-
16001629 cameraView.requestFocusInWindow();
16011630
16021631 gridPanel.setDividerLocation(1.0);
1632
+
1633
+ frame.validate();
1634
+
1635
+ frame.setVisible(true);
16031636
16041637 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
16051638 frame.addWindowListener(new WindowAdapter()
....@@ -1686,24 +1719,6 @@
16861719 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16871720 colorSection.add(texture);
16881721
1689
- cGridBag anisoU = new cGridBag();
1690
- anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1691
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1693
- colorSection.add(anisoU);
1694
-
1695
- cGridBag anisoV = new cGridBag();
1696
- anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1697
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
- anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1699
- colorSection.add(anisoV);
1700
-
1701
- cGridBag shadowbias = new cGridBag();
1702
- shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1703
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1704
- shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1705
- colorSection.add(shadowbias);
1706
-
17071722 panel.add(new JSeparator());
17081723
17091724 panel.add(colorSection);
....@@ -1753,6 +1768,12 @@
17531768 fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17541769 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
17551770 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);
17561777
17571778 panel.add(new JSeparator());
17581779
....@@ -1804,6 +1825,18 @@
18041825 // aConstraints.gridy += 1;
18051826 // aConstraints.gridwidth = 1;
18061827
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
+
18071840
18081841 panel.add(new JSeparator());
18091842
....@@ -1811,35 +1844,35 @@
18111844
18121845 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18131846
1814
- cGridBag globalSection = new cGridBag().setVertical(true);
1847
+ //cGridBag globalSection = new cGridBag().setVertical(true);
18151848
18161849 cGridBag camera = new cGridBag();
18171850 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
18181851 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18191852 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1820
- globalSection.add(camera);
1853
+ colorSection.add(camera);
18211854
18221855 cGridBag ambient = new cGridBag();
18231856 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
18241857 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18251858 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1826
- globalSection.add(ambient);
1859
+ colorSection.add(ambient);
18271860
18281861 cGridBag backlit = new cGridBag();
18291862 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
18301863 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18311864 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1832
- globalSection.add(backlit);
1865
+ colorSection.add(backlit);
18331866
18341867 cGridBag opacity = new cGridBag();
18351868 opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
18361869 opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18371870 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1838
- globalSection.add(opacity);
1871
+ colorSection.add(opacity);
18391872
1840
- panel.add(new JSeparator());
1873
+ //panel.add(new JSeparator());
18411874
1842
- panel.add(globalSection);
1875
+ //panel.add(globalSection);
18431876
18441877 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18451878
....@@ -3361,9 +3394,9 @@
33613394 {
33623395 Close();
33633396 //return true;
3364
- } else if (source == loadItem)
3397
+ } else if (source == openItem)
33653398 {
3366
- load();
3399
+ Open();
33673400 //return true;
33683401 } else if (source == newItem)
33693402 {
....@@ -3388,6 +3421,10 @@
33883421 {
33893422 generatePOV();
33903423 //return true;
3424
+ } else if (event.getSource() == archiveItem)
3425
+ {
3426
+ cTools.Archive(frame);
3427
+ return;
33913428 } else if (source == zBufferItem)
33923429 {
33933430 try
....@@ -3538,8 +3575,10 @@
35383575
35393576 copy.ExtractBigData(hashtable);
35403577
3578
+ byte[] compress = Compress(copy);
3579
+
35413580 //EditorFrame.m_MainFrame.requestFocusInWindow();
3542
- tab.graphs[tab.undoindex++] = Compress(copy);
3581
+ tab.graphs[tab.undoindex++] = compress;
35433582
35443583 copy.RestoreBigData(hashtable);
35453584
....@@ -4688,7 +4727,7 @@
46884727 }
46894728 }
46904729
4691
- void load() // throws ClassNotFoundException
4730
+ void Open() // throws ClassNotFoundException
46924731 {
46934732 if (Grafreed.standAlone)
46944733 {
....@@ -4973,7 +5012,7 @@
49735012 MenuBar menuBar;
49745013 Menu fileMenu;
49755014 MenuItem newItem;
4976
- MenuItem loadItem;
5015
+ MenuItem openItem;
49775016 MenuItem saveItem;
49785017 MenuItem saveAsItem;
49795018 MenuItem exportAsItem;
....@@ -4996,6 +5035,7 @@
49965035 CheckboxMenuItem toggleSwitchItem;
49975036 CheckboxMenuItem toggleRootItem;
49985037 CheckboxMenuItem animationItem;
5038
+ MenuItem archiveItem;
49995039 CheckboxMenuItem toggleHandleItem;
50005040 CheckboxMenuItem togglePaintItem;
50015041 JSplitPane mainPanel;