.. | .. |
---|
4 | 4 | |
---|
5 | 5 | import java.awt.*; |
---|
6 | 6 | import java.awt.event.*; |
---|
| 7 | +import java.awt.image.BufferedImage; |
---|
7 | 8 | import javax.swing.*; |
---|
8 | 9 | import javax.swing.event.*; |
---|
9 | 10 | import javax.swing.text.*; |
---|
.. | .. |
---|
13 | 14 | import javax.swing.plaf.metal.MetalLookAndFeel; |
---|
14 | 15 | //import javax.swing.plaf.ColorUIResource; |
---|
15 | 16 | //import javax.swing.plaf.metal.DefaultMetalTheme; |
---|
| 17 | + |
---|
| 18 | +import javax.swing.plaf.basic.BasicSplitPaneDivider; |
---|
| 19 | +import javax.swing.plaf.basic.BasicSplitPaneUI; |
---|
16 | 20 | |
---|
17 | 21 | //import javax.media.opengl.GLCanvas; |
---|
18 | 22 | |
---|
.. | .. |
---|
35 | 39 | |
---|
36 | 40 | GroupEditor callee; |
---|
37 | 41 | JFrame frame; |
---|
| 42 | + |
---|
| 43 | + static ObjEditor theFrame; |
---|
| 44 | + |
---|
| 45 | + cButton GetButton(String name, boolean border) |
---|
| 46 | + { |
---|
| 47 | + try |
---|
| 48 | + { |
---|
| 49 | + ImageIcon icon = GetIcon(name); |
---|
| 50 | + return new cButton(icon, border); |
---|
| 51 | + } |
---|
| 52 | + catch (Exception e) |
---|
| 53 | + { |
---|
| 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); |
---|
| 68 | + } |
---|
| 69 | + } |
---|
| 70 | + |
---|
| 71 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 72 | + { |
---|
| 73 | + try |
---|
| 74 | + { |
---|
| 75 | + ImageIcon icon = GetIcon(name); |
---|
| 76 | + return new cCheckBox(icon, border); |
---|
| 77 | + } |
---|
| 78 | + catch (Exception e) |
---|
| 79 | + { |
---|
| 80 | + return new cCheckBox(name, border); |
---|
| 81 | + } |
---|
| 82 | + } |
---|
| 83 | + |
---|
| 84 | + private ImageIcon GetIcon(String name) throws IOException |
---|
| 85 | + { |
---|
| 86 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 87 | + |
---|
| 88 | + if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 89 | + { |
---|
| 90 | + BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
| 91 | + Graphics2D g = resized.createGraphics(); |
---|
| 92 | + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 93 | + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 94 | + g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 95 | + g.dispose(); |
---|
| 96 | + |
---|
| 97 | + image = resized; |
---|
| 98 | + } |
---|
| 99 | + |
---|
| 100 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 101 | + return icon; |
---|
| 102 | + } |
---|
38 | 103 | |
---|
39 | 104 | // SCRIPT |
---|
40 | 105 | |
---|
.. | .. |
---|
145 | 210 | |
---|
146 | 211 | objEditor.ctrlPanel.remove(namePanel); |
---|
147 | 212 | |
---|
148 | | - if (!GroupEditor.allparams) |
---|
| 213 | + if (!allparams) |
---|
149 | 214 | return; |
---|
150 | 215 | |
---|
151 | 216 | // objEditor.ctrlPanel.remove(liveCB); |
---|
.. | .. |
---|
168 | 233 | // objEditor.ctrlPanel.remove(remarkButton); |
---|
169 | 234 | |
---|
170 | 235 | objEditor.ctrlPanel.remove(setupPanel); |
---|
171 | | - objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 236 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 237 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
172 | 238 | objEditor.ctrlPanel.remove(pushPanel); |
---|
173 | 239 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
174 | 240 | |
---|
.. | .. |
---|
243 | 309 | //localCopy.parent = null; |
---|
244 | 310 | |
---|
245 | 311 | frame = new JFrame(); |
---|
| 312 | + frame.setUndecorated(false); |
---|
246 | 313 | objEditor = this; |
---|
247 | 314 | this.callee = callee; |
---|
248 | 315 | |
---|
.. | .. |
---|
273 | 340 | return frame.action(event, obj); |
---|
274 | 341 | } |
---|
275 | 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 | + |
---|
276 | 348 | void SetupMenu() |
---|
277 | 349 | { |
---|
278 | 350 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
279 | 351 | menuBar.add(fileMenu = new Menu("File")); |
---|
280 | 352 | fileMenu.add(newItem = new MenuItem("New")); |
---|
281 | | - fileMenu.add(loadItem = new MenuItem("Load...")); |
---|
| 353 | + fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
282 | 354 | |
---|
283 | 355 | //oe.menuBar.add(menu = new Menu("Include")); |
---|
284 | 356 | Menu menu = new Menu("Import"); |
---|
.. | .. |
---|
319 | 391 | closeItem.addActionListener(this); |
---|
320 | 392 | |
---|
321 | 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 | + |
---|
322 | 420 | toolbarPanel = new JPanel(); |
---|
323 | 421 | toolbarPanel.setName("Toolbar"); |
---|
324 | 422 | treePanel = new cGridBag(); |
---|
325 | 423 | treePanel.setName("Tree"); |
---|
| 424 | + |
---|
| 425 | + editPanel = new cGridBag().setVertical(true); |
---|
| 426 | + editPanel.setName("Edit"); |
---|
| 427 | + |
---|
326 | 428 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
327 | | - ctrlPanel.setName("Edit"); |
---|
| 429 | + |
---|
| 430 | + editCommandsPanel = new cGridBag(); |
---|
| 431 | + editPanel.add(editCommandsPanel); |
---|
| 432 | + editPanel.add(ctrlPanel); |
---|
| 433 | + |
---|
| 434 | + toolboxPanel = new cGridBag().setVertical(false); |
---|
| 435 | + toolboxPanel.setName("Toolbox"); |
---|
| 436 | + |
---|
328 | 437 | materialPanel = new cGridBag().setVertical(true); |
---|
329 | 438 | materialPanel.setName("Material"); |
---|
| 439 | + |
---|
330 | 440 | /*JTextPane*/ |
---|
331 | 441 | infoarea = createTextPane(); |
---|
332 | 442 | doc = infoarea.getStyledDocument(); |
---|
.. | .. |
---|
339 | 449 | // TEXTAREA infoarea.setLineWrap(true); |
---|
340 | 450 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
341 | 451 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
342 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
| 452 | + //infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
343 | 453 | infoPanel.setName("Info"); |
---|
344 | 454 | //infoPanel.setLayout(new BorderLayout()); |
---|
345 | 455 | //infoPanel.add(createTextPane()); |
---|
.. | .. |
---|
351 | 461 | mainPanel.setDividerSize(9); |
---|
352 | 462 | mainPanel.setDividerLocation(0.5); //1.0); |
---|
353 | 463 | mainPanel.setResizeWeight(0.5); |
---|
354 | | - |
---|
| 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 | + |
---|
355 | 472 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
356 | 473 | //mainPanel.setLayout(new GridBagLayout()); |
---|
357 | 474 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
.. | .. |
---|
419 | 536 | e.printStackTrace(); |
---|
420 | 537 | } |
---|
421 | 538 | |
---|
422 | | - String selection = infoarea.getText(); |
---|
423 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
424 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
425 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 539 | +// String selection = infoarea.getText(); |
---|
| 540 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 541 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 542 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
426 | 543 | //clipboard.setContents(data, data); |
---|
427 | 544 | } |
---|
428 | 545 | |
---|
.. | .. |
---|
582 | 699 | } |
---|
583 | 700 | } |
---|
584 | 701 | |
---|
| 702 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 703 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 704 | + |
---|
| 705 | + Rectangle keeprect; |
---|
| 706 | + cRadio radio; |
---|
| 707 | + |
---|
| 708 | +cButton keepButton; |
---|
| 709 | + cButton twoButton; // Full 3D |
---|
| 710 | + cButton sixButton; |
---|
| 711 | + cButton threeButton; |
---|
| 712 | + cButton sevenButton; |
---|
| 713 | + cButton fourButton; // full panel |
---|
| 714 | + cButton oneButton; // full XYZ |
---|
| 715 | + //cButton currentLayout; |
---|
| 716 | + |
---|
| 717 | + boolean maximized; |
---|
| 718 | + |
---|
| 719 | + cButton fullscreenLayout; |
---|
| 720 | + |
---|
| 721 | + void Minimize() |
---|
| 722 | + { |
---|
| 723 | + frame.setState(Frame.ICONIFIED); |
---|
| 724 | + frame.validate(); |
---|
| 725 | + } |
---|
| 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={} |
---|
| 730 | + void Maximize() |
---|
| 731 | + { |
---|
| 732 | + if (CameraPane.FULLSCREEN) |
---|
| 733 | + { |
---|
| 734 | + ToggleFullScreen(); |
---|
| 735 | + } |
---|
| 736 | + |
---|
| 737 | + if (maximized) |
---|
| 738 | + { |
---|
| 739 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 740 | + } |
---|
| 741 | + else |
---|
| 742 | + { |
---|
| 743 | + keeprect = frame.getBounds(); |
---|
| 744 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 745 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 746 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 747 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 748 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
| 749 | + } |
---|
| 750 | + |
---|
| 751 | + maximized ^= true; |
---|
| 752 | + |
---|
| 753 | + frame.validate(); |
---|
| 754 | + } |
---|
| 755 | + |
---|
| 756 | + cButton minButton; |
---|
| 757 | + cButton maxButton; |
---|
| 758 | + cButton fullButton; |
---|
| 759 | + |
---|
585 | 760 | void ToggleFullScreen() |
---|
586 | 761 | { |
---|
587 | | - if (CameraPane.FULLSCREEN) |
---|
| 762 | +GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 763 | + |
---|
| 764 | + cameraView.ToggleFullScreen(); |
---|
| 765 | + |
---|
| 766 | + if (!CameraPane.FULLSCREEN) |
---|
588 | 767 | { |
---|
589 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
590 | | - framePanel.add(bigThree); |
---|
591 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 768 | + device.setFullScreenWindow(null); |
---|
| 769 | + frame.dispose(); |
---|
| 770 | + frame.setUndecorated(false); |
---|
| 771 | + frame.validate(); |
---|
| 772 | + frame.setVisible(true); |
---|
| 773 | + |
---|
| 774 | + //frame.setVisible(false); |
---|
| 775 | +// frame.removeNotify(); |
---|
| 776 | +// frame.setUndecorated(false); |
---|
| 777 | +// frame.addNotify(); |
---|
| 778 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 779 | + |
---|
| 780 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 781 | +// X framePanel.add(bigThree); |
---|
| 782 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 783 | + framePanel.setDividerLocation(1); |
---|
| 784 | + |
---|
| 785 | + //frame.setVisible(true); |
---|
| 786 | + radio.layout = keepButton; |
---|
| 787 | + //theFrame = null; |
---|
| 788 | + keepButton = null; |
---|
| 789 | + radio.layout.doClick(); |
---|
| 790 | + |
---|
592 | 791 | } else |
---|
593 | 792 | { |
---|
594 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
595 | | - framePanel.remove(bigThree); |
---|
596 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 793 | + keepButton = radio.layout; |
---|
| 794 | + //keeprect = frame.getBounds(); |
---|
| 795 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 796 | +// frame.getToolkit().getScreenSize().height); |
---|
| 797 | + //frame.setVisible(false); |
---|
| 798 | + |
---|
| 799 | + frame.dispose(); |
---|
| 800 | + frame.setUndecorated(true); |
---|
| 801 | + device.setFullScreenWindow(frame); |
---|
| 802 | + frame.validate(); |
---|
| 803 | + frame.setVisible(true); |
---|
| 804 | +// frame.removeNotify(); |
---|
| 805 | +// frame.setUndecorated(true); |
---|
| 806 | +// frame.addNotify(); |
---|
| 807 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 808 | +// X framePanel.remove(bigThree); |
---|
| 809 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 810 | + framePanel.setDividerLocation(0); |
---|
| 811 | + |
---|
| 812 | + radio.layout = fullscreenLayout; |
---|
| 813 | + radio.layout.doClick(); |
---|
| 814 | + //frame.setVisible(true); |
---|
597 | 815 | } |
---|
598 | | - cameraView.ToggleFullScreen(); |
---|
| 816 | + frame.validate(); |
---|
599 | 817 | } |
---|
600 | 818 | |
---|
601 | 819 | private JTextPane createTextPane() |
---|
.. | .. |
---|
736 | 954 | JCheckBox speedupCB; |
---|
737 | 955 | JCheckBox rewindCB; |
---|
738 | 956 | JCheckBox flipVCB; |
---|
| 957 | + |
---|
| 958 | + cCheckBox toggleTextureCB; |
---|
| 959 | + cCheckBox toggleSwitchCB; |
---|
| 960 | + |
---|
739 | 961 | JComboBox texresMenu; |
---|
| 962 | + |
---|
740 | 963 | JButton resetButton; |
---|
741 | 964 | JButton stepButton; |
---|
742 | 965 | JButton stepAllButton; |
---|
.. | .. |
---|
745 | 968 | JButton fasterButton; |
---|
746 | 969 | JButton remarkButton; |
---|
747 | 970 | |
---|
| 971 | + cGridBag editPanel; |
---|
| 972 | + cGridBag editCommandsPanel; |
---|
| 973 | + |
---|
748 | 974 | cGridBag namePanel; |
---|
749 | 975 | cGridBag setupPanel; |
---|
750 | | - cGridBag commandsPanel; |
---|
| 976 | + cGridBag setupPanel2; |
---|
| 977 | + cGridBag objectCommandsPanel; |
---|
751 | 978 | cGridBag pushPanel; |
---|
752 | 979 | cGridBag fillPanel; |
---|
753 | 980 | |
---|
.. | .. |
---|
919 | 1146 | namePanel = new cGridBag(); |
---|
920 | 1147 | |
---|
921 | 1148 | nameField = AddText(namePanel, copy.GetName()); |
---|
922 | | - namePanel.add(nameField); |
---|
| 1149 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
923 | 1150 | oe.ctrlPanel.add(namePanel); |
---|
924 | 1151 | |
---|
925 | 1152 | oe.ctrlPanel.Return(); |
---|
926 | 1153 | |
---|
927 | | - if (!GroupEditor.allparams) |
---|
| 1154 | + if (!allparams) |
---|
928 | 1155 | return; |
---|
929 | 1156 | |
---|
930 | 1157 | setupPanel = new cGridBag().setVertical(false); |
---|
.. | .. |
---|
937 | 1164 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
938 | 1165 | hideCB.setToolTipText("Hide object"); |
---|
939 | 1166 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
940 | | - markCB.setToolTipText("Set the animation target transform"); |
---|
| 1167 | + markCB.setToolTipText("As animation target transform"); |
---|
941 | 1168 | |
---|
942 | | - rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 1169 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1170 | + |
---|
| 1171 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
943 | 1172 | rewindCB.setToolTipText("Rewind animation"); |
---|
944 | 1173 | |
---|
945 | | - randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
946 | | - randomCB.setToolTipText("Option for switch node"); |
---|
| 1174 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1175 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
947 | 1176 | |
---|
948 | 1177 | if (Globals.ADVANCED) |
---|
949 | 1178 | { |
---|
950 | | - link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
| 1179 | + link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
951 | 1180 | link2masterCB.setToolTipText("Attach to support"); |
---|
952 | | - speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 1181 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
953 | 1182 | speedupCB.setToolTipText("Option motion capture"); |
---|
954 | 1183 | } |
---|
955 | 1184 | |
---|
956 | 1185 | oe.ctrlPanel.add(setupPanel); |
---|
957 | 1186 | oe.ctrlPanel.Return(); |
---|
| 1187 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1188 | + oe.ctrlPanel.Return(); |
---|
958 | 1189 | |
---|
959 | | - commandsPanel = new cGridBag().setVertical(false); |
---|
| 1190 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
960 | 1191 | |
---|
961 | | - resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 1192 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
962 | 1193 | resetButton.setToolTipText("Jump to frame zero"); |
---|
963 | | - stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1194 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
964 | 1195 | stepButton.setToolTipText("Step one frame"); |
---|
965 | 1196 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
966 | 1197 | // stepAllButton = AddButton(oe, "Step All"); |
---|
967 | 1198 | // Return(); |
---|
968 | | - slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 1199 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
969 | 1200 | slowerButton.setToolTipText("Decrease animation speed"); |
---|
970 | | - fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 1201 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
971 | 1202 | fasterButton.setToolTipText("Increase animation speed"); |
---|
972 | | - remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1203 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
973 | 1204 | remarkButton.setToolTipText("Set the current transform as the target"); |
---|
974 | 1205 | |
---|
975 | | - oe.ctrlPanel.add(commandsPanel); |
---|
| 1206 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
976 | 1207 | oe.ctrlPanel.Return(); |
---|
977 | 1208 | |
---|
978 | 1209 | pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
.. | .. |
---|
1178 | 1409 | //worldPanel.setName("World"); |
---|
1179 | 1410 | centralPanel = new cGridBag(); |
---|
1180 | 1411 | centralPanel.preferredWidth = 20; |
---|
1181 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1182 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1412 | + |
---|
| 1413 | + if (Globals.ADVANCED) |
---|
| 1414 | + { |
---|
| 1415 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1416 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1183 | 1417 | |
---|
1184 | 1418 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1185 | 1419 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1188 | 1422 | // cameraPanel.setDividerSize(9); |
---|
1189 | 1423 | cameraPanel.setResizeWeight(1.0); |
---|
1190 | 1424 | |
---|
| 1425 | + } |
---|
| 1426 | + |
---|
1191 | 1427 | centralPanel.add(cameraView); |
---|
| 1428 | + centralPanel.setFocusable(true); |
---|
1192 | 1429 | //frame.setJMenuBar(timelineMenubar); |
---|
1193 | 1430 | //centralPanel.add(timelinePanel); |
---|
1194 | 1431 | |
---|
.. | .. |
---|
1255 | 1492 | // north.setName("Edit"); |
---|
1256 | 1493 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1257 | 1494 | // objectPanel.add(north); |
---|
1258 | | - objectPanel.add(ctrlPanel); |
---|
| 1495 | + objectPanel.add(editPanel); |
---|
1259 | 1496 | objectPanel.add(infoPanel); |
---|
| 1497 | + objectPanel.add(toolboxPanel); |
---|
1260 | 1498 | |
---|
1261 | 1499 | /* |
---|
1262 | 1500 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1265 | 1503 | aConstraints.gridy += 1; |
---|
1266 | 1504 | aConstraints.gridwidth = 1; |
---|
1267 | 1505 | mainPanel.add(objectPanel, aConstraints); |
---|
1268 | | - */ |
---|
| 1506 | + */ |
---|
1269 | 1507 | |
---|
1270 | 1508 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1271 | 1509 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1282 | 1520 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1283 | 1521 | tabbedPane.add(scrollpane); |
---|
1284 | 1522 | |
---|
1285 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1286 | | - |
---|
1287 | | - optionsPanel = new cGridBag().setVertical(true); |
---|
| 1523 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1288 | 1524 | |
---|
1289 | 1525 | optionsPanel.setName("Options"); |
---|
1290 | 1526 | |
---|
.. | .. |
---|
1292 | 1528 | |
---|
1293 | 1529 | tabbedPane.add(optionsPanel); |
---|
1294 | 1530 | |
---|
| 1531 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1532 | + |
---|
1295 | 1533 | scenePanel.add(tabbedPane); |
---|
1296 | 1534 | |
---|
1297 | 1535 | /* |
---|
.. | .. |
---|
1384 | 1622 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1385 | 1623 | |
---|
1386 | 1624 | frame.setSize(1280, 860); |
---|
1387 | | - frame.setVisible(true); |
---|
1388 | | - |
---|
| 1625 | + |
---|
| 1626 | + cameraView.requestFocusInWindow(); |
---|
| 1627 | + |
---|
1389 | 1628 | gridPanel.setDividerLocation(1.0); |
---|
| 1629 | + |
---|
| 1630 | + frame.validate(); |
---|
| 1631 | + |
---|
| 1632 | + frame.setVisible(true); |
---|
1390 | 1633 | |
---|
1391 | 1634 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1392 | 1635 | frame.addWindowListener(new WindowAdapter() |
---|
.. | .. |
---|
1473 | 1716 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1474 | 1717 | colorSection.add(texture); |
---|
1475 | 1718 | |
---|
1476 | | - cGridBag anisoU = new cGridBag(); |
---|
1477 | | - anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
1478 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1479 | | - anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1480 | | - colorSection.add(anisoU); |
---|
1481 | | - |
---|
1482 | | - cGridBag anisoV = new cGridBag(); |
---|
1483 | | - anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
1484 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1485 | | - anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1486 | | - colorSection.add(anisoV); |
---|
1487 | | - |
---|
1488 | | - cGridBag shadowbias = new cGridBag(); |
---|
1489 | | - shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
1490 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1491 | | - shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1492 | | - colorSection.add(shadowbias); |
---|
1493 | | - |
---|
1494 | 1719 | panel.add(new JSeparator()); |
---|
1495 | 1720 | |
---|
1496 | 1721 | panel.add(colorSection); |
---|
.. | .. |
---|
1540 | 1765 | fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1541 | 1766 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1542 | 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); |
---|
1543 | 1774 | |
---|
1544 | 1775 | panel.add(new JSeparator()); |
---|
1545 | 1776 | |
---|
.. | .. |
---|
1591 | 1822 | // aConstraints.gridy += 1; |
---|
1592 | 1823 | // aConstraints.gridwidth = 1; |
---|
1593 | 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 | + |
---|
1594 | 1837 | |
---|
1595 | 1838 | panel.add(new JSeparator()); |
---|
1596 | 1839 | |
---|
.. | .. |
---|
1598 | 1841 | |
---|
1599 | 1842 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1600 | 1843 | |
---|
1601 | | - cGridBag globalSection = new cGridBag().setVertical(true); |
---|
| 1844 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1602 | 1845 | |
---|
1603 | 1846 | cGridBag camera = new cGridBag(); |
---|
1604 | 1847 | camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
1605 | 1848 | cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1606 | 1849 | camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1607 | | - globalSection.add(camera); |
---|
| 1850 | + colorSection.add(camera); |
---|
1608 | 1851 | |
---|
1609 | 1852 | cGridBag ambient = new cGridBag(); |
---|
1610 | 1853 | ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
1611 | 1854 | ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1612 | 1855 | ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1613 | | - globalSection.add(ambient); |
---|
| 1856 | + colorSection.add(ambient); |
---|
1614 | 1857 | |
---|
1615 | 1858 | cGridBag backlit = new cGridBag(); |
---|
1616 | 1859 | backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
1617 | 1860 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1618 | 1861 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1619 | | - globalSection.add(backlit); |
---|
| 1862 | + colorSection.add(backlit); |
---|
1620 | 1863 | |
---|
1621 | 1864 | cGridBag opacity = new cGridBag(); |
---|
1622 | 1865 | opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1623 | 1866 | opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1624 | 1867 | opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1625 | | - globalSection.add(opacity); |
---|
| 1868 | + colorSection.add(opacity); |
---|
1626 | 1869 | |
---|
1627 | | - panel.add(new JSeparator()); |
---|
| 1870 | + //panel.add(new JSeparator()); |
---|
1628 | 1871 | |
---|
1629 | | - panel.add(globalSection); |
---|
| 1872 | + //panel.add(globalSection); |
---|
1630 | 1873 | |
---|
1631 | 1874 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1632 | 1875 | |
---|
.. | .. |
---|
2072 | 2315 | |
---|
2073 | 2316 | void LoadObjFile(String fullname) |
---|
2074 | 2317 | { |
---|
2075 | | - /* |
---|
| 2318 | + System.out.println("Loading " + fullname); |
---|
| 2319 | + /**/ |
---|
2076 | 2320 | //lastFilename = fullname; |
---|
2077 | 2321 | if(loadObjThread == null) |
---|
2078 | 2322 | { |
---|
2079 | | - loadObjThread = new LoadOBJThread(); |
---|
2080 | | - loadObjThread.start(); |
---|
| 2323 | + loadObjThread = new LoadOBJThread(); |
---|
| 2324 | + loadObjThread.start(); |
---|
2081 | 2325 | } |
---|
2082 | 2326 | |
---|
2083 | 2327 | loadObjThread.add(fullname); |
---|
2084 | | - */ |
---|
| 2328 | + /**/ |
---|
2085 | 2329 | |
---|
2086 | | - System.out.println("Loading " + fullname); |
---|
2087 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2330 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2088 | 2331 | } |
---|
2089 | 2332 | |
---|
2090 | 2333 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2701 | 2944 | |
---|
2702 | 2945 | void SetMaterial(Object3D object) |
---|
2703 | 2946 | { |
---|
| 2947 | + latestObject = object; |
---|
| 2948 | + |
---|
2704 | 2949 | cMaterial mat = object.material; |
---|
2705 | 2950 | |
---|
2706 | 2951 | if (mat == null) |
---|
.. | .. |
---|
2812 | 3057 | // } |
---|
2813 | 3058 | |
---|
2814 | 3059 | /**/ |
---|
2815 | | - if (deselect) |
---|
| 3060 | + if (deselect || child == null) |
---|
2816 | 3061 | { |
---|
2817 | 3062 | //group.deselectAll(); |
---|
2818 | 3063 | //freeze = true; |
---|
2819 | 3064 | GetTree().clearSelection(); |
---|
2820 | 3065 | //freeze = false; |
---|
| 3066 | + |
---|
| 3067 | + if (child == null) |
---|
| 3068 | + { |
---|
| 3069 | + return; |
---|
| 3070 | + } |
---|
2821 | 3071 | } |
---|
2822 | 3072 | |
---|
2823 | 3073 | //group.addSelectee(child); |
---|
.. | .. |
---|
2886 | 3136 | cameraView.ToggleDL(); |
---|
2887 | 3137 | cameraView.repaint(); |
---|
2888 | 3138 | return; |
---|
2889 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3139 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2890 | 3140 | { |
---|
2891 | 3141 | cameraView.ToggleTexture(); |
---|
2892 | 3142 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
2925 | 3175 | frame.validate(); |
---|
2926 | 3176 | |
---|
2927 | 3177 | return; |
---|
2928 | | - } else if (event.getSource() == toggleSwitchItem) |
---|
| 3178 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
2929 | 3179 | { |
---|
2930 | 3180 | cameraView.ToggleSwitch(); |
---|
2931 | 3181 | cameraView.repaint(); |
---|
.. | .. |
---|
3214 | 3464 | objEditor.refreshContents(); |
---|
3215 | 3465 | } |
---|
3216 | 3466 | |
---|
3217 | | - static public byte[] Compress(Object o) |
---|
| 3467 | + static public byte[] Compress(Object3D o) |
---|
3218 | 3468 | { |
---|
3219 | 3469 | try |
---|
3220 | 3470 | { |
---|
.. | .. |
---|
3222 | 3472 | java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
3223 | 3473 | ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
3224 | 3474 | |
---|
| 3475 | + Object3D parent = o.parent; |
---|
| 3476 | + o.parent = null; |
---|
| 3477 | + |
---|
3225 | 3478 | out.writeObject(o); |
---|
3226 | 3479 | |
---|
| 3480 | + o.parent = parent; |
---|
| 3481 | + |
---|
3227 | 3482 | out.flush(); |
---|
3228 | 3483 | |
---|
3229 | 3484 | zstream.close(); |
---|
.. | .. |
---|
3304 | 3559 | |
---|
3305 | 3560 | public void Save() |
---|
3306 | 3561 | { |
---|
| 3562 | + System.err.println("Save"); |
---|
| 3563 | + |
---|
3307 | 3564 | cRadio tab = GetCurrentTab(); |
---|
| 3565 | + |
---|
| 3566 | + boolean temp = CameraPane.SWITCH; |
---|
| 3567 | + CameraPane.SWITCH = false; |
---|
3308 | 3568 | |
---|
3309 | 3569 | copy.ExtractBigData(hashtable); |
---|
3310 | 3570 | |
---|
| 3571 | + byte[] compress = Compress(copy); |
---|
| 3572 | + |
---|
3311 | 3573 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3312 | | - tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3574 | + tab.graphs[tab.undoindex++] = compress; |
---|
3313 | 3575 | |
---|
3314 | 3576 | copy.RestoreBigData(hashtable); |
---|
| 3577 | + |
---|
| 3578 | + CameraPane.SWITCH = temp; |
---|
3315 | 3579 | |
---|
3316 | 3580 | //assert(hashtable.isEmpty()); |
---|
3317 | 3581 | |
---|
.. | .. |
---|
3320 | 3584 | tab.graphs[i] = null; |
---|
3321 | 3585 | } |
---|
3322 | 3586 | |
---|
| 3587 | + SetUndoStates(); |
---|
| 3588 | + |
---|
3323 | 3589 | // test save |
---|
3324 | 3590 | if (false) |
---|
3325 | 3591 | { |
---|
.. | .. |
---|
3342 | 3608 | |
---|
3343 | 3609 | void CopyChanged(Object3D obj) |
---|
3344 | 3610 | { |
---|
| 3611 | + SetUndoStates(); |
---|
| 3612 | + |
---|
| 3613 | + boolean temp = CameraPane.SWITCH; |
---|
| 3614 | + CameraPane.SWITCH = false; |
---|
| 3615 | + |
---|
3345 | 3616 | copy.ExtractBigData(hashtable); |
---|
3346 | 3617 | |
---|
3347 | 3618 | copy.clear(); |
---|
.. | .. |
---|
3352 | 3623 | } |
---|
3353 | 3624 | |
---|
3354 | 3625 | copy.RestoreBigData(hashtable); |
---|
| 3626 | + |
---|
| 3627 | + CameraPane.SWITCH = temp; |
---|
3355 | 3628 | |
---|
3356 | 3629 | //assert(hashtable.isEmpty()); |
---|
3357 | 3630 | |
---|
.. | .. |
---|
3376 | 3649 | refreshContents(); |
---|
3377 | 3650 | } |
---|
3378 | 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); |
---|
| 3661 | + } |
---|
| 3662 | + |
---|
3379 | 3663 | public void Undo() |
---|
3380 | 3664 | { |
---|
| 3665 | + System.err.println("Undo"); |
---|
| 3666 | + |
---|
3381 | 3667 | cRadio tab = GetCurrentTab(); |
---|
3382 | 3668 | |
---|
3383 | 3669 | if (tab.undoindex == 0) |
---|
.. | .. |
---|
3561 | 3847 | assert false; |
---|
3562 | 3848 | } |
---|
3563 | 3849 | |
---|
3564 | | - void EditSelection() |
---|
| 3850 | + void EditSelection(boolean newWindow) |
---|
3565 | 3851 | { |
---|
3566 | 3852 | } |
---|
3567 | 3853 | |
---|
.. | .. |
---|
4056 | 4342 | |
---|
4057 | 4343 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4058 | 4344 | { |
---|
4059 | | - Save(); |
---|
| 4345 | + if (Globals.SAVEONMAKE) // && resetmodel) |
---|
| 4346 | + Save(); |
---|
4060 | 4347 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4061 | 4348 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
4062 | 4349 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
4143 | 4430 | { |
---|
4144 | 4431 | ResetModel(); |
---|
4145 | 4432 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4433 | + |
---|
| 4434 | + if (thing.Size() == 0) |
---|
| 4435 | + { |
---|
| 4436 | + //EditSelection(false); |
---|
| 4437 | + } |
---|
| 4438 | + |
---|
4146 | 4439 | refreshContents(); |
---|
4147 | 4440 | } |
---|
4148 | 4441 | |
---|
.. | .. |
---|
4280 | 4573 | |
---|
4281 | 4574 | try |
---|
4282 | 4575 | { |
---|
| 4576 | + // Try compressed version first. |
---|
4283 | 4577 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4284 | 4578 | java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
4285 | 4579 | java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
.. | .. |
---|
4349 | 4643 | |
---|
4350 | 4644 | void LoadIt(Object obj) |
---|
4351 | 4645 | { |
---|
| 4646 | + if (obj == null) |
---|
| 4647 | + { |
---|
| 4648 | + // Invalid file |
---|
| 4649 | + return; |
---|
| 4650 | + } |
---|
| 4651 | + |
---|
4352 | 4652 | System.out.println("Loaded " + obj); |
---|
4353 | 4653 | //new Exception().printStackTrace(); |
---|
4354 | 4654 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4358 | 4658 | |
---|
4359 | 4659 | if (readobj != null) |
---|
4360 | 4660 | { |
---|
| 4661 | + if (Globals.SAVEONMAKE) |
---|
4361 | 4662 | Save(); |
---|
4362 | 4663 | try |
---|
4363 | 4664 | { |
---|
.. | .. |
---|
4536 | 4837 | String filename = browser.getFile(); |
---|
4537 | 4838 | if (filename != null && filename.length() > 0) |
---|
4538 | 4839 | { |
---|
| 4840 | + if (!filename.endsWith(".gfd")) |
---|
| 4841 | + filename += ".gfd"; |
---|
4539 | 4842 | lastname = browser.getDirectory() + filename; |
---|
4540 | 4843 | save(); |
---|
4541 | 4844 | } |
---|
.. | .. |
---|
4729 | 5032 | CheckboxMenuItem togglePaintItem; |
---|
4730 | 5033 | JSplitPane mainPanel; |
---|
4731 | 5034 | JScrollPane scrollpane; |
---|
| 5035 | + |
---|
4732 | 5036 | JPanel toolbarPanel; |
---|
| 5037 | + |
---|
4733 | 5038 | cGridBag treePanel; |
---|
| 5039 | + |
---|
4734 | 5040 | JPanel radioPanel; |
---|
4735 | 5041 | ButtonGroup buttonGroup; |
---|
4736 | | - cGridBag ctrlPanel; |
---|
| 5042 | + |
---|
| 5043 | + cGridBag toolboxPanel; |
---|
4737 | 5044 | cGridBag materialPanel; |
---|
| 5045 | + cGridBag ctrlPanel; |
---|
| 5046 | + |
---|
4738 | 5047 | JScrollPane infoPanel; |
---|
| 5048 | + |
---|
4739 | 5049 | cGridBag optionsPanel; |
---|
| 5050 | + |
---|
4740 | 5051 | JTabbedPane objectPanel; |
---|
| 5052 | + boolean materialFlushed; |
---|
| 5053 | + Object3D latestObject; |
---|
| 5054 | + |
---|
4741 | 5055 | cGridBag XYZPanel; |
---|
| 5056 | + |
---|
4742 | 5057 | JSplitPane gridPanel; |
---|
4743 | 5058 | JSplitPane bigPanel; |
---|
| 5059 | + |
---|
4744 | 5060 | cGridBag bigThree; |
---|
4745 | 5061 | cGridBag scenePanel; |
---|
4746 | 5062 | cGridBag centralPanel; |
---|
.. | .. |
---|
4855 | 5171 | cNumberSlider fogField; |
---|
4856 | 5172 | JLabel opacityPowerLabel; |
---|
4857 | 5173 | cNumberSlider opacityPowerField; |
---|
4858 | | - JTree jTree; |
---|
| 5174 | + cTree jTree; |
---|
4859 | 5175 | //ObjectUI parent; |
---|
4860 | 5176 | |
---|
4861 | 5177 | cNumberSlider normalpushField; |
---|