.. | .. |
---|
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. |
---|
.. | .. |
---|
207 | 210 | |
---|
208 | 211 | objEditor.ctrlPanel.remove(namePanel); |
---|
209 | 212 | |
---|
210 | | - if (!GroupEditor.allparams) |
---|
| 213 | + if (!allparams) |
---|
211 | 214 | return; |
---|
212 | 215 | |
---|
213 | 216 | // objEditor.ctrlPanel.remove(liveCB); |
---|
.. | .. |
---|
306 | 309 | //localCopy.parent = null; |
---|
307 | 310 | |
---|
308 | 311 | frame = new JFrame(); |
---|
309 | | - frame.setUndecorated(true); |
---|
| 312 | + frame.setUndecorated(false); |
---|
310 | 313 | objEditor = this; |
---|
311 | 314 | this.callee = callee; |
---|
312 | 315 | |
---|
.. | .. |
---|
337 | 340 | return frame.action(event, obj); |
---|
338 | 341 | } |
---|
339 | 342 | |
---|
| 343 | + // Cannot work without static |
---|
| 344 | + static boolean allparams = true; |
---|
| 345 | + |
---|
| 346 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 347 | + |
---|
340 | 348 | void SetupMenu() |
---|
341 | 349 | { |
---|
342 | 350 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
343 | 351 | menuBar.add(fileMenu = new Menu("File")); |
---|
344 | 352 | fileMenu.add(newItem = new MenuItem("New")); |
---|
345 | | - fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
| 353 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
346 | 354 | |
---|
347 | 355 | //oe.menuBar.add(menu = new Menu("Include")); |
---|
348 | 356 | Menu menu = new Menu("Import"); |
---|
.. | .. |
---|
374 | 382 | } |
---|
375 | 383 | |
---|
376 | 384 | newItem.addActionListener(this); |
---|
377 | | - loadItem.addActionListener(this); |
---|
| 385 | + openItem.addActionListener(this); |
---|
378 | 386 | saveItem.addActionListener(this); |
---|
379 | 387 | saveAsItem.addActionListener(this); |
---|
380 | 388 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
383 | 391 | closeItem.addActionListener(this); |
---|
384 | 392 | |
---|
385 | 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 | + |
---|
386 | 420 | toolbarPanel = new JPanel(); |
---|
387 | 421 | toolbarPanel.setName("Toolbar"); |
---|
388 | 422 | treePanel = new cGridBag(); |
---|
.. | .. |
---|
415 | 449 | // TEXTAREA infoarea.setLineWrap(true); |
---|
416 | 450 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
417 | 451 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
418 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
| 452 | + //infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
419 | 453 | infoPanel.setName("Info"); |
---|
420 | 454 | //infoPanel.setLayout(new BorderLayout()); |
---|
421 | 455 | //infoPanel.add(createTextPane()); |
---|
.. | .. |
---|
427 | 461 | mainPanel.setDividerSize(9); |
---|
428 | 462 | mainPanel.setDividerLocation(0.5); //1.0); |
---|
429 | 463 | mainPanel.setResizeWeight(0.5); |
---|
430 | | - |
---|
| 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 | + |
---|
431 | 472 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
432 | 473 | //mainPanel.setLayout(new GridBagLayout()); |
---|
433 | 474 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
.. | .. |
---|
658 | 699 | } |
---|
659 | 700 | } |
---|
660 | 701 | |
---|
661 | | -static GraphicsDevice device = GraphicsEnvironment |
---|
662 | | - .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 702 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 703 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
663 | 704 | |
---|
664 | 705 | Rectangle keeprect; |
---|
665 | 706 | cRadio radio; |
---|
.. | .. |
---|
680 | 721 | void Minimize() |
---|
681 | 722 | { |
---|
682 | 723 | frame.setState(Frame.ICONIFIED); |
---|
| 724 | + frame.validate(); |
---|
683 | 725 | } |
---|
684 | 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={} |
---|
685 | 730 | void Maximize() |
---|
686 | 731 | { |
---|
| 732 | + if (CameraPane.FULLSCREEN) |
---|
| 733 | + { |
---|
| 734 | + ToggleFullScreen(); |
---|
| 735 | + } |
---|
| 736 | + |
---|
687 | 737 | if (maximized) |
---|
688 | 738 | { |
---|
689 | 739 | frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
.. | .. |
---|
691 | 741 | else |
---|
692 | 742 | { |
---|
693 | 743 | keeprect = frame.getBounds(); |
---|
694 | | - Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
695 | | - Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
696 | | - 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); |
---|
697 | 747 | // frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 748 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
698 | 749 | } |
---|
699 | 750 | |
---|
700 | 751 | maximized ^= true; |
---|
| 752 | + |
---|
| 753 | + frame.validate(); |
---|
701 | 754 | } |
---|
| 755 | + |
---|
| 756 | + cButton minButton; |
---|
| 757 | + cButton maxButton; |
---|
| 758 | + cButton fullButton; |
---|
702 | 759 | |
---|
703 | 760 | void ToggleFullScreen() |
---|
704 | 761 | { |
---|
705 | | - if (CameraPane.FULLSCREEN) |
---|
| 762 | +GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 763 | + |
---|
| 764 | + cameraView.ToggleFullScreen(); |
---|
| 765 | + |
---|
| 766 | + if (!CameraPane.FULLSCREEN) |
---|
706 | 767 | { |
---|
707 | 768 | device.setFullScreenWindow(null); |
---|
| 769 | + frame.dispose(); |
---|
| 770 | + frame.setUndecorated(false); |
---|
| 771 | + frame.validate(); |
---|
| 772 | + frame.setVisible(true); |
---|
| 773 | + |
---|
708 | 774 | //frame.setVisible(false); |
---|
709 | 775 | // frame.removeNotify(); |
---|
710 | 776 | // frame.setUndecorated(false); |
---|
.. | .. |
---|
714 | 780 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
715 | 781 | // X framePanel.add(bigThree); |
---|
716 | 782 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
717 | | - framePanel.setDividerLocation(1); |
---|
| 783 | + framePanel.setDividerLocation(46); |
---|
718 | 784 | |
---|
719 | 785 | //frame.setVisible(true); |
---|
720 | 786 | radio.layout = keepButton; |
---|
.. | .. |
---|
729 | 795 | // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
730 | 796 | // frame.getToolkit().getScreenSize().height); |
---|
731 | 797 | //frame.setVisible(false); |
---|
| 798 | + |
---|
| 799 | + frame.dispose(); |
---|
| 800 | + frame.setUndecorated(true); |
---|
732 | 801 | device.setFullScreenWindow(frame); |
---|
| 802 | + frame.validate(); |
---|
| 803 | + frame.setVisible(true); |
---|
733 | 804 | // frame.removeNotify(); |
---|
734 | 805 | // frame.setUndecorated(true); |
---|
735 | 806 | // frame.addNotify(); |
---|
.. | .. |
---|
742 | 813 | radio.layout.doClick(); |
---|
743 | 814 | //frame.setVisible(true); |
---|
744 | 815 | } |
---|
745 | | - |
---|
746 | | - cameraView.ToggleFullScreen(); |
---|
| 816 | + frame.validate(); |
---|
747 | 817 | } |
---|
748 | 818 | |
---|
749 | 819 | private JTextPane createTextPane() |
---|
.. | .. |
---|
884 | 954 | JCheckBox speedupCB; |
---|
885 | 955 | JCheckBox rewindCB; |
---|
886 | 956 | JCheckBox flipVCB; |
---|
| 957 | + |
---|
| 958 | + cCheckBox toggleTextureCB; |
---|
| 959 | + cCheckBox toggleSwitchCB; |
---|
| 960 | + |
---|
887 | 961 | JComboBox texresMenu; |
---|
| 962 | + |
---|
888 | 963 | JButton resetButton; |
---|
889 | 964 | JButton stepButton; |
---|
890 | 965 | JButton stepAllButton; |
---|
.. | .. |
---|
1071 | 1146 | namePanel = new cGridBag(); |
---|
1072 | 1147 | |
---|
1073 | 1148 | nameField = AddText(namePanel, copy.GetName()); |
---|
1074 | | - namePanel.add(nameField); |
---|
| 1149 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1075 | 1150 | oe.ctrlPanel.add(namePanel); |
---|
1076 | 1151 | |
---|
1077 | 1152 | oe.ctrlPanel.Return(); |
---|
1078 | 1153 | |
---|
1079 | | - if (!GroupEditor.allparams) |
---|
| 1154 | + if (!allparams) |
---|
1080 | 1155 | return; |
---|
1081 | 1156 | |
---|
1082 | 1157 | setupPanel = new cGridBag().setVertical(false); |
---|
.. | .. |
---|
1089 | 1164 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1090 | 1165 | hideCB.setToolTipText("Hide object"); |
---|
1091 | 1166 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1092 | | - markCB.setToolTipText("Set the animation target transform"); |
---|
| 1167 | + markCB.setToolTipText("As animation target transform"); |
---|
1093 | 1168 | |
---|
1094 | 1169 | setupPanel2 = new cGridBag().setVertical(false); |
---|
1095 | 1170 | |
---|
1096 | 1171 | rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
1097 | 1172 | rewindCB.setToolTipText("Rewind animation"); |
---|
1098 | 1173 | |
---|
1099 | | - randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
1100 | | - 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)"); |
---|
1101 | 1176 | |
---|
1102 | 1177 | if (Globals.ADVANCED) |
---|
1103 | 1178 | { |
---|
.. | .. |
---|
1412 | 1487 | |
---|
1413 | 1488 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1414 | 1489 | //tmp.setName("Edit"); |
---|
1415 | | - objectPanel.add(toolboxPanel); |
---|
1416 | 1490 | objectPanel.add(materialPanel); |
---|
1417 | 1491 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1418 | 1492 | // north.setName("Edit"); |
---|
1419 | 1493 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1420 | 1494 | // objectPanel.add(north); |
---|
1421 | 1495 | objectPanel.add(editPanel); |
---|
1422 | | - objectPanel.add(infoPanel); |
---|
| 1496 | + |
---|
| 1497 | + if (Globals.ADVANCED) |
---|
| 1498 | + objectPanel.add(infoPanel); |
---|
| 1499 | + |
---|
| 1500 | + objectPanel.add(toolboxPanel); |
---|
1423 | 1501 | |
---|
1424 | 1502 | /* |
---|
1425 | 1503 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1428 | 1506 | aConstraints.gridy += 1; |
---|
1429 | 1507 | aConstraints.gridwidth = 1; |
---|
1430 | 1508 | mainPanel.add(objectPanel, aConstraints); |
---|
1431 | | - */ |
---|
| 1509 | + */ |
---|
1432 | 1510 | |
---|
1433 | 1511 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1434 | 1512 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1445 | 1523 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1446 | 1524 | tabbedPane.add(scrollpane); |
---|
1447 | 1525 | |
---|
1448 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1449 | | - |
---|
1450 | | - optionsPanel = new cGridBag().setVertical(true); |
---|
| 1526 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1451 | 1527 | |
---|
1452 | 1528 | optionsPanel.setName("Options"); |
---|
1453 | 1529 | |
---|
.. | .. |
---|
1455 | 1531 | |
---|
1456 | 1532 | tabbedPane.add(optionsPanel); |
---|
1457 | 1533 | |
---|
| 1534 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1535 | + |
---|
1458 | 1536 | scenePanel.add(tabbedPane); |
---|
1459 | 1537 | |
---|
1460 | 1538 | /* |
---|
.. | .. |
---|
1527 | 1605 | // aConstraints.gridheight = 1; |
---|
1528 | 1606 | |
---|
1529 | 1607 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1530 | | - framePanel.setContinuousLayout(true); |
---|
1531 | | - framePanel.setOneTouchExpandable(true); |
---|
1532 | | - framePanel.setDividerLocation(0.8); |
---|
| 1608 | + framePanel.setContinuousLayout(false); |
---|
| 1609 | + framePanel.setOneTouchExpandable(false); |
---|
| 1610 | + //.setDividerLocation(0.8); |
---|
1533 | 1611 | //framePanel.setDividerSize(15); |
---|
1534 | 1612 | //framePanel.setResizeWeight(0.15); |
---|
1535 | 1613 | framePanel.setName("Frame"); |
---|
.. | .. |
---|
1547 | 1625 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1548 | 1626 | |
---|
1549 | 1627 | frame.setSize(1280, 860); |
---|
1550 | | - frame.setVisible(true); |
---|
1551 | | - |
---|
| 1628 | + |
---|
1552 | 1629 | cameraView.requestFocusInWindow(); |
---|
1553 | 1630 | |
---|
1554 | 1631 | gridPanel.setDividerLocation(1.0); |
---|
| 1632 | + |
---|
| 1633 | + frame.validate(); |
---|
| 1634 | + |
---|
| 1635 | + frame.setVisible(true); |
---|
1555 | 1636 | |
---|
1556 | 1637 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1557 | 1638 | frame.addWindowListener(new WindowAdapter() |
---|
.. | .. |
---|
1638 | 1719 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1639 | 1720 | colorSection.add(texture); |
---|
1640 | 1721 | |
---|
1641 | | - cGridBag anisoU = new cGridBag(); |
---|
1642 | | - anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
1643 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1644 | | - anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1645 | | - colorSection.add(anisoU); |
---|
1646 | | - |
---|
1647 | | - cGridBag anisoV = new cGridBag(); |
---|
1648 | | - anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
1649 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1650 | | - anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1651 | | - colorSection.add(anisoV); |
---|
1652 | | - |
---|
1653 | | - cGridBag shadowbias = new cGridBag(); |
---|
1654 | | - shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
1655 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1656 | | - shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1657 | | - colorSection.add(shadowbias); |
---|
1658 | | - |
---|
1659 | 1722 | panel.add(new JSeparator()); |
---|
1660 | 1723 | |
---|
1661 | 1724 | panel.add(colorSection); |
---|
.. | .. |
---|
1705 | 1768 | fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1706 | 1769 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1707 | 1770 | 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); |
---|
1708 | 1777 | |
---|
1709 | 1778 | panel.add(new JSeparator()); |
---|
1710 | 1779 | |
---|
.. | .. |
---|
1756 | 1825 | // aConstraints.gridy += 1; |
---|
1757 | 1826 | // aConstraints.gridwidth = 1; |
---|
1758 | 1827 | |
---|
| 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 | + |
---|
1759 | 1840 | |
---|
1760 | 1841 | panel.add(new JSeparator()); |
---|
1761 | 1842 | |
---|
.. | .. |
---|
1763 | 1844 | |
---|
1764 | 1845 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1765 | 1846 | |
---|
1766 | | - cGridBag globalSection = new cGridBag().setVertical(true); |
---|
| 1847 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1767 | 1848 | |
---|
1768 | 1849 | cGridBag camera = new cGridBag(); |
---|
1769 | 1850 | camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
1770 | 1851 | cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1771 | 1852 | camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1772 | | - globalSection.add(camera); |
---|
| 1853 | + colorSection.add(camera); |
---|
1773 | 1854 | |
---|
1774 | 1855 | cGridBag ambient = new cGridBag(); |
---|
1775 | 1856 | ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
1776 | 1857 | ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1777 | 1858 | ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1778 | | - globalSection.add(ambient); |
---|
| 1859 | + colorSection.add(ambient); |
---|
1779 | 1860 | |
---|
1780 | 1861 | cGridBag backlit = new cGridBag(); |
---|
1781 | 1862 | backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
1782 | 1863 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1783 | 1864 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1784 | | - globalSection.add(backlit); |
---|
| 1865 | + colorSection.add(backlit); |
---|
1785 | 1866 | |
---|
1786 | 1867 | cGridBag opacity = new cGridBag(); |
---|
1787 | 1868 | opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1788 | 1869 | opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1789 | 1870 | opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1790 | | - globalSection.add(opacity); |
---|
| 1871 | + colorSection.add(opacity); |
---|
1791 | 1872 | |
---|
1792 | | - panel.add(new JSeparator()); |
---|
| 1873 | + //panel.add(new JSeparator()); |
---|
1793 | 1874 | |
---|
1794 | | - panel.add(globalSection); |
---|
| 1875 | + //panel.add(globalSection); |
---|
1795 | 1876 | |
---|
1796 | 1877 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1797 | 1878 | |
---|
.. | .. |
---|
2866 | 2947 | |
---|
2867 | 2948 | void SetMaterial(Object3D object) |
---|
2868 | 2949 | { |
---|
| 2950 | + latestObject = object; |
---|
| 2951 | + |
---|
2869 | 2952 | cMaterial mat = object.material; |
---|
2870 | 2953 | |
---|
2871 | 2954 | if (mat == null) |
---|
.. | .. |
---|
2977 | 3060 | // } |
---|
2978 | 3061 | |
---|
2979 | 3062 | /**/ |
---|
2980 | | - if (deselect) |
---|
| 3063 | + if (deselect || child == null) |
---|
2981 | 3064 | { |
---|
2982 | 3065 | //group.deselectAll(); |
---|
2983 | 3066 | //freeze = true; |
---|
2984 | 3067 | GetTree().clearSelection(); |
---|
2985 | 3068 | //freeze = false; |
---|
| 3069 | + |
---|
| 3070 | + if (child == null) |
---|
| 3071 | + { |
---|
| 3072 | + return; |
---|
| 3073 | + } |
---|
2986 | 3074 | } |
---|
2987 | 3075 | |
---|
2988 | 3076 | //group.addSelectee(child); |
---|
.. | .. |
---|
3051 | 3139 | cameraView.ToggleDL(); |
---|
3052 | 3140 | cameraView.repaint(); |
---|
3053 | 3141 | return; |
---|
3054 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3142 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
3055 | 3143 | { |
---|
3056 | 3144 | cameraView.ToggleTexture(); |
---|
3057 | 3145 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
3090 | 3178 | frame.validate(); |
---|
3091 | 3179 | |
---|
3092 | 3180 | return; |
---|
3093 | | - } else if (event.getSource() == toggleSwitchItem) |
---|
| 3181 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
3094 | 3182 | { |
---|
3095 | 3183 | cameraView.ToggleSwitch(); |
---|
3096 | 3184 | cameraView.repaint(); |
---|
.. | .. |
---|
3112 | 3200 | } else if (event.getSource() == animationItem) |
---|
3113 | 3201 | { |
---|
3114 | 3202 | ToggleAnimation(); |
---|
| 3203 | + return; |
---|
| 3204 | + } else if (event.getSource() == archiveItem) |
---|
| 3205 | + { |
---|
| 3206 | + cTools.Archive(frame); |
---|
3115 | 3207 | return; |
---|
3116 | 3208 | } else if (event.getSource() == flipVCB) |
---|
3117 | 3209 | { |
---|
.. | .. |
---|
3306 | 3398 | { |
---|
3307 | 3399 | Close(); |
---|
3308 | 3400 | //return true; |
---|
3309 | | - } else if (source == loadItem) |
---|
| 3401 | + } else if (source == openItem) |
---|
3310 | 3402 | { |
---|
3311 | | - load(); |
---|
| 3403 | + Open(); |
---|
3312 | 3404 | //return true; |
---|
3313 | 3405 | } else if (source == newItem) |
---|
3314 | 3406 | { |
---|
.. | .. |
---|
3483 | 3575 | |
---|
3484 | 3576 | copy.ExtractBigData(hashtable); |
---|
3485 | 3577 | |
---|
| 3578 | + byte[] compress = Compress(copy); |
---|
| 3579 | + |
---|
3486 | 3580 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3487 | | - tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3581 | + tab.graphs[tab.undoindex++] = compress; |
---|
3488 | 3582 | |
---|
3489 | 3583 | copy.RestoreBigData(hashtable); |
---|
3490 | 3584 | |
---|
.. | .. |
---|
3497 | 3591 | tab.graphs[i] = null; |
---|
3498 | 3592 | } |
---|
3499 | 3593 | |
---|
| 3594 | + SetUndoStates(); |
---|
| 3595 | + |
---|
3500 | 3596 | // test save |
---|
3501 | 3597 | if (false) |
---|
3502 | 3598 | { |
---|
.. | .. |
---|
3519 | 3615 | |
---|
3520 | 3616 | void CopyChanged(Object3D obj) |
---|
3521 | 3617 | { |
---|
| 3618 | + SetUndoStates(); |
---|
| 3619 | + |
---|
3522 | 3620 | boolean temp = CameraPane.SWITCH; |
---|
3523 | 3621 | CameraPane.SWITCH = false; |
---|
3524 | 3622 | |
---|
.. | .. |
---|
3556 | 3654 | } |
---|
3557 | 3655 | |
---|
3558 | 3656 | refreshContents(); |
---|
| 3657 | + } |
---|
| 3658 | + |
---|
| 3659 | + cButton undoButton; |
---|
| 3660 | + cButton redoButton; |
---|
| 3661 | + |
---|
| 3662 | + void SetUndoStates() |
---|
| 3663 | + { |
---|
| 3664 | + cRadio tab = GetCurrentTab(); |
---|
| 3665 | + |
---|
| 3666 | + undoButton.setEnabled(tab.undoindex > 0); |
---|
| 3667 | + redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null); |
---|
3559 | 3668 | } |
---|
3560 | 3669 | |
---|
3561 | 3670 | public void Undo() |
---|
.. | .. |
---|
4618 | 4727 | } |
---|
4619 | 4728 | } |
---|
4620 | 4729 | |
---|
4621 | | - void load() // throws ClassNotFoundException |
---|
| 4730 | + void Open() // throws ClassNotFoundException |
---|
4622 | 4731 | { |
---|
4623 | 4732 | if (Grafreed.standAlone) |
---|
4624 | 4733 | { |
---|
.. | .. |
---|
4735 | 4844 | String filename = browser.getFile(); |
---|
4736 | 4845 | if (filename != null && filename.length() > 0) |
---|
4737 | 4846 | { |
---|
| 4847 | + if (!filename.endsWith(".gfd")) |
---|
| 4848 | + filename += ".gfd"; |
---|
4738 | 4849 | lastname = browser.getDirectory() + filename; |
---|
4739 | 4850 | save(); |
---|
4740 | 4851 | } |
---|
.. | .. |
---|
4901 | 5012 | MenuBar menuBar; |
---|
4902 | 5013 | Menu fileMenu; |
---|
4903 | 5014 | MenuItem newItem; |
---|
4904 | | - MenuItem loadItem; |
---|
| 5015 | + MenuItem openItem; |
---|
4905 | 5016 | MenuItem saveItem; |
---|
4906 | 5017 | MenuItem saveAsItem; |
---|
4907 | 5018 | MenuItem exportAsItem; |
---|
.. | .. |
---|
4924 | 5035 | CheckboxMenuItem toggleSwitchItem; |
---|
4925 | 5036 | CheckboxMenuItem toggleRootItem; |
---|
4926 | 5037 | CheckboxMenuItem animationItem; |
---|
| 5038 | + CheckboxMenuItem archiveItem; |
---|
4927 | 5039 | CheckboxMenuItem toggleHandleItem; |
---|
4928 | 5040 | CheckboxMenuItem togglePaintItem; |
---|
4929 | 5041 | JSplitPane mainPanel; |
---|
.. | .. |
---|
4945 | 5057 | cGridBag optionsPanel; |
---|
4946 | 5058 | |
---|
4947 | 5059 | JTabbedPane objectPanel; |
---|
| 5060 | + boolean materialFlushed; |
---|
| 5061 | + Object3D latestObject; |
---|
4948 | 5062 | |
---|
4949 | 5063 | cGridBag XYZPanel; |
---|
4950 | 5064 | |
---|