.. | .. |
---|
15 | 15 | //import javax.swing.plaf.ColorUIResource; |
---|
16 | 16 | //import javax.swing.plaf.metal.DefaultMetalTheme; |
---|
17 | 17 | |
---|
| 18 | +import javax.swing.plaf.basic.BasicSplitPaneDivider; |
---|
| 19 | +import javax.swing.plaf.basic.BasicSplitPaneUI; |
---|
| 20 | + |
---|
18 | 21 | //import javax.media.opengl.GLCanvas; |
---|
19 | 22 | |
---|
20 | 23 | import //weka.core. |
---|
.. | .. |
---|
49 | 52 | catch (Exception e) |
---|
50 | 53 | { |
---|
51 | 54 | return new cButton(name, border); |
---|
| 55 | + } |
---|
| 56 | + } |
---|
| 57 | + |
---|
| 58 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 59 | + { |
---|
| 60 | + try |
---|
| 61 | + { |
---|
| 62 | + ImageIcon icon = GetIcon(name); |
---|
| 63 | + return new cToggleButton(icon, border); |
---|
| 64 | + } |
---|
| 65 | + catch (Exception e) |
---|
| 66 | + { |
---|
| 67 | + return new cToggleButton(name, border); |
---|
52 | 68 | } |
---|
53 | 69 | } |
---|
54 | 70 | |
---|
.. | .. |
---|
194 | 210 | |
---|
195 | 211 | objEditor.ctrlPanel.remove(namePanel); |
---|
196 | 212 | |
---|
197 | | - if (!GroupEditor.allparams) |
---|
| 213 | + if (!allparams) |
---|
198 | 214 | return; |
---|
199 | 215 | |
---|
200 | 216 | // objEditor.ctrlPanel.remove(liveCB); |
---|
.. | .. |
---|
293 | 309 | //localCopy.parent = null; |
---|
294 | 310 | |
---|
295 | 311 | frame = new JFrame(); |
---|
296 | | - frame.setUndecorated(true); |
---|
| 312 | + frame.setUndecorated(false); |
---|
297 | 313 | objEditor = this; |
---|
298 | 314 | this.callee = callee; |
---|
299 | 315 | |
---|
.. | .. |
---|
323 | 339 | { |
---|
324 | 340 | return frame.action(event, obj); |
---|
325 | 341 | } |
---|
| 342 | + |
---|
| 343 | + // Cannot work without static |
---|
| 344 | + static boolean allparams = true; |
---|
| 345 | + |
---|
| 346 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
326 | 347 | |
---|
327 | 348 | void SetupMenu() |
---|
328 | 349 | { |
---|
.. | .. |
---|
370 | 391 | closeItem.addActionListener(this); |
---|
371 | 392 | |
---|
372 | 393 | objectPanel = new JTabbedPane(); |
---|
| 394 | + |
---|
| 395 | + ChangeListener changeListener = new ChangeListener() |
---|
| 396 | + { |
---|
| 397 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 398 | + { |
---|
| 399 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 400 | +// { |
---|
| 401 | +// if (latestObject != null) |
---|
| 402 | +// { |
---|
| 403 | +// refreshContents(true); |
---|
| 404 | +// SetMaterial(latestObject); |
---|
| 405 | +// } |
---|
| 406 | +// |
---|
| 407 | +// materialFlushed = true; |
---|
| 408 | +// } |
---|
| 409 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 410 | +// { |
---|
| 411 | +// if (listUI.size() == 0) |
---|
| 412 | +// EditSelection(false); |
---|
| 413 | +// } |
---|
| 414 | + |
---|
| 415 | + refreshContents(false); // To refresh Info tab |
---|
| 416 | + } |
---|
| 417 | + }; |
---|
| 418 | + objectPanel.addChangeListener(changeListener); |
---|
| 419 | + |
---|
373 | 420 | toolbarPanel = new JPanel(); |
---|
374 | 421 | toolbarPanel.setName("Toolbar"); |
---|
375 | 422 | treePanel = new cGridBag(); |
---|
.. | .. |
---|
384 | 431 | editPanel.add(editCommandsPanel); |
---|
385 | 432 | editPanel.add(ctrlPanel); |
---|
386 | 433 | |
---|
387 | | - materialPanel = new cGridBag().setVertical(true); |
---|
| 434 | + toolboxPanel = new cGridBag().setVertical(false); |
---|
| 435 | + toolboxPanel.setName("Toolbox"); |
---|
388 | 436 | |
---|
| 437 | + materialPanel = new cGridBag().setVertical(true); |
---|
389 | 438 | materialPanel.setName("Material"); |
---|
| 439 | + |
---|
390 | 440 | /*JTextPane*/ |
---|
391 | 441 | infoarea = createTextPane(); |
---|
392 | 442 | doc = infoarea.getStyledDocument(); |
---|
.. | .. |
---|
399 | 449 | // TEXTAREA infoarea.setLineWrap(true); |
---|
400 | 450 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
401 | 451 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
402 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
| 452 | + //infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
403 | 453 | infoPanel.setName("Info"); |
---|
404 | 454 | //infoPanel.setLayout(new BorderLayout()); |
---|
405 | 455 | //infoPanel.add(createTextPane()); |
---|
.. | .. |
---|
411 | 461 | mainPanel.setDividerSize(9); |
---|
412 | 462 | mainPanel.setDividerLocation(0.5); //1.0); |
---|
413 | 463 | mainPanel.setResizeWeight(0.5); |
---|
414 | | - |
---|
| 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 | + |
---|
415 | 472 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
416 | 473 | //mainPanel.setLayout(new GridBagLayout()); |
---|
417 | 474 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
.. | .. |
---|
642 | 699 | } |
---|
643 | 700 | } |
---|
644 | 701 | |
---|
645 | | -static GraphicsDevice device = GraphicsEnvironment |
---|
646 | | - .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 702 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 703 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
647 | 704 | |
---|
648 | 705 | Rectangle keeprect; |
---|
649 | 706 | cRadio radio; |
---|
.. | .. |
---|
659 | 716 | |
---|
660 | 717 | boolean maximized; |
---|
661 | 718 | |
---|
| 719 | + cButton fullscreenLayout; |
---|
| 720 | + |
---|
662 | 721 | void Minimize() |
---|
663 | 722 | { |
---|
664 | 723 | frame.setState(Frame.ICONIFIED); |
---|
| 724 | + frame.validate(); |
---|
665 | 725 | } |
---|
666 | 726 | |
---|
| 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={} |
---|
667 | 730 | void Maximize() |
---|
668 | 731 | { |
---|
| 732 | + if (CameraPane.FULLSCREEN) |
---|
| 733 | + { |
---|
| 734 | + ToggleFullScreen(); |
---|
| 735 | + } |
---|
| 736 | + |
---|
669 | 737 | if (maximized) |
---|
670 | 738 | { |
---|
671 | 739 | frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
.. | .. |
---|
673 | 741 | else |
---|
674 | 742 | { |
---|
675 | 743 | keeprect = frame.getBounds(); |
---|
676 | | - Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
677 | | - Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
678 | | - 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); |
---|
679 | 747 | // frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 748 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
680 | 749 | } |
---|
681 | 750 | |
---|
682 | 751 | maximized ^= true; |
---|
| 752 | + |
---|
| 753 | + frame.validate(); |
---|
683 | 754 | } |
---|
| 755 | + |
---|
| 756 | + cButton minButton; |
---|
| 757 | + cButton maxButton; |
---|
| 758 | + cButton fullButton; |
---|
684 | 759 | |
---|
685 | 760 | void ToggleFullScreen() |
---|
686 | 761 | { |
---|
687 | | - if (CameraPane.FULLSCREEN) |
---|
| 762 | +GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 763 | + |
---|
| 764 | + cameraView.ToggleFullScreen(); |
---|
| 765 | + |
---|
| 766 | + if (!CameraPane.FULLSCREEN) |
---|
688 | 767 | { |
---|
689 | 768 | device.setFullScreenWindow(null); |
---|
| 769 | + frame.dispose(); |
---|
| 770 | + frame.setUndecorated(false); |
---|
| 771 | + frame.validate(); |
---|
| 772 | + frame.setVisible(true); |
---|
| 773 | + |
---|
690 | 774 | //frame.setVisible(false); |
---|
691 | 775 | // frame.removeNotify(); |
---|
692 | 776 | // frame.setUndecorated(false); |
---|
.. | .. |
---|
711 | 795 | // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
712 | 796 | // frame.getToolkit().getScreenSize().height); |
---|
713 | 797 | //frame.setVisible(false); |
---|
| 798 | + |
---|
| 799 | + frame.dispose(); |
---|
| 800 | + frame.setUndecorated(true); |
---|
714 | 801 | device.setFullScreenWindow(frame); |
---|
| 802 | + frame.validate(); |
---|
| 803 | + frame.setVisible(true); |
---|
715 | 804 | // frame.removeNotify(); |
---|
716 | 805 | // frame.setUndecorated(true); |
---|
717 | 806 | // frame.addNotify(); |
---|
.. | .. |
---|
720 | 809 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
721 | 810 | framePanel.setDividerLocation(0); |
---|
722 | 811 | |
---|
723 | | - radio.layout = twoButton; |
---|
| 812 | + radio.layout = fullscreenLayout; |
---|
724 | 813 | radio.layout.doClick(); |
---|
725 | 814 | //frame.setVisible(true); |
---|
726 | 815 | } |
---|
727 | | - |
---|
728 | | - cameraView.ToggleFullScreen(); |
---|
| 816 | + frame.validate(); |
---|
729 | 817 | } |
---|
730 | 818 | |
---|
731 | 819 | private JTextPane createTextPane() |
---|
.. | .. |
---|
866 | 954 | JCheckBox speedupCB; |
---|
867 | 955 | JCheckBox rewindCB; |
---|
868 | 956 | JCheckBox flipVCB; |
---|
| 957 | + |
---|
| 958 | + cCheckBox toggleTextureCB; |
---|
| 959 | + cCheckBox toggleSwitchCB; |
---|
| 960 | + |
---|
869 | 961 | JComboBox texresMenu; |
---|
| 962 | + |
---|
870 | 963 | JButton resetButton; |
---|
871 | 964 | JButton stepButton; |
---|
872 | 965 | JButton stepAllButton; |
---|
.. | .. |
---|
1053 | 1146 | namePanel = new cGridBag(); |
---|
1054 | 1147 | |
---|
1055 | 1148 | nameField = AddText(namePanel, copy.GetName()); |
---|
1056 | | - namePanel.add(nameField); |
---|
| 1149 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1057 | 1150 | oe.ctrlPanel.add(namePanel); |
---|
1058 | 1151 | |
---|
1059 | 1152 | oe.ctrlPanel.Return(); |
---|
1060 | 1153 | |
---|
1061 | | - if (!GroupEditor.allparams) |
---|
| 1154 | + if (!allparams) |
---|
1062 | 1155 | return; |
---|
1063 | 1156 | |
---|
1064 | 1157 | setupPanel = new cGridBag().setVertical(false); |
---|
.. | .. |
---|
1071 | 1164 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1072 | 1165 | hideCB.setToolTipText("Hide object"); |
---|
1073 | 1166 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1074 | | - markCB.setToolTipText("Set the animation target transform"); |
---|
| 1167 | + markCB.setToolTipText("As animation target transform"); |
---|
1075 | 1168 | |
---|
1076 | 1169 | setupPanel2 = new cGridBag().setVertical(false); |
---|
1077 | 1170 | |
---|
1078 | 1171 | rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
1079 | 1172 | rewindCB.setToolTipText("Rewind animation"); |
---|
1080 | 1173 | |
---|
1081 | | - randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
1082 | | - 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)"); |
---|
1083 | 1176 | |
---|
1084 | 1177 | if (Globals.ADVANCED) |
---|
1085 | 1178 | { |
---|
.. | .. |
---|
1401 | 1494 | // objectPanel.add(north); |
---|
1402 | 1495 | objectPanel.add(editPanel); |
---|
1403 | 1496 | objectPanel.add(infoPanel); |
---|
| 1497 | + objectPanel.add(toolboxPanel); |
---|
1404 | 1498 | |
---|
1405 | 1499 | /* |
---|
1406 | 1500 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1409 | 1503 | aConstraints.gridy += 1; |
---|
1410 | 1504 | aConstraints.gridwidth = 1; |
---|
1411 | 1505 | mainPanel.add(objectPanel, aConstraints); |
---|
1412 | | - */ |
---|
| 1506 | + */ |
---|
1413 | 1507 | |
---|
1414 | 1508 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1415 | 1509 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1426 | 1520 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1427 | 1521 | tabbedPane.add(scrollpane); |
---|
1428 | 1522 | |
---|
1429 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1430 | | - |
---|
1431 | | - optionsPanel = new cGridBag().setVertical(true); |
---|
| 1523 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1432 | 1524 | |
---|
1433 | 1525 | optionsPanel.setName("Options"); |
---|
1434 | 1526 | |
---|
.. | .. |
---|
1436 | 1528 | |
---|
1437 | 1529 | tabbedPane.add(optionsPanel); |
---|
1438 | 1530 | |
---|
| 1531 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1532 | + |
---|
1439 | 1533 | scenePanel.add(tabbedPane); |
---|
1440 | 1534 | |
---|
1441 | 1535 | /* |
---|
.. | .. |
---|
1528 | 1622 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1529 | 1623 | |
---|
1530 | 1624 | frame.setSize(1280, 860); |
---|
1531 | | - frame.setVisible(true); |
---|
1532 | | - |
---|
| 1625 | + |
---|
1533 | 1626 | cameraView.requestFocusInWindow(); |
---|
1534 | 1627 | |
---|
1535 | 1628 | gridPanel.setDividerLocation(1.0); |
---|
| 1629 | + |
---|
| 1630 | + frame.validate(); |
---|
| 1631 | + |
---|
| 1632 | + frame.setVisible(true); |
---|
1536 | 1633 | |
---|
1537 | 1634 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1538 | 1635 | frame.addWindowListener(new WindowAdapter() |
---|
.. | .. |
---|
1619 | 1716 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1620 | 1717 | colorSection.add(texture); |
---|
1621 | 1718 | |
---|
1622 | | - cGridBag anisoU = new cGridBag(); |
---|
1623 | | - anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
1624 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1625 | | - anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1626 | | - colorSection.add(anisoU); |
---|
1627 | | - |
---|
1628 | | - cGridBag anisoV = new cGridBag(); |
---|
1629 | | - anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
1630 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1631 | | - anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1632 | | - colorSection.add(anisoV); |
---|
1633 | | - |
---|
1634 | | - cGridBag shadowbias = new cGridBag(); |
---|
1635 | | - shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
1636 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1637 | | - shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1638 | | - colorSection.add(shadowbias); |
---|
1639 | | - |
---|
1640 | 1719 | panel.add(new JSeparator()); |
---|
1641 | 1720 | |
---|
1642 | 1721 | panel.add(colorSection); |
---|
.. | .. |
---|
1686 | 1765 | fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1687 | 1766 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1688 | 1767 | 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); |
---|
1689 | 1774 | |
---|
1690 | 1775 | panel.add(new JSeparator()); |
---|
1691 | 1776 | |
---|
.. | .. |
---|
1737 | 1822 | // aConstraints.gridy += 1; |
---|
1738 | 1823 | // aConstraints.gridwidth = 1; |
---|
1739 | 1824 | |
---|
| 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 | + |
---|
1740 | 1837 | |
---|
1741 | 1838 | panel.add(new JSeparator()); |
---|
1742 | 1839 | |
---|
.. | .. |
---|
1744 | 1841 | |
---|
1745 | 1842 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1746 | 1843 | |
---|
1747 | | - cGridBag globalSection = new cGridBag().setVertical(true); |
---|
| 1844 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1748 | 1845 | |
---|
1749 | 1846 | cGridBag camera = new cGridBag(); |
---|
1750 | 1847 | camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
1751 | 1848 | cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1752 | 1849 | camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1753 | | - globalSection.add(camera); |
---|
| 1850 | + colorSection.add(camera); |
---|
1754 | 1851 | |
---|
1755 | 1852 | cGridBag ambient = new cGridBag(); |
---|
1756 | 1853 | ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
1757 | 1854 | ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1758 | 1855 | ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1759 | | - globalSection.add(ambient); |
---|
| 1856 | + colorSection.add(ambient); |
---|
1760 | 1857 | |
---|
1761 | 1858 | cGridBag backlit = new cGridBag(); |
---|
1762 | 1859 | backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
1763 | 1860 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1764 | 1861 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1765 | | - globalSection.add(backlit); |
---|
| 1862 | + colorSection.add(backlit); |
---|
1766 | 1863 | |
---|
1767 | 1864 | cGridBag opacity = new cGridBag(); |
---|
1768 | 1865 | opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1769 | 1866 | opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1770 | 1867 | opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1771 | | - globalSection.add(opacity); |
---|
| 1868 | + colorSection.add(opacity); |
---|
1772 | 1869 | |
---|
1773 | | - panel.add(new JSeparator()); |
---|
| 1870 | + //panel.add(new JSeparator()); |
---|
1774 | 1871 | |
---|
1775 | | - panel.add(globalSection); |
---|
| 1872 | + //panel.add(globalSection); |
---|
1776 | 1873 | |
---|
1777 | 1874 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1778 | 1875 | |
---|
.. | .. |
---|
2847 | 2944 | |
---|
2848 | 2945 | void SetMaterial(Object3D object) |
---|
2849 | 2946 | { |
---|
| 2947 | + latestObject = object; |
---|
| 2948 | + |
---|
2850 | 2949 | cMaterial mat = object.material; |
---|
2851 | 2950 | |
---|
2852 | 2951 | if (mat == null) |
---|
.. | .. |
---|
2958 | 3057 | // } |
---|
2959 | 3058 | |
---|
2960 | 3059 | /**/ |
---|
2961 | | - if (deselect) |
---|
| 3060 | + if (deselect || child == null) |
---|
2962 | 3061 | { |
---|
2963 | 3062 | //group.deselectAll(); |
---|
2964 | 3063 | //freeze = true; |
---|
2965 | 3064 | GetTree().clearSelection(); |
---|
2966 | 3065 | //freeze = false; |
---|
| 3066 | + |
---|
| 3067 | + if (child == null) |
---|
| 3068 | + { |
---|
| 3069 | + return; |
---|
| 3070 | + } |
---|
2967 | 3071 | } |
---|
2968 | 3072 | |
---|
2969 | 3073 | //group.addSelectee(child); |
---|
.. | .. |
---|
3032 | 3136 | cameraView.ToggleDL(); |
---|
3033 | 3137 | cameraView.repaint(); |
---|
3034 | 3138 | return; |
---|
3035 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3139 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
3036 | 3140 | { |
---|
3037 | 3141 | cameraView.ToggleTexture(); |
---|
3038 | 3142 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
3071 | 3175 | frame.validate(); |
---|
3072 | 3176 | |
---|
3073 | 3177 | return; |
---|
3074 | | - } else if (event.getSource() == toggleSwitchItem) |
---|
| 3178 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
3075 | 3179 | { |
---|
3076 | 3180 | cameraView.ToggleSwitch(); |
---|
3077 | 3181 | cameraView.repaint(); |
---|
.. | .. |
---|
3464 | 3568 | |
---|
3465 | 3569 | copy.ExtractBigData(hashtable); |
---|
3466 | 3570 | |
---|
| 3571 | + byte[] compress = Compress(copy); |
---|
| 3572 | + |
---|
3467 | 3573 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3468 | | - tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3574 | + tab.graphs[tab.undoindex++] = compress; |
---|
3469 | 3575 | |
---|
3470 | 3576 | copy.RestoreBigData(hashtable); |
---|
3471 | 3577 | |
---|
.. | .. |
---|
3478 | 3584 | tab.graphs[i] = null; |
---|
3479 | 3585 | } |
---|
3480 | 3586 | |
---|
| 3587 | + SetUndoStates(); |
---|
| 3588 | + |
---|
3481 | 3589 | // test save |
---|
3482 | 3590 | if (false) |
---|
3483 | 3591 | { |
---|
.. | .. |
---|
3500 | 3608 | |
---|
3501 | 3609 | void CopyChanged(Object3D obj) |
---|
3502 | 3610 | { |
---|
| 3611 | + SetUndoStates(); |
---|
| 3612 | + |
---|
3503 | 3613 | boolean temp = CameraPane.SWITCH; |
---|
3504 | 3614 | CameraPane.SWITCH = false; |
---|
3505 | 3615 | |
---|
.. | .. |
---|
3537 | 3647 | } |
---|
3538 | 3648 | |
---|
3539 | 3649 | refreshContents(); |
---|
| 3650 | + } |
---|
| 3651 | + |
---|
| 3652 | + cButton undoButton; |
---|
| 3653 | + cButton redoButton; |
---|
| 3654 | + |
---|
| 3655 | + void SetUndoStates() |
---|
| 3656 | + { |
---|
| 3657 | + cRadio tab = GetCurrentTab(); |
---|
| 3658 | + |
---|
| 3659 | + undoButton.setEnabled(tab.undoindex > 0); |
---|
| 3660 | + redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null); |
---|
3540 | 3661 | } |
---|
3541 | 3662 | |
---|
3542 | 3663 | public void Undo() |
---|
.. | .. |
---|
3726 | 3847 | assert false; |
---|
3727 | 3848 | } |
---|
3728 | 3849 | |
---|
3729 | | - void EditSelection() |
---|
| 3850 | + void EditSelection(boolean newWindow) |
---|
3730 | 3851 | { |
---|
3731 | 3852 | } |
---|
3732 | 3853 | |
---|
.. | .. |
---|
4221 | 4342 | |
---|
4222 | 4343 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4223 | 4344 | { |
---|
4224 | | - if (Globals.SAVEONMAKE) |
---|
| 4345 | + if (Globals.SAVEONMAKE) // && resetmodel) |
---|
4225 | 4346 | Save(); |
---|
4226 | 4347 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4227 | 4348 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
.. | .. |
---|
4309 | 4430 | { |
---|
4310 | 4431 | ResetModel(); |
---|
4311 | 4432 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4433 | + |
---|
| 4434 | + if (thing.Size() == 0) |
---|
| 4435 | + { |
---|
| 4436 | + //EditSelection(false); |
---|
| 4437 | + } |
---|
| 4438 | + |
---|
4312 | 4439 | refreshContents(); |
---|
4313 | 4440 | } |
---|
4314 | 4441 | |
---|
.. | .. |
---|
4710 | 4837 | String filename = browser.getFile(); |
---|
4711 | 4838 | if (filename != null && filename.length() > 0) |
---|
4712 | 4839 | { |
---|
| 4840 | + if (!filename.endsWith(".gfd")) |
---|
| 4841 | + filename += ".gfd"; |
---|
4713 | 4842 | lastname = browser.getDirectory() + filename; |
---|
4714 | 4843 | save(); |
---|
4715 | 4844 | } |
---|
.. | .. |
---|
4903 | 5032 | CheckboxMenuItem togglePaintItem; |
---|
4904 | 5033 | JSplitPane mainPanel; |
---|
4905 | 5034 | JScrollPane scrollpane; |
---|
| 5035 | + |
---|
4906 | 5036 | JPanel toolbarPanel; |
---|
| 5037 | + |
---|
4907 | 5038 | cGridBag treePanel; |
---|
| 5039 | + |
---|
4908 | 5040 | JPanel radioPanel; |
---|
4909 | 5041 | ButtonGroup buttonGroup; |
---|
4910 | | - cGridBag ctrlPanel; |
---|
| 5042 | + |
---|
| 5043 | + cGridBag toolboxPanel; |
---|
4911 | 5044 | cGridBag materialPanel; |
---|
| 5045 | + cGridBag ctrlPanel; |
---|
| 5046 | + |
---|
4912 | 5047 | JScrollPane infoPanel; |
---|
| 5048 | + |
---|
4913 | 5049 | cGridBag optionsPanel; |
---|
| 5050 | + |
---|
4914 | 5051 | JTabbedPane objectPanel; |
---|
| 5052 | + boolean materialFlushed; |
---|
| 5053 | + Object3D latestObject; |
---|
| 5054 | + |
---|
4915 | 5055 | cGridBag XYZPanel; |
---|
| 5056 | + |
---|
4916 | 5057 | JSplitPane gridPanel; |
---|
4917 | 5058 | JSplitPane bigPanel; |
---|
| 5059 | + |
---|
4918 | 5060 | cGridBag bigThree; |
---|
4919 | 5061 | cGridBag scenePanel; |
---|
4920 | 5062 | cGridBag centralPanel; |
---|
.. | .. |
---|
5029 | 5171 | cNumberSlider fogField; |
---|
5030 | 5172 | JLabel opacityPowerLabel; |
---|
5031 | 5173 | cNumberSlider opacityPowerField; |
---|
5032 | | - JTree jTree; |
---|
| 5174 | + cTree jTree; |
---|
5033 | 5175 | //ObjectUI parent; |
---|
5034 | 5176 | |
---|
5035 | 5177 | cNumberSlider normalpushField; |
---|