.. | .. |
---|
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. |
---|
.. | .. |
---|
38 | 41 | JFrame frame; |
---|
39 | 42 | |
---|
40 | 43 | static ObjEditor theFrame; |
---|
| 44 | + |
---|
| 45 | + public cGridBag GetSeparator() |
---|
| 46 | + { |
---|
| 47 | + cGridBag separator = new cGridBag(); |
---|
| 48 | + separator.add(new JSeparator()); |
---|
| 49 | + separator.preferredHeight = 5; |
---|
| 50 | + return separator; |
---|
| 51 | + } |
---|
41 | 52 | |
---|
42 | 53 | cButton GetButton(String name, boolean border) |
---|
43 | 54 | { |
---|
44 | | - try |
---|
45 | | - { |
---|
46 | | - ImageIcon icon = GetIcon(name); |
---|
47 | | - return new cButton(icon, border); |
---|
48 | | - } |
---|
49 | | - catch (Exception e) |
---|
50 | | - { |
---|
51 | | - return new cButton(name, border); |
---|
52 | | - } |
---|
| 55 | + ImageIcon icon = GetIcon(name); |
---|
| 56 | + return new cButton(icon, border); |
---|
| 57 | + } |
---|
| 58 | + |
---|
| 59 | + cLabel GetLabel(String name, boolean border) |
---|
| 60 | + { |
---|
| 61 | + //ImageIcon icon = GetIcon(name); |
---|
| 62 | + return new cLabel(GetImage(name), border); |
---|
53 | 63 | } |
---|
54 | 64 | |
---|
55 | 65 | cToggleButton GetToggleButton(String name, boolean border) |
---|
56 | 66 | { |
---|
57 | | - try |
---|
58 | | - { |
---|
59 | | - ImageIcon icon = GetIcon(name); |
---|
60 | | - return new cToggleButton(icon, border); |
---|
61 | | - } |
---|
62 | | - catch (Exception e) |
---|
63 | | - { |
---|
64 | | - return new cToggleButton(name, border); |
---|
65 | | - } |
---|
| 67 | + ImageIcon icon = GetIcon(name); |
---|
| 68 | + return new cToggleButton(icon, border); |
---|
66 | 69 | } |
---|
67 | 70 | |
---|
68 | 71 | cCheckBox GetCheckBox(String name, boolean border) |
---|
69 | 72 | { |
---|
| 73 | + ImageIcon icon = GetIcon(name); |
---|
| 74 | + return new cCheckBox(icon, border); |
---|
| 75 | + } |
---|
| 76 | + |
---|
| 77 | + ImageIcon GetIcon(String name) |
---|
| 78 | + { |
---|
70 | 79 | try |
---|
71 | 80 | { |
---|
72 | | - ImageIcon icon = GetIcon(name); |
---|
73 | | - return new cCheckBox(icon, border); |
---|
| 81 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 82 | + |
---|
| 83 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 84 | +// { |
---|
| 85 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 86 | +// Graphics2D g = resized.createGraphics(); |
---|
| 87 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 88 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 89 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 90 | +// g.dispose(); |
---|
| 91 | +// |
---|
| 92 | +// image = resized; |
---|
| 93 | +// } |
---|
| 94 | + |
---|
| 95 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 96 | + return icon; |
---|
74 | 97 | } |
---|
75 | 98 | catch (Exception e) |
---|
76 | 99 | { |
---|
77 | | - return new cCheckBox(name, border); |
---|
| 100 | + return null; |
---|
78 | 101 | } |
---|
79 | 102 | } |
---|
80 | | - |
---|
81 | | - private ImageIcon GetIcon(String name) throws IOException |
---|
| 103 | + |
---|
| 104 | + BufferedImage GetImage(String name) |
---|
82 | 105 | { |
---|
83 | | - BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
84 | | - |
---|
85 | | - if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 106 | + try |
---|
86 | 107 | { |
---|
87 | | - BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
88 | | - Graphics2D g = resized.createGraphics(); |
---|
89 | | - g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
90 | | - //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
91 | | - g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
92 | | - g.dispose(); |
---|
93 | | - |
---|
94 | | - image = resized; |
---|
| 108 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 109 | + |
---|
| 110 | + return image; |
---|
95 | 111 | } |
---|
96 | | - |
---|
97 | | - javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
98 | | - return icon; |
---|
| 112 | + catch (Exception e) |
---|
| 113 | + { |
---|
| 114 | + return null; |
---|
| 115 | + } |
---|
99 | 116 | } |
---|
100 | 117 | |
---|
101 | 118 | // SCRIPT |
---|
.. | .. |
---|
279 | 296 | client = inClient; |
---|
280 | 297 | copy = client; |
---|
281 | 298 | |
---|
| 299 | + if (copy.versionlist == null) |
---|
| 300 | + { |
---|
| 301 | + copy.versionlist = new Object3D[100]; |
---|
| 302 | + copy.versionindex = -1; |
---|
| 303 | + } |
---|
| 304 | + |
---|
282 | 305 | // "this" is not called: SetupUI2(objEditor); |
---|
283 | 306 | } |
---|
284 | 307 | |
---|
.. | .. |
---|
292 | 315 | client = inClient; |
---|
293 | 316 | copy = client; |
---|
294 | 317 | |
---|
| 318 | + if (copy.versionlist == null) |
---|
| 319 | + { |
---|
| 320 | + copy.versionlist = new Object3D[100]; |
---|
| 321 | + copy.versionindex = -1; |
---|
| 322 | + } |
---|
| 323 | + |
---|
295 | 324 | SetupUI2(callee.GetEditor()); |
---|
296 | 325 | } |
---|
297 | 326 | |
---|
.. | .. |
---|
306 | 335 | //localCopy.parent = null; |
---|
307 | 336 | |
---|
308 | 337 | frame = new JFrame(); |
---|
309 | | - frame.setUndecorated(true); |
---|
| 338 | + frame.setUndecorated(false); |
---|
310 | 339 | objEditor = this; |
---|
311 | 340 | this.callee = callee; |
---|
312 | 341 | |
---|
.. | .. |
---|
324 | 353 | copy = localCopy; |
---|
325 | 354 | copy.editWindow = this; |
---|
326 | 355 | |
---|
| 356 | + if (copy.versionlist == null) |
---|
| 357 | + { |
---|
| 358 | +// copy.versions = new byte[100][]; |
---|
| 359 | +// copy.versionindex = -1; |
---|
| 360 | + } |
---|
| 361 | + |
---|
327 | 362 | SetupMenu(); |
---|
328 | 363 | |
---|
329 | 364 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
347 | 382 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
348 | 383 | menuBar.add(fileMenu = new Menu("File")); |
---|
349 | 384 | fileMenu.add(newItem = new MenuItem("New")); |
---|
350 | | - fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
| 385 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
351 | 386 | |
---|
352 | 387 | //oe.menuBar.add(menu = new Menu("Include")); |
---|
353 | 388 | Menu menu = new Menu("Import"); |
---|
.. | .. |
---|
379 | 414 | } |
---|
380 | 415 | |
---|
381 | 416 | newItem.addActionListener(this); |
---|
382 | | - loadItem.addActionListener(this); |
---|
| 417 | + openItem.addActionListener(this); |
---|
383 | 418 | saveItem.addActionListener(this); |
---|
384 | 419 | saveAsItem.addActionListener(this); |
---|
385 | 420 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
416 | 451 | |
---|
417 | 452 | toolbarPanel = new JPanel(); |
---|
418 | 453 | toolbarPanel.setName("Toolbar"); |
---|
| 454 | + |
---|
419 | 455 | treePanel = new cGridBag(); |
---|
420 | 456 | treePanel.setName("Tree"); |
---|
421 | 457 | |
---|
422 | 458 | editPanel = new cGridBag().setVertical(true); |
---|
423 | | - editPanel.setName("Edit"); |
---|
| 459 | + //editPanel.setName("Edit"); |
---|
424 | 460 | |
---|
425 | 461 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
426 | 462 | |
---|
.. | .. |
---|
428 | 464 | editPanel.add(editCommandsPanel); |
---|
429 | 465 | editPanel.add(ctrlPanel); |
---|
430 | 466 | |
---|
431 | | - toolboxPanel = new cGridBag().setVertical(false); |
---|
432 | | - toolboxPanel.setName("Toolbox"); |
---|
| 467 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 468 | + //toolboxPanel.setName("Toolbox"); |
---|
433 | 469 | |
---|
434 | | - materialPanel = new cGridBag().setVertical(true); |
---|
435 | | - materialPanel.setName("Material"); |
---|
| 470 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 471 | + //materialPanel.setName("Material"); |
---|
436 | 472 | |
---|
437 | 473 | /*JTextPane*/ |
---|
438 | 474 | infoarea = createTextPane(); |
---|
.. | .. |
---|
440 | 476 | |
---|
441 | 477 | infoarea.setEditable(true); |
---|
442 | 478 | SetText(); |
---|
| 479 | + |
---|
443 | 480 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
444 | 481 | // infoarea.setOpaque(false); |
---|
445 | 482 | // //infoarea.setForeground(textcolor); |
---|
446 | 483 | // TEXTAREA infoarea.setLineWrap(true); |
---|
447 | 484 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
448 | 485 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
449 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
450 | | - infoPanel.setName("Info"); |
---|
| 486 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
| 487 | + //infoPanel.setName("Info"); |
---|
451 | 488 | //infoPanel.setLayout(new BorderLayout()); |
---|
452 | 489 | //infoPanel.add(createTextPane()); |
---|
453 | 490 | |
---|
.. | .. |
---|
458 | 495 | mainPanel.setDividerSize(9); |
---|
459 | 496 | mainPanel.setDividerLocation(0.5); //1.0); |
---|
460 | 497 | mainPanel.setResizeWeight(0.5); |
---|
461 | | - |
---|
| 498 | + |
---|
| 499 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 500 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 501 | + divider.setDividerSize(15); |
---|
| 502 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 503 | + |
---|
| 504 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 505 | + |
---|
462 | 506 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
463 | 507 | //mainPanel.setLayout(new GridBagLayout()); |
---|
464 | 508 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
.. | .. |
---|
689 | 733 | } |
---|
690 | 734 | } |
---|
691 | 735 | |
---|
692 | | -static GraphicsDevice device = GraphicsEnvironment |
---|
693 | | - .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 736 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 737 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
694 | 738 | |
---|
695 | 739 | Rectangle keeprect; |
---|
696 | 740 | cRadio radio; |
---|
.. | .. |
---|
711 | 755 | void Minimize() |
---|
712 | 756 | { |
---|
713 | 757 | frame.setState(Frame.ICONIFIED); |
---|
| 758 | + frame.validate(); |
---|
714 | 759 | } |
---|
715 | 760 | |
---|
| 761 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 762 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 763 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
716 | 764 | void Maximize() |
---|
717 | 765 | { |
---|
| 766 | + if (CameraPane.FULLSCREEN) |
---|
| 767 | + { |
---|
| 768 | + ToggleFullScreen(); |
---|
| 769 | + } |
---|
| 770 | + |
---|
718 | 771 | if (maximized) |
---|
719 | 772 | { |
---|
720 | 773 | frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
.. | .. |
---|
722 | 775 | else |
---|
723 | 776 | { |
---|
724 | 777 | keeprect = frame.getBounds(); |
---|
725 | | - Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
726 | | - Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
727 | | - frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 778 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 779 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 780 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
728 | 781 | // frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 782 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
729 | 783 | } |
---|
730 | 784 | |
---|
731 | 785 | maximized ^= true; |
---|
| 786 | + |
---|
| 787 | + frame.validate(); |
---|
732 | 788 | } |
---|
| 789 | + |
---|
| 790 | + cButton minButton; |
---|
| 791 | + cButton maxButton; |
---|
| 792 | + cButton fullButton; |
---|
733 | 793 | |
---|
734 | 794 | void ToggleFullScreen() |
---|
735 | 795 | { |
---|
| 796 | +GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 797 | + |
---|
736 | 798 | cameraView.ToggleFullScreen(); |
---|
737 | 799 | |
---|
738 | 800 | if (!CameraPane.FULLSCREEN) |
---|
739 | 801 | { |
---|
740 | 802 | device.setFullScreenWindow(null); |
---|
| 803 | + frame.dispose(); |
---|
| 804 | + frame.setUndecorated(false); |
---|
| 805 | + frame.validate(); |
---|
| 806 | + frame.setVisible(true); |
---|
| 807 | + |
---|
741 | 808 | //frame.setVisible(false); |
---|
742 | 809 | // frame.removeNotify(); |
---|
743 | 810 | // frame.setUndecorated(false); |
---|
.. | .. |
---|
747 | 814 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
748 | 815 | // X framePanel.add(bigThree); |
---|
749 | 816 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
750 | | - framePanel.setDividerLocation(1); |
---|
| 817 | + framePanel.setDividerLocation(46); |
---|
751 | 818 | |
---|
752 | 819 | //frame.setVisible(true); |
---|
753 | 820 | radio.layout = keepButton; |
---|
.. | .. |
---|
762 | 829 | // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
763 | 830 | // frame.getToolkit().getScreenSize().height); |
---|
764 | 831 | //frame.setVisible(false); |
---|
| 832 | + |
---|
| 833 | + frame.dispose(); |
---|
| 834 | + frame.setUndecorated(true); |
---|
765 | 835 | device.setFullScreenWindow(frame); |
---|
| 836 | + frame.validate(); |
---|
| 837 | + frame.setVisible(true); |
---|
766 | 838 | // frame.removeNotify(); |
---|
767 | 839 | // frame.setUndecorated(true); |
---|
768 | 840 | // frame.addNotify(); |
---|
.. | .. |
---|
775 | 847 | radio.layout.doClick(); |
---|
776 | 848 | //frame.setVisible(true); |
---|
777 | 849 | } |
---|
| 850 | + frame.validate(); |
---|
778 | 851 | } |
---|
| 852 | + |
---|
| 853 | + private Object3D CompressCopy() |
---|
| 854 | + { |
---|
| 855 | + boolean temp = CameraPane.SWITCH; |
---|
| 856 | + CameraPane.SWITCH = false; |
---|
| 857 | + |
---|
| 858 | + copy.ExtractBigData(versiontable); |
---|
| 859 | + // if (copy == client) |
---|
| 860 | + |
---|
| 861 | + Object3D versions[] = copy.versionlist; |
---|
| 862 | + copy.versionlist = null; |
---|
| 863 | + |
---|
| 864 | + //byte[] compress = Compress(copy); |
---|
| 865 | + Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
| 866 | + |
---|
| 867 | + copy.versionlist = versions; |
---|
| 868 | + |
---|
| 869 | + copy.RestoreBigData(versiontable); |
---|
| 870 | + |
---|
| 871 | + CameraPane.SWITCH = temp; |
---|
| 872 | + |
---|
| 873 | + return compress; |
---|
| 874 | + } |
---|
779 | 875 | |
---|
780 | 876 | private JTextPane createTextPane() |
---|
781 | 877 | { |
---|
.. | .. |
---|
898 | 994 | { |
---|
899 | 995 | SetupMaterial(materialPanel); |
---|
900 | 996 | } |
---|
| 997 | + |
---|
901 | 998 | //SetupName(); |
---|
902 | 999 | //SetupViews(); |
---|
903 | 1000 | } |
---|
.. | .. |
---|
907 | 1004 | // NumberSlider vDivsField; |
---|
908 | 1005 | // JCheckBox endcaps; |
---|
909 | 1006 | JCheckBox liveCB; |
---|
910 | | - JCheckBox selectCB; |
---|
| 1007 | + JCheckBox selectableCB; |
---|
911 | 1008 | JCheckBox hideCB; |
---|
912 | 1009 | JCheckBox link2masterCB; |
---|
913 | 1010 | JCheckBox markCB; |
---|
.. | .. |
---|
1107 | 1204 | namePanel = new cGridBag(); |
---|
1108 | 1205 | |
---|
1109 | 1206 | nameField = AddText(namePanel, copy.GetName()); |
---|
1110 | | - namePanel.add(nameField); |
---|
| 1207 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1111 | 1208 | oe.ctrlPanel.add(namePanel); |
---|
1112 | 1209 | |
---|
1113 | 1210 | oe.ctrlPanel.Return(); |
---|
.. | .. |
---|
1119 | 1216 | |
---|
1120 | 1217 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1121 | 1218 | liveCB.setToolTipText("Animate object"); |
---|
1122 | | - selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1123 | | - selectCB.setToolTipText("Make object selectable"); |
---|
| 1219 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1220 | + selectableCB.setToolTipText("Make object selectable"); |
---|
1124 | 1221 | // Return(); |
---|
| 1222 | + |
---|
1125 | 1223 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1126 | 1224 | hideCB.setToolTipText("Hide object"); |
---|
1127 | 1225 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1128 | | - markCB.setToolTipText("Set the animation target transform"); |
---|
| 1226 | + markCB.setToolTipText("As animation target transform"); |
---|
| 1227 | + |
---|
| 1228 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1129 | 1229 | |
---|
1130 | 1230 | setupPanel2 = new cGridBag().setVertical(false); |
---|
1131 | 1231 | |
---|
1132 | 1232 | rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
1133 | 1233 | rewindCB.setToolTipText("Rewind animation"); |
---|
1134 | 1234 | |
---|
1135 | | - randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
1136 | | - randomCB.setToolTipText("Randomly Rewind or Go back and forth"); |
---|
| 1235 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1236 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
1137 | 1237 | |
---|
| 1238 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1239 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1240 | + |
---|
1138 | 1241 | if (Globals.ADVANCED) |
---|
1139 | 1242 | { |
---|
1140 | | - link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
1141 | | - link2masterCB.setToolTipText("Attach to support"); |
---|
1142 | 1243 | speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
1143 | 1244 | speedupCB.setToolTipText("Option motion capture"); |
---|
1144 | 1245 | } |
---|
.. | .. |
---|
1412 | 1513 | XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1413 | 1514 | XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1414 | 1515 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1516 | + //XYZPanel.setName("XYZ"); |
---|
1415 | 1517 | |
---|
1416 | 1518 | /* |
---|
1417 | 1519 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1449 | 1551 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1450 | 1552 | //tmp.setName("Edit"); |
---|
1451 | 1553 | objectPanel.add(materialPanel); |
---|
| 1554 | + objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1555 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1556 | + |
---|
1452 | 1557 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1453 | 1558 | // north.setName("Edit"); |
---|
1454 | 1559 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1455 | 1560 | // objectPanel.add(north); |
---|
1456 | 1561 | objectPanel.add(editPanel); |
---|
1457 | | - objectPanel.add(infoPanel); |
---|
| 1562 | + objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
| 1563 | + objectPanel.setToolTipTextAt(1, "Edit controls"); |
---|
| 1564 | + |
---|
| 1565 | + //if (Globals.ADVANCED) |
---|
| 1566 | + objectPanel.add(infoPanel); |
---|
| 1567 | + objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
| 1568 | + objectPanel.setToolTipTextAt(2, "Information"); |
---|
| 1569 | + |
---|
| 1570 | + objectPanel.add(XYZPanel); |
---|
| 1571 | + objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
| 1572 | + objectPanel.setToolTipTextAt(3, "XYZ/RGB transform"); |
---|
| 1573 | + |
---|
1458 | 1574 | objectPanel.add(toolboxPanel); |
---|
| 1575 | + objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
| 1576 | + objectPanel.setToolTipTextAt(4, "Objects & backgrounds"); |
---|
1459 | 1577 | |
---|
1460 | 1578 | /* |
---|
1461 | 1579 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1476 | 1594 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1477 | 1595 | |
---|
1478 | 1596 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1479 | | - scenePanel.preferredWidth = 6; |
---|
| 1597 | + scenePanel.preferredWidth = 5; |
---|
1480 | 1598 | |
---|
1481 | 1599 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1482 | 1600 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1554 | 1672 | bigThree = new cGridBag(); |
---|
1555 | 1673 | bigThree.addComponent(scenePanel); |
---|
1556 | 1674 | bigThree.addComponent(centralPanel); |
---|
1557 | | - bigThree.addComponent(XYZPanel); |
---|
| 1675 | + //bigThree.addComponent(XYZPanel); |
---|
1558 | 1676 | |
---|
1559 | 1677 | // // SIDE EFFECT!!! |
---|
1560 | 1678 | // aConstraints.gridx = 0; |
---|
.. | .. |
---|
1563 | 1681 | // aConstraints.gridheight = 1; |
---|
1564 | 1682 | |
---|
1565 | 1683 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1566 | | - framePanel.setContinuousLayout(true); |
---|
1567 | | - framePanel.setOneTouchExpandable(true); |
---|
1568 | | - framePanel.setDividerLocation(0.8); |
---|
| 1684 | + framePanel.setContinuousLayout(false); |
---|
| 1685 | + framePanel.setOneTouchExpandable(false); |
---|
| 1686 | + //.setDividerLocation(0.8); |
---|
1569 | 1687 | //framePanel.setDividerSize(15); |
---|
1570 | 1688 | //framePanel.setResizeWeight(0.15); |
---|
1571 | 1689 | framePanel.setName("Frame"); |
---|
.. | .. |
---|
1584 | 1702 | |
---|
1585 | 1703 | frame.setSize(1280, 860); |
---|
1586 | 1704 | |
---|
1587 | | - frame.validate(); |
---|
1588 | | - frame.setVisible(true); |
---|
1589 | | - |
---|
1590 | 1705 | cameraView.requestFocusInWindow(); |
---|
1591 | 1706 | |
---|
1592 | 1707 | gridPanel.setDividerLocation(1.0); |
---|
| 1708 | + |
---|
| 1709 | + frame.validate(); |
---|
| 1710 | + |
---|
| 1711 | + frame.setVisible(true); |
---|
1593 | 1712 | |
---|
1594 | 1713 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1595 | 1714 | frame.addWindowListener(new WindowAdapter() |
---|
1596 | 1715 | { |
---|
1597 | | - |
---|
1598 | 1716 | public void windowClosing(WindowEvent e) |
---|
1599 | 1717 | { |
---|
1600 | 1718 | Close(); |
---|
.. | .. |
---|
1617 | 1735 | ctrlPanel.removeAll(); |
---|
1618 | 1736 | } |
---|
1619 | 1737 | |
---|
1620 | | - void SetupMaterial(cGridBag panel) |
---|
| 1738 | + void SetupMaterial(cGridBag materialpanel) |
---|
1621 | 1739 | { |
---|
1622 | | - /* |
---|
| 1740 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1741 | + cLabel label = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1742 | + label.addMouseListener(new MouseAdapter() |
---|
| 1743 | + { |
---|
| 1744 | + public void mouseClicked(MouseEvent e) |
---|
| 1745 | + { |
---|
| 1746 | + colorField.setFloat(0); |
---|
| 1747 | + saturationField.setFloat(1); |
---|
| 1748 | + materialtouched = true; |
---|
| 1749 | + applySelf(); |
---|
| 1750 | + } |
---|
| 1751 | + }); |
---|
| 1752 | + presetpanel.add(label); |
---|
| 1753 | + |
---|
| 1754 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF)); |
---|
| 1755 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF)); |
---|
| 1756 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF)); |
---|
| 1757 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF)); |
---|
| 1758 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF)); |
---|
| 1759 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF)); |
---|
| 1760 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF)); |
---|
| 1761 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF)); |
---|
| 1762 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF)); |
---|
| 1763 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF)); |
---|
| 1764 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF)); |
---|
| 1765 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF)); |
---|
| 1766 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF)); |
---|
| 1767 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF)); |
---|
| 1768 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF)); |
---|
| 1769 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF)); |
---|
| 1770 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF)); |
---|
| 1771 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF)); |
---|
| 1772 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00019.png", !Grafreed.NIMBUSLAF)); |
---|
| 1773 | + presetpanel.add(GetLabel("icons/shadericons/shadericon00020.png", !Grafreed.NIMBUSLAF)); |
---|
| 1774 | + |
---|
| 1775 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 1776 | + |
---|
| 1777 | + presetpanel.preferredWidth = 1; |
---|
| 1778 | + |
---|
| 1779 | + materialpanel.add(panel); |
---|
| 1780 | + materialpanel.add(presetpanel); |
---|
| 1781 | + |
---|
| 1782 | + panel.preferredWidth = 8; |
---|
| 1783 | + |
---|
| 1784 | + /* |
---|
1623 | 1785 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1624 | 1786 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1625 | | - */ |
---|
| 1787 | + */ |
---|
1626 | 1788 | |
---|
1627 | 1789 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1628 | 1790 | |
---|
.. | .. |
---|
1656 | 1818 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1657 | 1819 | |
---|
1658 | 1820 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1821 | + |
---|
| 1822 | + cGridBag huepanel = new cGridBag(); |
---|
| 1823 | + cGridBag huelabel = new cGridBag(); |
---|
| 1824 | + label = GetLabel("icons/hue.png", false); |
---|
| 1825 | + label.fit = true; |
---|
| 1826 | + huelabel.add(label); |
---|
| 1827 | + huelabel.preferredWidth = 20; |
---|
| 1828 | + huepanel.add(new cGridBag()); // Label |
---|
| 1829 | + huepanel.add(huelabel); // Field/slider |
---|
| 1830 | + |
---|
| 1831 | + huepanel.preferredHeight = 7; |
---|
| 1832 | + |
---|
| 1833 | + colorSection.add(huepanel); |
---|
1659 | 1834 | |
---|
1660 | 1835 | cGridBag color = new cGridBag(); |
---|
1661 | | - color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
1662 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1663 | | - color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1836 | + |
---|
| 1837 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1838 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1839 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1840 | + |
---|
1664 | 1841 | //colorField.preferredWidth = 200; |
---|
1665 | 1842 | colorSection.add(color); |
---|
1666 | 1843 | |
---|
1667 | 1844 | cGridBag modulation = new cGridBag(); |
---|
1668 | 1845 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1669 | 1846 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1670 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1847 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1671 | 1848 | colorSection.add(modulation); |
---|
1672 | 1849 | |
---|
| 1850 | + cGridBag opacity = new cGridBag(); |
---|
| 1851 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1852 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1853 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1854 | + colorSection.add(opacity); |
---|
| 1855 | + |
---|
| 1856 | + colorSection.add(GetSeparator()); |
---|
| 1857 | + |
---|
1673 | 1858 | cGridBag texture = new cGridBag(); |
---|
1674 | 1859 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1675 | 1860 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1676 | 1861 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1677 | 1862 | colorSection.add(texture); |
---|
1678 | 1863 | |
---|
1679 | | - cGridBag anisoU = new cGridBag(); |
---|
1680 | | - anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
1681 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1682 | | - anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1683 | | - colorSection.add(anisoU); |
---|
1684 | | - |
---|
1685 | | - cGridBag anisoV = new cGridBag(); |
---|
1686 | | - anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
1687 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1688 | | - anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1689 | | - colorSection.add(anisoV); |
---|
1690 | | - |
---|
1691 | | - cGridBag shadowbias = new cGridBag(); |
---|
1692 | | - shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
1693 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1694 | | - shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1695 | | - colorSection.add(shadowbias); |
---|
1696 | | - |
---|
1697 | | - panel.add(new JSeparator()); |
---|
| 1864 | + panel.add(GetSeparator()); |
---|
1698 | 1865 | |
---|
1699 | 1866 | panel.add(colorSection); |
---|
1700 | 1867 | |
---|
.. | .. |
---|
1744 | 1911 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1745 | 1912 | diffuseSection.add(fakedepth); |
---|
1746 | 1913 | |
---|
1747 | | - panel.add(new JSeparator()); |
---|
| 1914 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1915 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1916 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1917 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1918 | + diffuseSection.add(shadowbias); |
---|
| 1919 | + |
---|
| 1920 | + panel.add(GetSeparator()); |
---|
1748 | 1921 | |
---|
1749 | 1922 | panel.add(diffuseSection); |
---|
1750 | 1923 | |
---|
.. | .. |
---|
1794 | 1967 | // aConstraints.gridy += 1; |
---|
1795 | 1968 | // aConstraints.gridwidth = 1; |
---|
1796 | 1969 | |
---|
| 1970 | + cGridBag anisoU = new cGridBag(); |
---|
| 1971 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1972 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1973 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1974 | + specularSection.add(anisoU); |
---|
1797 | 1975 | |
---|
1798 | | - panel.add(new JSeparator()); |
---|
| 1976 | + cGridBag anisoV = new cGridBag(); |
---|
| 1977 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1978 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1979 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1980 | + specularSection.add(anisoV); |
---|
| 1981 | + |
---|
| 1982 | + |
---|
| 1983 | + panel.add(GetSeparator()); |
---|
1799 | 1984 | |
---|
1800 | 1985 | panel.add(specularSection); |
---|
1801 | 1986 | |
---|
1802 | 1987 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1803 | 1988 | |
---|
1804 | | - cGridBag globalSection = new cGridBag().setVertical(true); |
---|
| 1989 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1805 | 1990 | |
---|
1806 | 1991 | cGridBag camera = new cGridBag(); |
---|
1807 | 1992 | camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
1808 | 1993 | cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1809 | 1994 | camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1810 | | - globalSection.add(camera); |
---|
| 1995 | + colorSection.add(camera); |
---|
1811 | 1996 | |
---|
1812 | 1997 | cGridBag ambient = new cGridBag(); |
---|
1813 | 1998 | ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
1814 | 1999 | ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1815 | 2000 | ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1816 | | - globalSection.add(ambient); |
---|
| 2001 | + colorSection.add(ambient); |
---|
1817 | 2002 | |
---|
1818 | 2003 | cGridBag backlit = new cGridBag(); |
---|
1819 | 2004 | backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
1820 | 2005 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1821 | 2006 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1822 | | - globalSection.add(backlit); |
---|
| 2007 | + colorSection.add(backlit); |
---|
1823 | 2008 | |
---|
1824 | | - cGridBag opacity = new cGridBag(); |
---|
1825 | | - opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1826 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1827 | | - opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1828 | | - globalSection.add(opacity); |
---|
1829 | | - |
---|
1830 | | - panel.add(new JSeparator()); |
---|
| 2009 | + //panel.add(new JSeparator()); |
---|
1831 | 2010 | |
---|
1832 | | - panel.add(globalSection); |
---|
| 2011 | + //panel.add(globalSection); |
---|
1833 | 2012 | |
---|
1834 | 2013 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1835 | 2014 | |
---|
.. | .. |
---|
1871 | 2050 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1872 | 2051 | textureSection.add(opacityPower); |
---|
1873 | 2052 | |
---|
1874 | | - panel.add(new JSeparator()); |
---|
| 2053 | + panel.add(GetSeparator()); |
---|
1875 | 2054 | |
---|
1876 | 2055 | panel.add(textureSection); |
---|
1877 | 2056 | |
---|
.. | .. |
---|
1936 | 2115 | // 3D models |
---|
1937 | 2116 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1938 | 2117 | { |
---|
1939 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1940 | | - LoadFile(filename, lastConverter); |
---|
| 2118 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2119 | + //LoadFile(filename, lastConverter); |
---|
| 2120 | + LoadObjFile(filename); // New 3ds loader |
---|
1941 | 2121 | continue; |
---|
1942 | 2122 | } |
---|
1943 | 2123 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
2663 | 2843 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2664 | 2844 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2665 | 2845 | } |
---|
| 2846 | + |
---|
2666 | 2847 | //cJME.count++; |
---|
2667 | 2848 | //cJME.count %= 12; |
---|
2668 | 2849 | if (gc) |
---|
.. | .. |
---|
2846 | 3027 | } |
---|
2847 | 3028 | } |
---|
2848 | 3029 | } |
---|
| 3030 | + |
---|
2849 | 3031 | cFileSystemPane FSPane; |
---|
2850 | 3032 | |
---|
2851 | 3033 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2855 | 3037 | |
---|
2856 | 3038 | freezematerial = true; |
---|
2857 | 3039 | colorField.setFloat(mat.color); |
---|
2858 | | - modulationField.setFloat(mat.modulation); |
---|
| 3040 | + saturationField.setFloat(mat.modulation); |
---|
2859 | 3041 | metalnessField.setFloat(mat.metalness); |
---|
2860 | 3042 | diffuseField.setFloat(mat.diffuse); |
---|
2861 | 3043 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
2899 | 3081 | } |
---|
2900 | 3082 | } |
---|
2901 | 3083 | } |
---|
| 3084 | + |
---|
2902 | 3085 | freezematerial = false; |
---|
2903 | 3086 | } |
---|
2904 | 3087 | |
---|
.. | .. |
---|
3017 | 3200 | // } |
---|
3018 | 3201 | |
---|
3019 | 3202 | /**/ |
---|
3020 | | - if (deselect) |
---|
| 3203 | + if (deselect || child == null) |
---|
3021 | 3204 | { |
---|
3022 | 3205 | //group.deselectAll(); |
---|
3023 | 3206 | //freeze = true; |
---|
3024 | 3207 | GetTree().clearSelection(); |
---|
3025 | 3208 | //freeze = false; |
---|
| 3209 | + |
---|
| 3210 | + if (child == null) |
---|
| 3211 | + { |
---|
| 3212 | + return; |
---|
| 3213 | + } |
---|
3026 | 3214 | } |
---|
3027 | 3215 | |
---|
3028 | 3216 | //group.addSelectee(child); |
---|
.. | .. |
---|
3160 | 3348 | } else if (event.getSource() == liveCB) |
---|
3161 | 3349 | { |
---|
3162 | 3350 | copy.live ^= true; |
---|
| 3351 | + objEditor.refreshContents(true); // To show item colors |
---|
3163 | 3352 | return; |
---|
3164 | | - } else if (event.getSource() == selectCB) |
---|
| 3353 | + } else if (event.getSource() == selectableCB) |
---|
3165 | 3354 | { |
---|
3166 | 3355 | copy.dontselect ^= true; |
---|
3167 | 3356 | return; |
---|
.. | .. |
---|
3169 | 3358 | { |
---|
3170 | 3359 | copy.hide ^= true; |
---|
3171 | 3360 | copy.Touch(); // display list issue |
---|
3172 | | - objEditor.refreshContents(); |
---|
| 3361 | + objEditor.refreshContents(true); // To show item colors |
---|
3173 | 3362 | return; |
---|
3174 | 3363 | } else if (event.getSource() == link2masterCB) |
---|
3175 | 3364 | { |
---|
.. | .. |
---|
3346 | 3535 | { |
---|
3347 | 3536 | Close(); |
---|
3348 | 3537 | //return true; |
---|
3349 | | - } else if (source == loadItem) |
---|
| 3538 | + } else if (source == openItem) |
---|
3350 | 3539 | { |
---|
3351 | | - load(); |
---|
| 3540 | + Open(); |
---|
3352 | 3541 | //return true; |
---|
3353 | 3542 | } else if (source == newItem) |
---|
3354 | 3543 | { |
---|
.. | .. |
---|
3373 | 3562 | { |
---|
3374 | 3563 | generatePOV(); |
---|
3375 | 3564 | //return true; |
---|
| 3565 | + } else if (event.getSource() == archiveItem) |
---|
| 3566 | + { |
---|
| 3567 | + cTools.Archive(frame); |
---|
| 3568 | + return; |
---|
3376 | 3569 | } else if (source == zBufferItem) |
---|
3377 | 3570 | { |
---|
3378 | 3571 | try |
---|
.. | .. |
---|
3421 | 3614 | |
---|
3422 | 3615 | static public byte[] Compress(Object3D o) |
---|
3423 | 3616 | { |
---|
| 3617 | + // Slower to actually compress. |
---|
3424 | 3618 | try |
---|
3425 | 3619 | { |
---|
3426 | 3620 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
3427 | | - java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
3428 | | - ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 3621 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3622 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
3429 | 3623 | |
---|
3430 | 3624 | Object3D parent = o.parent; |
---|
3431 | 3625 | o.parent = null; |
---|
.. | .. |
---|
3436 | 3630 | |
---|
3437 | 3631 | out.flush(); |
---|
3438 | 3632 | |
---|
3439 | | - zstream.close(); |
---|
| 3633 | + baos //zstream |
---|
| 3634 | + .close(); |
---|
3440 | 3635 | out.close(); |
---|
3441 | 3636 | |
---|
3442 | | - return baos.toByteArray(); |
---|
| 3637 | + byte[] bytes = baos.toByteArray(); |
---|
| 3638 | + |
---|
| 3639 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 3640 | + return bytes; |
---|
3443 | 3641 | } catch (Exception e) |
---|
3444 | 3642 | { |
---|
3445 | 3643 | System.err.println(e); |
---|
.. | .. |
---|
3449 | 3647 | |
---|
3450 | 3648 | static public Object Uncompress(byte[] bytes) |
---|
3451 | 3649 | { |
---|
3452 | | - System.out.println("#bytes = " + bytes.length); |
---|
| 3650 | + System.out.println("restore #bytes = " + bytes.length); |
---|
3453 | 3651 | try |
---|
3454 | 3652 | { |
---|
3455 | 3653 | ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
3456 | | - java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
3457 | | - ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 3654 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3655 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
3458 | 3656 | Object obj = in.readObject(); |
---|
| 3657 | + |
---|
| 3658 | + bais //istream |
---|
| 3659 | + .close(); |
---|
3459 | 3660 | in.close(); |
---|
3460 | 3661 | |
---|
3461 | 3662 | return obj; |
---|
.. | .. |
---|
3510 | 3711 | return null; |
---|
3511 | 3712 | } |
---|
3512 | 3713 | |
---|
3513 | | - java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3514 | 3714 | |
---|
3515 | 3715 | public void Save() |
---|
3516 | 3716 | { |
---|
| 3717 | + //Save(true); |
---|
| 3718 | + Replace(); |
---|
| 3719 | + SetUndoStates(); |
---|
| 3720 | + } |
---|
| 3721 | + |
---|
| 3722 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 3723 | + { |
---|
| 3724 | + if (compress.length != name.length) |
---|
| 3725 | + { |
---|
| 3726 | + return false; |
---|
| 3727 | + } |
---|
| 3728 | + |
---|
| 3729 | + for (int i=compress.length; --i>=0;) |
---|
| 3730 | + { |
---|
| 3731 | + if (compress[i] != name[i]) |
---|
| 3732 | + return false; |
---|
| 3733 | + } |
---|
| 3734 | + |
---|
| 3735 | + return true; |
---|
| 3736 | + } |
---|
| 3737 | + |
---|
| 3738 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3739 | + |
---|
| 3740 | + public boolean Save(boolean user) |
---|
| 3741 | + { |
---|
3517 | 3742 | System.err.println("Save"); |
---|
| 3743 | + Replace(); |
---|
3518 | 3744 | |
---|
3519 | 3745 | cRadio tab = GetCurrentTab(); |
---|
3520 | 3746 | |
---|
3521 | | - boolean temp = CameraPane.SWITCH; |
---|
3522 | | - CameraPane.SWITCH = false; |
---|
| 3747 | + Object3D compress = CompressCopy(); // Saved version. No need for "Replace". |
---|
3523 | 3748 | |
---|
3524 | | - copy.ExtractBigData(hashtable); |
---|
| 3749 | + boolean thesame = false; |
---|
| 3750 | + |
---|
| 3751 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 3752 | +// { |
---|
| 3753 | +// thesame = true; |
---|
| 3754 | +// } |
---|
3525 | 3755 | |
---|
3526 | 3756 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3527 | | - tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3757 | + if (!thesame) |
---|
| 3758 | + { |
---|
| 3759 | + //tab.user[tab.versionindex] = user; |
---|
| 3760 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 3761 | + |
---|
| 3762 | + copy.versionlist[++copy.versionindex] = compress; |
---|
| 3763 | + |
---|
| 3764 | + // if (increment) |
---|
| 3765 | + // tab.versionindex++; |
---|
| 3766 | + } |
---|
3528 | 3767 | |
---|
3529 | | - copy.RestoreBigData(hashtable); |
---|
| 3768 | + //copy.RestoreBigData(versiontable); |
---|
3530 | 3769 | |
---|
3531 | | - CameraPane.SWITCH = temp; |
---|
3532 | | - |
---|
3533 | 3770 | //assert(hashtable.isEmpty()); |
---|
3534 | 3771 | |
---|
3535 | | - for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3772 | + for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
3536 | 3773 | { |
---|
3537 | | - tab.graphs[i] = null; |
---|
| 3774 | + //tab.user[i] = false; |
---|
| 3775 | + copy.versionlist[i] = null; |
---|
3538 | 3776 | } |
---|
3539 | 3777 | |
---|
3540 | 3778 | SetUndoStates(); |
---|
.. | .. |
---|
3544 | 3782 | { |
---|
3545 | 3783 | try |
---|
3546 | 3784 | { |
---|
3547 | | - FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3785 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
3548 | 3786 | ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
3549 | 3787 | |
---|
3550 | 3788 | p.writeObject(copy); |
---|
.. | .. |
---|
3557 | 3795 | e.printStackTrace(); |
---|
3558 | 3796 | } |
---|
3559 | 3797 | } |
---|
| 3798 | + |
---|
| 3799 | + return !thesame; |
---|
| 3800 | + } |
---|
| 3801 | + |
---|
| 3802 | + boolean flashIt = true; |
---|
| 3803 | + |
---|
| 3804 | + void RefreshSelection() |
---|
| 3805 | + { |
---|
| 3806 | + Object3D selection = new Object3D(); |
---|
| 3807 | + |
---|
| 3808 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 3809 | + { |
---|
| 3810 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 3811 | + |
---|
| 3812 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 3813 | + |
---|
| 3814 | + if (obj == null) |
---|
| 3815 | + { |
---|
| 3816 | + copy.selection.remove(i--); |
---|
| 3817 | + } |
---|
| 3818 | + else |
---|
| 3819 | + { |
---|
| 3820 | + selection.add(obj); |
---|
| 3821 | + copy.selection.setElementAt(obj, i); |
---|
| 3822 | + } |
---|
| 3823 | + } |
---|
| 3824 | + |
---|
| 3825 | + flashIt = false; |
---|
| 3826 | + GetTree().clearSelection(); |
---|
| 3827 | + for (int i = 0; i < selection.size(); i++) |
---|
| 3828 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 3829 | + flashIt = true; |
---|
| 3830 | + |
---|
| 3831 | + refreshContents(false); |
---|
3560 | 3832 | } |
---|
3561 | 3833 | |
---|
3562 | 3834 | void CopyChanged(Object3D obj) |
---|
.. | .. |
---|
3566 | 3838 | boolean temp = CameraPane.SWITCH; |
---|
3567 | 3839 | CameraPane.SWITCH = false; |
---|
3568 | 3840 | |
---|
3569 | | - copy.ExtractBigData(hashtable); |
---|
| 3841 | + copy.ExtractBigData(versiontable); |
---|
3570 | 3842 | |
---|
3571 | 3843 | copy.clear(); |
---|
3572 | 3844 | |
---|
| 3845 | + copy.skyboxname = obj.skyboxname; |
---|
| 3846 | + copy.skyboxext = obj.skyboxext; |
---|
| 3847 | + |
---|
3573 | 3848 | for (int i=0; i<obj.Size(); i++) |
---|
3574 | 3849 | { |
---|
3575 | 3850 | copy.add(obj.get(i)); |
---|
3576 | 3851 | } |
---|
3577 | 3852 | |
---|
3578 | | - copy.RestoreBigData(hashtable); |
---|
| 3853 | + copy.RestoreBigData(versiontable); |
---|
3579 | 3854 | |
---|
3580 | 3855 | CameraPane.SWITCH = temp; |
---|
3581 | 3856 | |
---|
| 3857 | + RefreshSelection(); |
---|
3582 | 3858 | //assert(hashtable.isEmpty()); |
---|
3583 | 3859 | |
---|
3584 | 3860 | copy.Touch(); |
---|
.. | .. |
---|
3603 | 3879 | } |
---|
3604 | 3880 | |
---|
3605 | 3881 | cButton undoButton; |
---|
| 3882 | + cButton restoreButton; |
---|
| 3883 | + cButton replaceButton; |
---|
3606 | 3884 | cButton redoButton; |
---|
3607 | 3885 | |
---|
| 3886 | + boolean muteSlider; |
---|
| 3887 | + |
---|
| 3888 | + int VersionCount() |
---|
| 3889 | + { |
---|
| 3890 | + int count = 0; |
---|
| 3891 | + |
---|
| 3892 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 3893 | + { |
---|
| 3894 | + if (copy.versionlist[i] != null) |
---|
| 3895 | + count++; |
---|
| 3896 | + } |
---|
| 3897 | + |
---|
| 3898 | + return count; |
---|
| 3899 | + } |
---|
| 3900 | + |
---|
3608 | 3901 | void SetUndoStates() |
---|
3609 | 3902 | { |
---|
3610 | 3903 | cRadio tab = GetCurrentTab(); |
---|
3611 | 3904 | |
---|
3612 | | - undoButton.setEnabled(tab.undoindex > 0); |
---|
3613 | | - redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null); |
---|
| 3905 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 3906 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 3907 | + |
---|
| 3908 | + undoButton.setEnabled(copy.versionindex > 0); |
---|
| 3909 | + redoButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 3910 | + |
---|
| 3911 | + muteSlider = true; |
---|
| 3912 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 3913 | + versionSlider.setInteger(copy.versionindex); |
---|
| 3914 | + muteSlider = false; |
---|
3614 | 3915 | } |
---|
3615 | 3916 | |
---|
3616 | | - public void Undo() |
---|
| 3917 | + public boolean Undo() |
---|
3617 | 3918 | { |
---|
| 3919 | + // Option? |
---|
| 3920 | + Replace(); |
---|
| 3921 | + |
---|
3618 | 3922 | System.err.println("Undo"); |
---|
3619 | 3923 | |
---|
3620 | 3924 | cRadio tab = GetCurrentTab(); |
---|
3621 | 3925 | |
---|
3622 | | - if (tab.undoindex == 0) |
---|
| 3926 | + if (copy.versionindex == 0) |
---|
3623 | 3927 | { |
---|
3624 | 3928 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3625 | | - return; |
---|
| 3929 | + return false; |
---|
3626 | 3930 | } |
---|
3627 | 3931 | |
---|
3628 | | - if (tab.graphs[tab.undoindex] == null) |
---|
| 3932 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 3933 | +// { |
---|
| 3934 | +// if (Save(false)) |
---|
| 3935 | +// tab.versionindex -= 1; |
---|
| 3936 | +// else |
---|
| 3937 | +// { |
---|
| 3938 | +// if (tab.versionindex <= 0) |
---|
| 3939 | +// return false; |
---|
| 3940 | +// else |
---|
| 3941 | +// tab.versionindex -= 1; |
---|
| 3942 | +// } |
---|
| 3943 | +// } |
---|
| 3944 | + |
---|
| 3945 | + copy.versionindex -= 1; |
---|
| 3946 | + |
---|
| 3947 | + CopyChanged((Object3D)copy.versionlist[copy.versionindex]); |
---|
| 3948 | + |
---|
| 3949 | + return true; |
---|
| 3950 | + } |
---|
| 3951 | + |
---|
| 3952 | + public boolean Restore() |
---|
| 3953 | + { |
---|
| 3954 | + System.err.println("Restore"); |
---|
| 3955 | + |
---|
| 3956 | + cRadio tab = GetCurrentTab(); |
---|
| 3957 | + |
---|
| 3958 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
3629 | 3959 | { |
---|
3630 | | - Save(); |
---|
3631 | | - tab.undoindex -= 1; |
---|
| 3960 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3961 | + return false; |
---|
3632 | 3962 | } |
---|
3633 | 3963 | |
---|
3634 | | - tab.undoindex -= 1; |
---|
| 3964 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3965 | + CopyChanged(copy.versionlist[copy.versionindex]); |
---|
| 3966 | + |
---|
| 3967 | + return true; |
---|
| 3968 | + } |
---|
3635 | 3969 | |
---|
3636 | | - CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3970 | + public boolean Replace() |
---|
| 3971 | + { |
---|
| 3972 | + System.err.println("Replace"); |
---|
| 3973 | + |
---|
| 3974 | + cRadio tab = GetCurrentTab(); |
---|
| 3975 | + |
---|
| 3976 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 3977 | + { |
---|
| 3978 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3979 | + return false; |
---|
| 3980 | + } |
---|
| 3981 | + |
---|
| 3982 | + copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
| 3983 | + |
---|
| 3984 | + return true; |
---|
3637 | 3985 | } |
---|
3638 | 3986 | |
---|
3639 | 3987 | public void Redo() |
---|
3640 | 3988 | { |
---|
| 3989 | + // Option? |
---|
| 3990 | + Replace(); |
---|
| 3991 | + |
---|
3641 | 3992 | cRadio tab = GetCurrentTab(); |
---|
3642 | 3993 | |
---|
3643 | | - if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3994 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3644 | 3995 | { |
---|
3645 | 3996 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3646 | 3997 | return; |
---|
3647 | 3998 | } |
---|
3648 | 3999 | |
---|
3649 | | - tab.undoindex += 1; |
---|
| 4000 | + copy.versionindex += 1; |
---|
3650 | 4001 | |
---|
3651 | | - CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 4002 | + CopyChanged(copy.versionlist[copy.versionindex]); |
---|
| 4003 | + |
---|
| 4004 | + //if (!tab.user[tab.versionindex]) |
---|
| 4005 | + // tab.graphs[tab.versionindex] = null; |
---|
3652 | 4006 | } |
---|
3653 | 4007 | |
---|
3654 | 4008 | void ImportGFD() |
---|
.. | .. |
---|
3859 | 4213 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
3860 | 4214 | |
---|
3861 | 4215 | current.color = (float) colorField.getFloat(); |
---|
3862 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4216 | + current.modulation = (float) saturationField.getFloat(); |
---|
3863 | 4217 | current.metalness = (float) metalnessField.getFloat(); |
---|
3864 | 4218 | current.diffuse = (float) diffuseField.getFloat(); |
---|
3865 | 4219 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
3892 | 4246 | cMaterial mat = copy.material; |
---|
3893 | 4247 | |
---|
3894 | 4248 | colorField.SetToolTipValue((mat.color)); |
---|
3895 | | - modulationField.SetToolTipValue((mat.modulation)); |
---|
| 4249 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
3896 | 4250 | metalnessField.SetToolTipValue((mat.metalness)); |
---|
3897 | 4251 | diffuseField.SetToolTipValue((mat.diffuse)); |
---|
3898 | 4252 | specularField.SetToolTipValue((mat.specular)); |
---|
.. | .. |
---|
3944 | 4298 | //copy.Touch(); |
---|
3945 | 4299 | } |
---|
3946 | 4300 | |
---|
| 4301 | + cNumberSlider versionSlider; |
---|
| 4302 | + |
---|
3947 | 4303 | public void stateChanged(ChangeEvent e) |
---|
3948 | 4304 | { |
---|
3949 | 4305 | // assert(false); |
---|
| 4306 | + if (e.getSource() == versionSlider) |
---|
| 4307 | + { |
---|
| 4308 | + if (muteSlider) |
---|
| 4309 | + return; |
---|
| 4310 | + |
---|
| 4311 | + int version = versionSlider.getInteger(); |
---|
| 4312 | + |
---|
| 4313 | + if (copy.versionlist[version] != null) |
---|
| 4314 | + { |
---|
| 4315 | + CopyChanged(copy.versionlist[copy.versionindex = version]); |
---|
| 4316 | + } |
---|
| 4317 | + |
---|
| 4318 | + return; |
---|
| 4319 | + } |
---|
3950 | 4320 | |
---|
3951 | 4321 | if (freezematerial) |
---|
3952 | 4322 | { |
---|
.. | .. |
---|
3982 | 4352 | { |
---|
3983 | 4353 | //System.out.println("stateChanged = " + this); |
---|
3984 | 4354 | materialtouched = true; |
---|
| 4355 | + |
---|
| 4356 | + if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4357 | + { |
---|
| 4358 | + saturationField.setFloat(1); |
---|
| 4359 | + } |
---|
| 4360 | + |
---|
3985 | 4361 | applySelf(); |
---|
3986 | 4362 | //System.out.println("this = " + this); |
---|
3987 | 4363 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
4281 | 4657 | { |
---|
4282 | 4658 | if (GetTree() != null) |
---|
4283 | 4659 | { |
---|
| 4660 | + GetTree().revalidate(); |
---|
4284 | 4661 | GetTree().repaint(); |
---|
4285 | 4662 | } |
---|
4286 | 4663 | |
---|
.. | .. |
---|
4295 | 4672 | |
---|
4296 | 4673 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4297 | 4674 | { |
---|
4298 | | - if (Globals.SAVEONMAKE) // && resetmodel) |
---|
| 4675 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
4299 | 4676 | Save(); |
---|
4300 | 4677 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4301 | 4678 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
.. | .. |
---|
4537 | 4914 | readobj.ResetDisplayList(); |
---|
4538 | 4915 | } catch (Exception e) |
---|
4539 | 4916 | { |
---|
4540 | | - //e.printStackTrace(); |
---|
| 4917 | + if (!e.toString().contains("GZIP")) |
---|
| 4918 | + e.printStackTrace(); |
---|
| 4919 | + |
---|
4541 | 4920 | try |
---|
4542 | 4921 | { |
---|
4543 | 4922 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
.. | .. |
---|
4611 | 4990 | |
---|
4612 | 4991 | if (readobj != null) |
---|
4613 | 4992 | { |
---|
4614 | | - if (Globals.SAVEONMAKE) |
---|
4615 | | - Save(); |
---|
| 4993 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 4994 | + // Save(); |
---|
4616 | 4995 | try |
---|
4617 | 4996 | { |
---|
4618 | 4997 | //readobj.deepCopySelf(copy); |
---|
4619 | 4998 | copy.clear(); // june 2014 |
---|
| 4999 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5000 | + copy.skyboxext = readobj.skyboxext; |
---|
4620 | 5001 | for (int i = 0; i < readobj.size(); i++) |
---|
4621 | 5002 | { |
---|
4622 | 5003 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4657 | 5038 | } |
---|
4658 | 5039 | } catch (ClassCastException e) |
---|
4659 | 5040 | { |
---|
| 5041 | + e.printStackTrace(); |
---|
4660 | 5042 | assert (false); |
---|
4661 | 5043 | Composite c = (Composite) copy; |
---|
4662 | 5044 | c.children.clear(); |
---|
.. | .. |
---|
4667 | 5049 | c.addChild(csg); |
---|
4668 | 5050 | } |
---|
4669 | 5051 | |
---|
| 5052 | + copy.versionlist = readobj.versionlist; |
---|
| 5053 | + copy.versionindex = readobj.versionindex; |
---|
| 5054 | + |
---|
| 5055 | + if (copy.versionlist == null) |
---|
| 5056 | + { |
---|
| 5057 | + copy.versionlist = new Object3D[100]; |
---|
| 5058 | + copy.versionindex = -1; |
---|
| 5059 | + } |
---|
| 5060 | + |
---|
| 5061 | + //? SetUndoStates(); |
---|
| 5062 | + |
---|
4670 | 5063 | ResetModel(); |
---|
4671 | 5064 | copy.HardTouch(); // recompile? |
---|
4672 | 5065 | refreshContents(); |
---|
4673 | 5066 | } |
---|
4674 | 5067 | } |
---|
4675 | 5068 | |
---|
4676 | | - void load() // throws ClassNotFoundException |
---|
| 5069 | + void Open() // throws ClassNotFoundException |
---|
4677 | 5070 | { |
---|
4678 | 5071 | if (Grafreed.standAlone) |
---|
4679 | 5072 | { |
---|
.. | .. |
---|
4776 | 5169 | //ps.print(buffer.toString()); |
---|
4777 | 5170 | } catch (IOException e) |
---|
4778 | 5171 | { |
---|
| 5172 | + e.printStackTrace(); |
---|
4779 | 5173 | } |
---|
4780 | 5174 | } |
---|
4781 | 5175 | |
---|
.. | .. |
---|
4958 | 5352 | MenuBar menuBar; |
---|
4959 | 5353 | Menu fileMenu; |
---|
4960 | 5354 | MenuItem newItem; |
---|
4961 | | - MenuItem loadItem; |
---|
| 5355 | + MenuItem openItem; |
---|
4962 | 5356 | MenuItem saveItem; |
---|
4963 | 5357 | MenuItem saveAsItem; |
---|
4964 | 5358 | MenuItem exportAsItem; |
---|
.. | .. |
---|
4981 | 5375 | CheckboxMenuItem toggleSwitchItem; |
---|
4982 | 5376 | CheckboxMenuItem toggleRootItem; |
---|
4983 | 5377 | CheckboxMenuItem animationItem; |
---|
| 5378 | + MenuItem archiveItem; |
---|
4984 | 5379 | CheckboxMenuItem toggleHandleItem; |
---|
4985 | 5380 | CheckboxMenuItem togglePaintItem; |
---|
4986 | 5381 | JSplitPane mainPanel; |
---|
.. | .. |
---|
5067 | 5462 | JLabel colorLabel; |
---|
5068 | 5463 | cNumberSlider colorField; |
---|
5069 | 5464 | JLabel modulationLabel; |
---|
5070 | | - cNumberSlider modulationField; |
---|
| 5465 | + cNumberSlider saturationField; |
---|
5071 | 5466 | JLabel metalnessLabel; |
---|
5072 | 5467 | cNumberSlider metalnessField; |
---|
5073 | 5468 | JLabel diffuseLabel; |
---|