.. | .. |
---|
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. |
---|
.. | .. |
---|
31 | 34 | iSendInfo |
---|
32 | 35 | //KeyListener |
---|
33 | 36 | { |
---|
| 37 | + public cToggleButton pinButton; |
---|
34 | 38 | boolean timeline; |
---|
35 | 39 | boolean wasFullScreen; |
---|
36 | 40 | |
---|
.. | .. |
---|
38 | 42 | JFrame frame; |
---|
39 | 43 | |
---|
40 | 44 | static ObjEditor theFrame; |
---|
| 45 | + |
---|
| 46 | + public void AllocProjectedVertices(Object3D object) |
---|
| 47 | + { |
---|
| 48 | + assert (object.projectedVertices != null); |
---|
| 49 | + |
---|
| 50 | + if (object.projectedVertices.length <= 2) |
---|
| 51 | + { |
---|
| 52 | + // Side effect... |
---|
| 53 | + Object3D.cVector2[] keep = object.projectedVertices; |
---|
| 54 | + object.projectedVertices = new Object3D.cVector2[3]; |
---|
| 55 | + for (int i = 0; i < 3; i++) |
---|
| 56 | + { |
---|
| 57 | + if (i < keep.length) |
---|
| 58 | + { |
---|
| 59 | + object.projectedVertices[i] = keep[i]; |
---|
| 60 | + } else |
---|
| 61 | + { |
---|
| 62 | + object.projectedVertices[i] = new Object3D.cVector2(); |
---|
| 63 | + } |
---|
| 64 | + /* |
---|
| 65 | + if(keep.length == 0) |
---|
| 66 | + object.projectedVertices[0] = new Object3D.cVector2(); |
---|
| 67 | + else |
---|
| 68 | + object.projectedVertices[0] = keep[0]; |
---|
| 69 | + object.projectedVertices[1] = new Object3D.cVector2(); |
---|
| 70 | + */ |
---|
| 71 | + } |
---|
| 72 | + } |
---|
| 73 | + } |
---|
| 74 | + |
---|
| 75 | + public cGridBag GetSeparator() |
---|
| 76 | + { |
---|
| 77 | + cGridBag separator = new cGridBag(); |
---|
| 78 | + separator.add(new JSeparator()); |
---|
| 79 | + separator.preferredHeight = 5; |
---|
| 80 | + return separator; |
---|
| 81 | + } |
---|
41 | 82 | |
---|
42 | 83 | cButton GetButton(String name, boolean border) |
---|
43 | 84 | { |
---|
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 | | - } |
---|
| 85 | + ImageIcon icon = GetIcon(name); |
---|
| 86 | + return new cButton(icon, border); |
---|
| 87 | + } |
---|
| 88 | + |
---|
| 89 | + cLabel GetLabel(String name, boolean border) |
---|
| 90 | + { |
---|
| 91 | + //ImageIcon icon = GetIcon(name); |
---|
| 92 | + return new cLabel(GetImage(name), border); |
---|
53 | 93 | } |
---|
54 | 94 | |
---|
55 | 95 | cToggleButton GetToggleButton(String name, boolean border) |
---|
56 | 96 | { |
---|
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 | | - } |
---|
| 97 | + ImageIcon icon = GetIcon(name); |
---|
| 98 | + return new cToggleButton(icon, border); |
---|
66 | 99 | } |
---|
67 | 100 | |
---|
68 | 101 | cCheckBox GetCheckBox(String name, boolean border) |
---|
69 | 102 | { |
---|
| 103 | + ImageIcon icon = GetIcon(name); |
---|
| 104 | + return new cCheckBox(icon, border); |
---|
| 105 | + } |
---|
| 106 | + |
---|
| 107 | + static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); |
---|
| 108 | + |
---|
| 109 | + static ImageIcon GetIcon(String name) |
---|
| 110 | + { |
---|
| 111 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 112 | + if (iconCache != null) |
---|
| 113 | + { |
---|
| 114 | + return iconCache; |
---|
| 115 | + } |
---|
| 116 | + |
---|
70 | 117 | try |
---|
71 | 118 | { |
---|
72 | | - ImageIcon icon = GetIcon(name); |
---|
73 | | - return new cCheckBox(icon, border); |
---|
| 119 | + BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
| 120 | + |
---|
| 121 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 122 | +// { |
---|
| 123 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 124 | +// Graphics2D g = resized.createGraphics(); |
---|
| 125 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 126 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 127 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 128 | +// g.dispose(); |
---|
| 129 | +// |
---|
| 130 | +// image = resized; |
---|
| 131 | +// } |
---|
| 132 | + |
---|
| 133 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 134 | + |
---|
| 135 | + icons.put(name, icon); |
---|
| 136 | + |
---|
| 137 | + return icon; |
---|
74 | 138 | } |
---|
75 | 139 | catch (Exception e) |
---|
76 | 140 | { |
---|
77 | | - return new cCheckBox(name, border); |
---|
| 141 | + //icons.put(name, null); |
---|
| 142 | + return null; |
---|
78 | 143 | } |
---|
79 | 144 | } |
---|
80 | | - |
---|
81 | | - private ImageIcon GetIcon(String name) throws IOException |
---|
| 145 | + |
---|
| 146 | + BufferedImage GetImage(String name) |
---|
82 | 147 | { |
---|
83 | | - BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
84 | | - |
---|
85 | | - if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 148 | + try |
---|
86 | 149 | { |
---|
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; |
---|
| 150 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 151 | + |
---|
| 152 | + return image; |
---|
95 | 153 | } |
---|
96 | | - |
---|
97 | | - javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
98 | | - return icon; |
---|
| 154 | + catch (Exception e) |
---|
| 155 | + { |
---|
| 156 | + return null; |
---|
| 157 | + } |
---|
99 | 158 | } |
---|
100 | 159 | |
---|
101 | 160 | // SCRIPT |
---|
.. | .. |
---|
279 | 338 | client = inClient; |
---|
280 | 339 | copy = client; |
---|
281 | 340 | |
---|
| 341 | +// if (copy.versionlist == null) |
---|
| 342 | +// { |
---|
| 343 | +// copy.versionlist = new Object3D[100]; |
---|
| 344 | +// copy.versionindex = -1; |
---|
| 345 | +// |
---|
| 346 | +// callee.Save(true); |
---|
| 347 | +// } |
---|
| 348 | + |
---|
282 | 349 | // "this" is not called: SetupUI2(objEditor); |
---|
283 | 350 | } |
---|
284 | 351 | |
---|
.. | .. |
---|
292 | 359 | client = inClient; |
---|
293 | 360 | copy = client; |
---|
294 | 361 | |
---|
| 362 | + if (copy.versionlist == null) |
---|
| 363 | + { |
---|
| 364 | + copy.versionlist = new Object3D[100]; |
---|
| 365 | + copy.versionindex = -1; |
---|
| 366 | + |
---|
| 367 | +// Save(true); |
---|
| 368 | + } |
---|
| 369 | + |
---|
295 | 370 | SetupUI2(callee.GetEditor()); |
---|
296 | 371 | } |
---|
297 | 372 | |
---|
.. | .. |
---|
306 | 381 | //localCopy.parent = null; |
---|
307 | 382 | |
---|
308 | 383 | frame = new JFrame(); |
---|
309 | | - frame.setUndecorated(true); |
---|
| 384 | + frame.setUndecorated(false); |
---|
310 | 385 | objEditor = this; |
---|
311 | 386 | this.callee = callee; |
---|
312 | 387 | |
---|
313 | 388 | //parent = p; |
---|
314 | 389 | |
---|
315 | 390 | GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); |
---|
316 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 391 | + if (Globals.DEBUG) |
---|
| 392 | + System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
317 | 393 | //gd.setFullScreenWindow(this); |
---|
318 | 394 | //setResizable(false); |
---|
319 | 395 | //if (!isDisplayable()) |
---|
.. | .. |
---|
324 | 400 | copy = localCopy; |
---|
325 | 401 | copy.editWindow = this; |
---|
326 | 402 | |
---|
| 403 | +// if (copy.versionlist == null) |
---|
| 404 | +// { |
---|
| 405 | +// copy.versionlist = new Object3D[100]; |
---|
| 406 | +// copy.versionindex = -1; |
---|
| 407 | +// |
---|
| 408 | +// Save(true); |
---|
| 409 | +// } |
---|
| 410 | + |
---|
327 | 411 | SetupMenu(); |
---|
328 | 412 | |
---|
329 | 413 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
342 | 426 | |
---|
343 | 427 | static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
344 | 428 | |
---|
| 429 | + // This is to refresh the UI of the material panel. |
---|
| 430 | + boolean patchMaterial; |
---|
| 431 | + |
---|
345 | 432 | void SetupMenu() |
---|
346 | 433 | { |
---|
347 | 434 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
348 | 435 | menuBar.add(fileMenu = new Menu("File")); |
---|
349 | 436 | fileMenu.add(newItem = new MenuItem("New")); |
---|
350 | | - fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
| 437 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
351 | 438 | |
---|
352 | 439 | //oe.menuBar.add(menu = new Menu("Include")); |
---|
353 | 440 | Menu menu = new Menu("Import"); |
---|
.. | .. |
---|
379 | 466 | } |
---|
380 | 467 | |
---|
381 | 468 | newItem.addActionListener(this); |
---|
382 | | - loadItem.addActionListener(this); |
---|
| 469 | + openItem.addActionListener(this); |
---|
383 | 470 | saveItem.addActionListener(this); |
---|
384 | 471 | saveAsItem.addActionListener(this); |
---|
385 | 472 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
391 | 478 | |
---|
392 | 479 | ChangeListener changeListener = new ChangeListener() |
---|
393 | 480 | { |
---|
| 481 | + //String name; |
---|
| 482 | + |
---|
394 | 483 | public void stateChanged(ChangeEvent changeEvent) |
---|
395 | 484 | { |
---|
396 | 485 | // if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
.. | .. |
---|
409 | 498 | // EditSelection(false); |
---|
410 | 499 | // } |
---|
411 | 500 | |
---|
412 | | - refreshContents(false); // To refresh Info tab |
---|
| 501 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 502 | +// { |
---|
| 503 | +// name = copy.skyboxname; |
---|
| 504 | +// |
---|
| 505 | +// if (name == null) |
---|
| 506 | +// { |
---|
| 507 | +// name = ""; |
---|
| 508 | +// } |
---|
| 509 | +// |
---|
| 510 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 511 | +// copy.skyboxext = "jpg"; |
---|
| 512 | +// } |
---|
| 513 | +// else |
---|
| 514 | +// { |
---|
| 515 | +// if (name != null) |
---|
| 516 | +// { |
---|
| 517 | +// if (name.equals("")) |
---|
| 518 | +// { |
---|
| 519 | +// copy.skyboxname = null; |
---|
| 520 | +// copy.skyboxext = null; |
---|
| 521 | +// } |
---|
| 522 | +// else |
---|
| 523 | +// { |
---|
| 524 | +// copy.skyboxname = name; |
---|
| 525 | +// } |
---|
| 526 | +// } |
---|
| 527 | +// } |
---|
| 528 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 529 | + |
---|
| 530 | +// refreshContents(false); // To refresh Info tab |
---|
| 531 | + cameraView.repaint(); |
---|
413 | 532 | } |
---|
414 | 533 | }; |
---|
415 | 534 | objectPanel.addChangeListener(changeListener); |
---|
416 | 535 | |
---|
417 | 536 | toolbarPanel = new JPanel(); |
---|
418 | 537 | toolbarPanel.setName("Toolbar"); |
---|
| 538 | + |
---|
419 | 539 | treePanel = new cGridBag(); |
---|
420 | 540 | treePanel.setName("Tree"); |
---|
421 | 541 | |
---|
422 | 542 | editPanel = new cGridBag().setVertical(true); |
---|
423 | | - editPanel.setName("Edit"); |
---|
| 543 | + //editPanel.setName("Edit"); |
---|
424 | 544 | |
---|
425 | 545 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
426 | 546 | |
---|
.. | .. |
---|
428 | 548 | editPanel.add(editCommandsPanel); |
---|
429 | 549 | editPanel.add(ctrlPanel); |
---|
430 | 550 | |
---|
431 | | - toolboxPanel = new cGridBag().setVertical(false); |
---|
432 | | - toolboxPanel.setName("Toolbox"); |
---|
| 551 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 552 | + //toolboxPanel.setName("Toolbox"); |
---|
433 | 553 | |
---|
434 | | - materialPanel = new cGridBag().setVertical(true); |
---|
435 | | - materialPanel.setName("Material"); |
---|
| 554 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 555 | + |
---|
| 556 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 557 | + //materialPanel.setName("Material"); |
---|
436 | 558 | |
---|
437 | 559 | /*JTextPane*/ |
---|
438 | 560 | infoarea = createTextPane(); |
---|
.. | .. |
---|
440 | 562 | |
---|
441 | 563 | infoarea.setEditable(true); |
---|
442 | 564 | SetText(); |
---|
| 565 | + |
---|
443 | 566 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
444 | 567 | // infoarea.setOpaque(false); |
---|
445 | 568 | // //infoarea.setForeground(textcolor); |
---|
446 | 569 | // TEXTAREA infoarea.setLineWrap(true); |
---|
447 | 570 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
448 | 571 | 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"); |
---|
| 572 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
| 573 | + //infoPanel.setName("Info"); |
---|
451 | 574 | //infoPanel.setLayout(new BorderLayout()); |
---|
452 | 575 | //infoPanel.add(createTextPane()); |
---|
453 | 576 | |
---|
.. | .. |
---|
458 | 581 | mainPanel.setDividerSize(9); |
---|
459 | 582 | mainPanel.setDividerLocation(0.5); //1.0); |
---|
460 | 583 | mainPanel.setResizeWeight(0.5); |
---|
461 | | - |
---|
| 584 | + |
---|
| 585 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 586 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 587 | + divider.setDividerSize(15); |
---|
| 588 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 589 | + |
---|
| 590 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 591 | + |
---|
462 | 592 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
463 | 593 | //mainPanel.setLayout(new GridBagLayout()); |
---|
464 | 594 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
.. | .. |
---|
689 | 819 | } |
---|
690 | 820 | } |
---|
691 | 821 | |
---|
692 | | -static GraphicsDevice device = GraphicsEnvironment |
---|
693 | | - .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 822 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 823 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
694 | 824 | |
---|
695 | 825 | Rectangle keeprect; |
---|
696 | 826 | cRadio radio; |
---|
.. | .. |
---|
707 | 837 | boolean maximized; |
---|
708 | 838 | |
---|
709 | 839 | cButton fullscreenLayout; |
---|
| 840 | + cButton expandedLayout; |
---|
710 | 841 | |
---|
711 | 842 | void Minimize() |
---|
712 | 843 | { |
---|
713 | 844 | frame.setState(Frame.ICONIFIED); |
---|
| 845 | + frame.validate(); |
---|
714 | 846 | } |
---|
715 | 847 | |
---|
| 848 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 849 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 850 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
716 | 851 | void Maximize() |
---|
717 | 852 | { |
---|
| 853 | + if (CameraPane.FULLSCREEN) |
---|
| 854 | + { |
---|
| 855 | + ToggleFullScreen(); |
---|
| 856 | + } |
---|
| 857 | + |
---|
718 | 858 | if (maximized) |
---|
719 | 859 | { |
---|
720 | 860 | frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
.. | .. |
---|
722 | 862 | else |
---|
723 | 863 | { |
---|
724 | 864 | 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); |
---|
| 865 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 866 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 867 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
728 | 868 | // frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 869 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
729 | 870 | } |
---|
730 | 871 | |
---|
731 | 872 | maximized ^= true; |
---|
| 873 | + |
---|
| 874 | + frame.validate(); |
---|
732 | 875 | } |
---|
| 876 | + |
---|
| 877 | + cButton minButton; |
---|
| 878 | + cButton maxButton; |
---|
| 879 | + cButton fullButton; |
---|
| 880 | + cButton collapseButton; |
---|
| 881 | + cButton maximize3DButton; |
---|
733 | 882 | |
---|
734 | 883 | void ToggleFullScreen() |
---|
735 | 884 | { |
---|
| 885 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 886 | + |
---|
736 | 887 | cameraView.ToggleFullScreen(); |
---|
737 | 888 | |
---|
738 | 889 | if (!CameraPane.FULLSCREEN) |
---|
739 | 890 | { |
---|
740 | 891 | device.setFullScreenWindow(null); |
---|
| 892 | + frame.dispose(); |
---|
| 893 | + frame.setUndecorated(false); |
---|
| 894 | + frame.validate(); |
---|
| 895 | + frame.setVisible(true); |
---|
| 896 | + |
---|
741 | 897 | //frame.setVisible(false); |
---|
742 | 898 | // frame.removeNotify(); |
---|
743 | 899 | // frame.setUndecorated(false); |
---|
.. | .. |
---|
747 | 903 | // X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
748 | 904 | // X framePanel.add(bigThree); |
---|
749 | 905 | // X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
750 | | - framePanel.setDividerLocation(1); |
---|
| 906 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
751 | 907 | |
---|
752 | 908 | //frame.setVisible(true); |
---|
753 | | - radio.layout = keepButton; |
---|
| 909 | +// radio.layout = keepButton; |
---|
754 | 910 | //theFrame = null; |
---|
755 | 911 | keepButton = null; |
---|
756 | | - radio.layout.doClick(); |
---|
| 912 | +// radio.layout.doClick(); |
---|
757 | 913 | |
---|
758 | 914 | } else |
---|
759 | 915 | { |
---|
.. | .. |
---|
762 | 918 | // frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
763 | 919 | // frame.getToolkit().getScreenSize().height); |
---|
764 | 920 | //frame.setVisible(false); |
---|
| 921 | + |
---|
| 922 | + frame.dispose(); |
---|
| 923 | + frame.setUndecorated(true); |
---|
765 | 924 | device.setFullScreenWindow(frame); |
---|
| 925 | + frame.validate(); |
---|
| 926 | + frame.setVisible(true); |
---|
766 | 927 | // frame.removeNotify(); |
---|
767 | 928 | // frame.setUndecorated(true); |
---|
768 | 929 | // frame.addNotify(); |
---|
769 | 930 | // X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
770 | 931 | // X framePanel.remove(bigThree); |
---|
771 | 932 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
772 | | - framePanel.setDividerLocation(0); |
---|
| 933 | +// framePanel.setDividerLocation(0); |
---|
773 | 934 | |
---|
774 | | - radio.layout = fullscreenLayout; |
---|
775 | | - radio.layout.doClick(); |
---|
| 935 | +// radio.layout = fullscreenLayout; |
---|
| 936 | +// radio.layout.doClick(); |
---|
776 | 937 | //frame.setVisible(true); |
---|
777 | 938 | } |
---|
| 939 | + frame.validate(); |
---|
| 940 | + |
---|
| 941 | + cameraView.requestFocusInWindow(); |
---|
778 | 942 | } |
---|
| 943 | + |
---|
| 944 | + void CollapseToolbar() |
---|
| 945 | + { |
---|
| 946 | + framePanel.setDividerLocation(0); |
---|
| 947 | + //frame.validate(); |
---|
| 948 | + |
---|
| 949 | + cameraView.requestFocusInWindow(); |
---|
| 950 | + } |
---|
| 951 | + |
---|
| 952 | + private Object3D Duplicate(Object3D object) |
---|
| 953 | + { |
---|
| 954 | + boolean temp = CameraPane.SWITCH; |
---|
| 955 | + CameraPane.SWITCH = false; |
---|
| 956 | + |
---|
| 957 | + if (Grafreed.grafreed.universe.versiontable == null) |
---|
| 958 | + Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 959 | + |
---|
| 960 | + object.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 961 | + // if (copy == client) |
---|
| 962 | + |
---|
| 963 | + Object3D versions[] = object.versionlist; |
---|
| 964 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe |
---|
| 965 | + object.versionlist = null; |
---|
| 966 | + object.versiontable = null; |
---|
| 967 | + |
---|
| 968 | + //byte[] compress = Compress(copy); |
---|
| 969 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
| 970 | + |
---|
| 971 | + object.versionlist = versions; |
---|
| 972 | + object.versiontable = versiontable; // if Grafreed.grafreed.universe |
---|
| 973 | + |
---|
| 974 | + object.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 975 | + |
---|
| 976 | + CameraPane.SWITCH = temp; |
---|
| 977 | + |
---|
| 978 | + return compress; |
---|
| 979 | + } |
---|
779 | 980 | |
---|
780 | 981 | private JTextPane createTextPane() |
---|
781 | 982 | { |
---|
.. | .. |
---|
898 | 1099 | { |
---|
899 | 1100 | SetupMaterial(materialPanel); |
---|
900 | 1101 | } |
---|
| 1102 | + |
---|
901 | 1103 | //SetupName(); |
---|
902 | 1104 | //SetupViews(); |
---|
903 | 1105 | } |
---|
.. | .. |
---|
907 | 1109 | // NumberSlider vDivsField; |
---|
908 | 1110 | // JCheckBox endcaps; |
---|
909 | 1111 | JCheckBox liveCB; |
---|
910 | | - JCheckBox selectCB; |
---|
| 1112 | + JCheckBox selectableCB; |
---|
911 | 1113 | JCheckBox hideCB; |
---|
912 | 1114 | JCheckBox link2masterCB; |
---|
913 | 1115 | JCheckBox markCB; |
---|
.. | .. |
---|
1106 | 1308 | |
---|
1107 | 1309 | namePanel = new cGridBag(); |
---|
1108 | 1310 | |
---|
| 1311 | + //if (copy.pinned) |
---|
| 1312 | + { |
---|
| 1313 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1314 | + pinButton.setSelected(copy.pinned); |
---|
| 1315 | + cGridBag t = new cGridBag(); |
---|
| 1316 | + t.preferredWidth = 2; |
---|
| 1317 | + t.add(pinButton); |
---|
| 1318 | + namePanel.add(t); |
---|
| 1319 | + |
---|
| 1320 | + pinButton.addItemListener(this); |
---|
| 1321 | + } |
---|
| 1322 | + |
---|
1109 | 1323 | nameField = AddText(namePanel, copy.GetName()); |
---|
1110 | | - namePanel.add(nameField); |
---|
| 1324 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
1111 | 1325 | oe.ctrlPanel.add(namePanel); |
---|
1112 | 1326 | |
---|
1113 | 1327 | oe.ctrlPanel.Return(); |
---|
.. | .. |
---|
1119 | 1333 | |
---|
1120 | 1334 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
1121 | 1335 | liveCB.setToolTipText("Animate object"); |
---|
1122 | | - selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
1123 | | - selectCB.setToolTipText("Make object selectable"); |
---|
| 1336 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1337 | + markCB.setToolTipText("Set target transform"); |
---|
| 1338 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1339 | + selectableCB.setToolTipText("Make object selectable"); |
---|
1124 | 1340 | // Return(); |
---|
| 1341 | + |
---|
1125 | 1342 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
1126 | 1343 | hideCB.setToolTipText("Hide object"); |
---|
1127 | | - markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
1128 | | - markCB.setToolTipText("Set the animation target transform"); |
---|
| 1344 | + |
---|
| 1345 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
1129 | 1346 | |
---|
1130 | 1347 | setupPanel2 = new cGridBag().setVertical(false); |
---|
1131 | 1348 | |
---|
1132 | 1349 | rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
1133 | 1350 | rewindCB.setToolTipText("Rewind animation"); |
---|
1134 | 1351 | |
---|
1135 | | - randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
1136 | | - randomCB.setToolTipText("Randomly Rewind or Go back and forth"); |
---|
| 1352 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1353 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
1137 | 1354 | |
---|
| 1355 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1356 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1357 | + |
---|
1138 | 1358 | if (Globals.ADVANCED) |
---|
1139 | 1359 | { |
---|
1140 | | - link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
1141 | | - link2masterCB.setToolTipText("Attach to support"); |
---|
1142 | 1360 | speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
1143 | 1361 | speedupCB.setToolTipText("Option motion capture"); |
---|
1144 | 1362 | } |
---|
.. | .. |
---|
1324 | 1542 | |
---|
1325 | 1543 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1326 | 1544 | { |
---|
| 1545 | + if (Globals.DEBUG) |
---|
1327 | 1546 | System.out.println("CREATE CAMERAS"); |
---|
1328 | 1547 | cams = new cTemplate(); |
---|
1329 | 1548 | cams.name = "Cameras"; |
---|
.. | .. |
---|
1412 | 1631 | XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1413 | 1632 | XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1414 | 1633 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1634 | + //XYZPanel.setName("XYZ"); |
---|
1415 | 1635 | |
---|
1416 | 1636 | /* |
---|
1417 | 1637 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1448 | 1668 | |
---|
1449 | 1669 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1450 | 1670 | //tmp.setName("Edit"); |
---|
| 1671 | + objectPanel.add(toolboxPanel); |
---|
| 1672 | + objectPanel.setIconAt(0, GetIcon("icons/primitives.png")); |
---|
| 1673 | + objectPanel.setToolTipTextAt(0, "Objects & textures"); |
---|
| 1674 | + |
---|
1451 | 1675 | objectPanel.add(materialPanel); |
---|
| 1676 | + objectPanel.setIconAt(1, GetIcon("icons/material.png")); |
---|
| 1677 | + objectPanel.setToolTipTextAt(1, "Material"); |
---|
| 1678 | + |
---|
| 1679 | + objectPanel.add(skyboxPanel); |
---|
| 1680 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1681 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1682 | + |
---|
1452 | 1683 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1453 | 1684 | // north.setName("Edit"); |
---|
1454 | 1685 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1455 | 1686 | // objectPanel.add(north); |
---|
1456 | 1687 | objectPanel.add(editPanel); |
---|
1457 | | - objectPanel.add(infoPanel); |
---|
1458 | | - objectPanel.add(toolboxPanel); |
---|
1459 | | - |
---|
| 1688 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1689 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
| 1690 | + |
---|
| 1691 | + objectPanel.add(XYZPanel); |
---|
| 1692 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1693 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
| 1694 | + |
---|
| 1695 | + patchMaterial = true; |
---|
| 1696 | + cameraView.patchMaterial = this; |
---|
| 1697 | + objectPanel.setSelectedIndex(1); |
---|
| 1698 | + |
---|
1460 | 1699 | /* |
---|
1461 | 1700 | aConstraints.gridx = 0; |
---|
1462 | 1701 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1493 | 1732 | |
---|
1494 | 1733 | scenePanel.add(tabbedPane); |
---|
1495 | 1734 | |
---|
| 1735 | + //if (Globals.ADVANCED) |
---|
| 1736 | +// tabbedPane.add(infoPanel); |
---|
| 1737 | +// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1738 | +// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1739 | + |
---|
1496 | 1740 | /* |
---|
1497 | 1741 | cTree jTree = new cTree(null); |
---|
1498 | 1742 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1554 | 1798 | bigThree = new cGridBag(); |
---|
1555 | 1799 | bigThree.addComponent(scenePanel); |
---|
1556 | 1800 | bigThree.addComponent(centralPanel); |
---|
1557 | | - bigThree.addComponent(XYZPanel); |
---|
| 1801 | + //bigThree.addComponent(XYZPanel); |
---|
1558 | 1802 | |
---|
1559 | 1803 | // // SIDE EFFECT!!! |
---|
1560 | 1804 | // aConstraints.gridx = 0; |
---|
.. | .. |
---|
1563 | 1807 | // aConstraints.gridheight = 1; |
---|
1564 | 1808 | |
---|
1565 | 1809 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1566 | | - framePanel.setContinuousLayout(true); |
---|
1567 | | - framePanel.setOneTouchExpandable(true); |
---|
1568 | | - framePanel.setDividerLocation(0.8); |
---|
| 1810 | + |
---|
| 1811 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1812 | + new java.beans.PropertyChangeListener() |
---|
| 1813 | + { |
---|
| 1814 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1815 | + { |
---|
| 1816 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1817 | + { |
---|
| 1818 | + if (radio.layout != expandedLayout) |
---|
| 1819 | + { |
---|
| 1820 | + radio.layout = expandedLayout; |
---|
| 1821 | + radio.layout.doClick(); |
---|
| 1822 | + } |
---|
| 1823 | + } |
---|
| 1824 | + } |
---|
| 1825 | + }); |
---|
| 1826 | + |
---|
| 1827 | + framePanel.setContinuousLayout(false); |
---|
| 1828 | + framePanel.setOneTouchExpandable(false); |
---|
| 1829 | + //.setDividerLocation(0.8); |
---|
1569 | 1830 | //framePanel.setDividerSize(15); |
---|
1570 | 1831 | //framePanel.setResizeWeight(0.15); |
---|
1571 | 1832 | framePanel.setName("Frame"); |
---|
1572 | 1833 | |
---|
1573 | 1834 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1574 | 1835 | /**/ |
---|
1575 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1836 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1576 | 1837 | //worldPane.add(bigPanel); |
---|
1577 | 1838 | //worldPane.add(worldPanel); |
---|
1578 | 1839 | /**/ |
---|
.. | .. |
---|
1584 | 1845 | |
---|
1585 | 1846 | frame.setSize(1280, 860); |
---|
1586 | 1847 | |
---|
1587 | | - frame.validate(); |
---|
1588 | | - frame.setVisible(true); |
---|
1589 | | - |
---|
1590 | 1848 | cameraView.requestFocusInWindow(); |
---|
1591 | 1849 | |
---|
1592 | 1850 | gridPanel.setDividerLocation(1.0); |
---|
| 1851 | + |
---|
| 1852 | + frame.validate(); |
---|
| 1853 | + |
---|
| 1854 | + frame.setVisible(true); |
---|
1593 | 1855 | |
---|
1594 | 1856 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1595 | 1857 | frame.addWindowListener(new WindowAdapter() |
---|
1596 | 1858 | { |
---|
1597 | | - |
---|
1598 | 1859 | public void windowClosing(WindowEvent e) |
---|
1599 | 1860 | { |
---|
1600 | 1861 | Close(); |
---|
.. | .. |
---|
1617 | 1878 | ctrlPanel.removeAll(); |
---|
1618 | 1879 | } |
---|
1619 | 1880 | |
---|
1620 | | - void SetupMaterial(cGridBag panel) |
---|
| 1881 | + void SetupMaterial(cGridBag materialpanel) |
---|
1621 | 1882 | { |
---|
1622 | | - /* |
---|
| 1883 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1884 | + |
---|
| 1885 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1886 | + skin.setToolTipText("Skin"); |
---|
| 1887 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1888 | + { |
---|
| 1889 | + public void mouseClicked(MouseEvent e) |
---|
| 1890 | + { |
---|
| 1891 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1892 | + cMaterial material = object.material; |
---|
| 1893 | + |
---|
| 1894 | + // Skin |
---|
| 1895 | + colorField.setFloat(material.color); |
---|
| 1896 | + float saturation = material.modulation; |
---|
| 1897 | + |
---|
| 1898 | + if (!cameraView.Skinshader) |
---|
| 1899 | + { |
---|
| 1900 | + saturation /= 1.5; |
---|
| 1901 | + } |
---|
| 1902 | + |
---|
| 1903 | + saturationField.setFloat(saturation); |
---|
| 1904 | + |
---|
| 1905 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1906 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1907 | + diffusenessField.setFloat(material.factor); |
---|
| 1908 | + shininessField.setFloat(material.shininess); |
---|
| 1909 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1910 | + diffuseField.setFloat(material.diffuse); |
---|
| 1911 | + specularField.setFloat(material.specular); |
---|
| 1912 | + |
---|
| 1913 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1914 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1915 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1916 | + |
---|
| 1917 | + materialtouched = true; |
---|
| 1918 | + applySelf(); |
---|
| 1919 | + } |
---|
| 1920 | + }); |
---|
| 1921 | + presetpanel.add(skin); |
---|
| 1922 | + |
---|
| 1923 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1924 | + lambert.setToolTipText("Diffuse"); |
---|
| 1925 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1926 | + { |
---|
| 1927 | + public void mouseClicked(MouseEvent e) |
---|
| 1928 | + { |
---|
| 1929 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1930 | + cMaterial material = object.material; |
---|
| 1931 | + |
---|
| 1932 | + diffusenessField.setFloat(material.factor); |
---|
| 1933 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1934 | + |
---|
| 1935 | + materialtouched = true; |
---|
| 1936 | + applySelf(); |
---|
| 1937 | + } |
---|
| 1938 | + }); |
---|
| 1939 | + presetpanel.add(lambert); |
---|
| 1940 | + |
---|
| 1941 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1942 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1943 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1944 | + { |
---|
| 1945 | + public void mouseClicked(MouseEvent e) |
---|
| 1946 | + { |
---|
| 1947 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1948 | + cMaterial material = object.material; |
---|
| 1949 | + |
---|
| 1950 | + diffusenessField.setFloat(material.factor); |
---|
| 1951 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1952 | + |
---|
| 1953 | + materialtouched = true; |
---|
| 1954 | + applySelf(); |
---|
| 1955 | + } |
---|
| 1956 | + }); |
---|
| 1957 | + presetpanel.add(diffuse2); |
---|
| 1958 | + |
---|
| 1959 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1960 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1961 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1962 | + { |
---|
| 1963 | + public void mouseClicked(MouseEvent e) |
---|
| 1964 | + { |
---|
| 1965 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1966 | + cMaterial material = object.material; |
---|
| 1967 | + |
---|
| 1968 | + diffusenessField.setFloat(material.factor); |
---|
| 1969 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1970 | + |
---|
| 1971 | + materialtouched = true; |
---|
| 1972 | + applySelf(); |
---|
| 1973 | + } |
---|
| 1974 | + }); |
---|
| 1975 | + presetpanel.add(diffusemoon); |
---|
| 1976 | + |
---|
| 1977 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1978 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1979 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1980 | + { |
---|
| 1981 | + public void mouseClicked(MouseEvent e) |
---|
| 1982 | + { |
---|
| 1983 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1984 | + cMaterial material = object.material; |
---|
| 1985 | + |
---|
| 1986 | + diffusenessField.setFloat(material.factor); |
---|
| 1987 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1988 | + |
---|
| 1989 | + materialtouched = true; |
---|
| 1990 | + applySelf(); |
---|
| 1991 | + } |
---|
| 1992 | + }); |
---|
| 1993 | + presetpanel.add(diffusemoon2); |
---|
| 1994 | + |
---|
| 1995 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1996 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1997 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1998 | + { |
---|
| 1999 | + public void mouseClicked(MouseEvent e) |
---|
| 2000 | + { |
---|
| 2001 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 2002 | + cMaterial material = object.material; |
---|
| 2003 | + |
---|
| 2004 | + diffusenessField.setFloat(material.factor); |
---|
| 2005 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2006 | + |
---|
| 2007 | + materialtouched = true; |
---|
| 2008 | + applySelf(); |
---|
| 2009 | + } |
---|
| 2010 | + }); |
---|
| 2011 | + presetpanel.add(diffusemoon3); |
---|
| 2012 | + |
---|
| 2013 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 2014 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 2015 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 2016 | + { |
---|
| 2017 | + public void mouseClicked(MouseEvent e) |
---|
| 2018 | + { |
---|
| 2019 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 2020 | + cMaterial material = object.material; |
---|
| 2021 | + |
---|
| 2022 | + sheenField.setFloat(material.sheen); |
---|
| 2023 | + |
---|
| 2024 | + materialtouched = true; |
---|
| 2025 | + applySelf(); |
---|
| 2026 | + } |
---|
| 2027 | + }); |
---|
| 2028 | + presetpanel.add(diffusesheen); |
---|
| 2029 | + |
---|
| 2030 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2031 | + rough.setToolTipText("Rough metal"); |
---|
| 2032 | + rough.addMouseListener(new MouseAdapter() |
---|
| 2033 | + { |
---|
| 2034 | + public void mouseClicked(MouseEvent e) |
---|
| 2035 | + { |
---|
| 2036 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 2037 | + cMaterial material = object.material; |
---|
| 2038 | + |
---|
| 2039 | + shininessField.setFloat(material.shininess); |
---|
| 2040 | + velvetField.setFloat(material.velvet); |
---|
| 2041 | + |
---|
| 2042 | + materialtouched = true; |
---|
| 2043 | + applySelf(); |
---|
| 2044 | + } |
---|
| 2045 | + }); |
---|
| 2046 | + presetpanel.add(rough); |
---|
| 2047 | + |
---|
| 2048 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2049 | + rough2.setToolTipText("Medium metal"); |
---|
| 2050 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 2051 | + { |
---|
| 2052 | + public void mouseClicked(MouseEvent e) |
---|
| 2053 | + { |
---|
| 2054 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2055 | + cMaterial material = object.material; |
---|
| 2056 | + |
---|
| 2057 | + shininessField.setFloat(material.shininess); |
---|
| 2058 | + lightareaField.setFloat(material.lightarea); |
---|
| 2059 | + |
---|
| 2060 | + materialtouched = true; |
---|
| 2061 | + applySelf(); |
---|
| 2062 | + } |
---|
| 2063 | + }); |
---|
| 2064 | + presetpanel.add(rough2); |
---|
| 2065 | + |
---|
| 2066 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2067 | + shini0.setToolTipText("Shiny"); |
---|
| 2068 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2069 | + { |
---|
| 2070 | + public void mouseClicked(MouseEvent e) |
---|
| 2071 | + { |
---|
| 2072 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2073 | + cMaterial material = object.material; |
---|
| 2074 | + |
---|
| 2075 | + shininessField.setFloat(material.shininess); |
---|
| 2076 | + lightareaField.setFloat(material.lightarea); |
---|
| 2077 | + |
---|
| 2078 | + materialtouched = true; |
---|
| 2079 | + applySelf(); |
---|
| 2080 | + } |
---|
| 2081 | + }); |
---|
| 2082 | + presetpanel.add(shini0); |
---|
| 2083 | + |
---|
| 2084 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2085 | + shini1.setToolTipText("Shiny2"); |
---|
| 2086 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2087 | + { |
---|
| 2088 | + public void mouseClicked(MouseEvent e) |
---|
| 2089 | + { |
---|
| 2090 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2091 | + cMaterial material = object.material; |
---|
| 2092 | + |
---|
| 2093 | + shininessField.setFloat(material.shininess); |
---|
| 2094 | + lightareaField.setFloat(material.lightarea); |
---|
| 2095 | + |
---|
| 2096 | + materialtouched = true; |
---|
| 2097 | + applySelf(); |
---|
| 2098 | + } |
---|
| 2099 | + }); |
---|
| 2100 | + presetpanel.add(shini1); |
---|
| 2101 | + |
---|
| 2102 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2103 | + shini2.setToolTipText("Shiny3"); |
---|
| 2104 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2105 | + { |
---|
| 2106 | + public void mouseClicked(MouseEvent e) |
---|
| 2107 | + { |
---|
| 2108 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2109 | + cMaterial material = object.material; |
---|
| 2110 | + |
---|
| 2111 | + shininessField.setFloat(material.shininess); |
---|
| 2112 | + lightareaField.setFloat(material.lightarea); |
---|
| 2113 | + |
---|
| 2114 | + materialtouched = true; |
---|
| 2115 | + applySelf(); |
---|
| 2116 | + } |
---|
| 2117 | + }); |
---|
| 2118 | + presetpanel.add(shini2); |
---|
| 2119 | + |
---|
| 2120 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2121 | + aniso.setToolTipText("AnisoU"); |
---|
| 2122 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2123 | + { |
---|
| 2124 | + public void mouseClicked(MouseEvent e) |
---|
| 2125 | + { |
---|
| 2126 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2127 | + cMaterial material = object.material; |
---|
| 2128 | + |
---|
| 2129 | + anisoField.setFloat(material.aniso); |
---|
| 2130 | + anisoVField.setFloat(material.anisoV); |
---|
| 2131 | + |
---|
| 2132 | + materialtouched = true; |
---|
| 2133 | + applySelf(); |
---|
| 2134 | + } |
---|
| 2135 | + }); |
---|
| 2136 | + presetpanel.add(aniso); |
---|
| 2137 | + |
---|
| 2138 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2139 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2140 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2141 | + { |
---|
| 2142 | + public void mouseClicked(MouseEvent e) |
---|
| 2143 | + { |
---|
| 2144 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2145 | + cMaterial material = object.material; |
---|
| 2146 | + |
---|
| 2147 | + anisoField.setFloat(material.aniso); |
---|
| 2148 | + anisoVField.setFloat(material.anisoV); |
---|
| 2149 | + |
---|
| 2150 | + materialtouched = true; |
---|
| 2151 | + applySelf(); |
---|
| 2152 | + } |
---|
| 2153 | + }); |
---|
| 2154 | + presetpanel.add(aniso2); |
---|
| 2155 | + |
---|
| 2156 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2157 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2158 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2159 | + { |
---|
| 2160 | + public void mouseClicked(MouseEvent e) |
---|
| 2161 | + { |
---|
| 2162 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2163 | + cMaterial material = object.material; |
---|
| 2164 | + |
---|
| 2165 | + anisoField.setFloat(material.aniso); |
---|
| 2166 | + anisoVField.setFloat(material.anisoV); |
---|
| 2167 | + |
---|
| 2168 | + materialtouched = true; |
---|
| 2169 | + applySelf(); |
---|
| 2170 | + } |
---|
| 2171 | + }); |
---|
| 2172 | + presetpanel.add(aniso3); |
---|
| 2173 | + |
---|
| 2174 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2175 | + velvet0.setToolTipText("Velvet"); |
---|
| 2176 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2177 | + { |
---|
| 2178 | + public void mouseClicked(MouseEvent e) |
---|
| 2179 | + { |
---|
| 2180 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2181 | + cMaterial material = object.material; |
---|
| 2182 | + |
---|
| 2183 | + diffusenessField.setFloat(material.factor); |
---|
| 2184 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2185 | + sheenField.setFloat(material.sheen); |
---|
| 2186 | + shininessField.setFloat(material.shininess); |
---|
| 2187 | + velvetField.setFloat(material.velvet); |
---|
| 2188 | + shiftField.setFloat(material.shift); |
---|
| 2189 | + |
---|
| 2190 | + materialtouched = true; |
---|
| 2191 | + applySelf(); |
---|
| 2192 | + } |
---|
| 2193 | + }); |
---|
| 2194 | + presetpanel.add(velvet0); |
---|
| 2195 | + |
---|
| 2196 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2197 | + bump0.setToolTipText("Bump texture"); |
---|
| 2198 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2199 | + { |
---|
| 2200 | + public void mouseClicked(MouseEvent e) |
---|
| 2201 | + { |
---|
| 2202 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2203 | + cMaterial material = object.material; |
---|
| 2204 | + |
---|
| 2205 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2206 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2207 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2208 | + |
---|
| 2209 | + materialtouched = true; |
---|
| 2210 | + applySelf(); |
---|
| 2211 | + } |
---|
| 2212 | + }); |
---|
| 2213 | + presetpanel.add(bump0); |
---|
| 2214 | + |
---|
| 2215 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF); |
---|
| 2216 | + borderShader.setToolTipText("Border fade"); |
---|
| 2217 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2218 | + { |
---|
| 2219 | + public void mouseClicked(MouseEvent e) |
---|
| 2220 | + { |
---|
| 2221 | + borderfadeField.setFloat(0.5); |
---|
| 2222 | + opacityField.setFloat(0.75); |
---|
| 2223 | + |
---|
| 2224 | + materialtouched = true; |
---|
| 2225 | + applySelf(); |
---|
| 2226 | + } |
---|
| 2227 | + }); |
---|
| 2228 | + presetpanel.add(borderShader); |
---|
| 2229 | + |
---|
| 2230 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2231 | + halo.setToolTipText("Halo"); |
---|
| 2232 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2233 | + { |
---|
| 2234 | + public void mouseClicked(MouseEvent e) |
---|
| 2235 | + { |
---|
| 2236 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2237 | + cMaterial material = object.material; |
---|
| 2238 | + |
---|
| 2239 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2240 | + |
---|
| 2241 | + materialtouched = true; |
---|
| 2242 | + applySelf(); |
---|
| 2243 | + } |
---|
| 2244 | + }); |
---|
| 2245 | + presetpanel.add(halo); |
---|
| 2246 | + |
---|
| 2247 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2248 | + candle.setToolTipText("Candle"); |
---|
| 2249 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2250 | + { |
---|
| 2251 | + public void mouseClicked(MouseEvent e) |
---|
| 2252 | + { |
---|
| 2253 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2254 | + cMaterial material = object.material; |
---|
| 2255 | + |
---|
| 2256 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2257 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2258 | + ambientField.setFloat(material.ambient); |
---|
| 2259 | + specularField.setFloat(material.specular); |
---|
| 2260 | + lightareaField.setFloat(material.lightarea); |
---|
| 2261 | + shininessField.setFloat(material.shininess); |
---|
| 2262 | + |
---|
| 2263 | + materialtouched = true; |
---|
| 2264 | + applySelf(); |
---|
| 2265 | + } |
---|
| 2266 | + }); |
---|
| 2267 | + presetpanel.add(candle); |
---|
| 2268 | + |
---|
| 2269 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2270 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2271 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2272 | + { |
---|
| 2273 | + public void mouseClicked(MouseEvent e) |
---|
| 2274 | + { |
---|
| 2275 | + diffuseField.setFloat(0.001); |
---|
| 2276 | + ambientField.setFloat(0.001); |
---|
| 2277 | + cameraField.setFloat(0.001); |
---|
| 2278 | + specularField.setFloat(0.001); |
---|
| 2279 | + fakedepthField.setFloat(0.001); |
---|
| 2280 | + opacityField.setFloat(0.6); |
---|
| 2281 | + |
---|
| 2282 | + materialtouched = true; |
---|
| 2283 | + applySelf(); |
---|
| 2284 | + } |
---|
| 2285 | + }); |
---|
| 2286 | + presetpanel.add(shadowShader); |
---|
| 2287 | + |
---|
| 2288 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2289 | + |
---|
| 2290 | + presetpanel.preferredWidth = 1; |
---|
| 2291 | + |
---|
| 2292 | + materialpanel.add(presetpanel); |
---|
| 2293 | + materialpanel.add(panel); |
---|
| 2294 | + |
---|
| 2295 | + panel.preferredWidth = 8; |
---|
| 2296 | + |
---|
| 2297 | + /* |
---|
1623 | 2298 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1624 | 2299 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1625 | | - */ |
---|
| 2300 | + */ |
---|
1626 | 2301 | |
---|
1627 | 2302 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1628 | 2303 | |
---|
.. | .. |
---|
1656 | 2331 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1657 | 2332 | |
---|
1658 | 2333 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 2334 | + |
---|
| 2335 | + cGridBag huepanel = new cGridBag(); |
---|
| 2336 | + cGridBag huelabel = new cGridBag(); |
---|
| 2337 | + cLabel hue = GetLabel("icons/hue.png", false); |
---|
| 2338 | + hue.fit = true; |
---|
| 2339 | + |
---|
| 2340 | + hue.addMouseListener(new MouseAdapter() |
---|
| 2341 | + { |
---|
| 2342 | + public void mousePressed(MouseEvent e) |
---|
| 2343 | + { |
---|
| 2344 | + int x = e.getX(); |
---|
| 2345 | + |
---|
| 2346 | + colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth()); |
---|
| 2347 | + } |
---|
| 2348 | + }); |
---|
| 2349 | + |
---|
| 2350 | + huelabel.add(hue); |
---|
| 2351 | + huelabel.preferredWidth = 20; |
---|
| 2352 | + huepanel.add(new cGridBag()); // Label |
---|
| 2353 | + huepanel.add(huelabel); // Field/slider |
---|
| 2354 | + |
---|
| 2355 | + huepanel.preferredHeight = 7; |
---|
| 2356 | + |
---|
| 2357 | + colorSection.add(huepanel); |
---|
1659 | 2358 | |
---|
1660 | 2359 | 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); |
---|
| 2360 | + |
---|
| 2361 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2362 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2363 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2364 | + |
---|
1664 | 2365 | //colorField.preferredWidth = 200; |
---|
1665 | 2366 | colorSection.add(color); |
---|
1666 | 2367 | |
---|
1667 | 2368 | cGridBag modulation = new cGridBag(); |
---|
1668 | 2369 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1669 | 2370 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1670 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2371 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1671 | 2372 | colorSection.add(modulation); |
---|
1672 | 2373 | |
---|
| 2374 | + cGridBag opacity = new cGridBag(); |
---|
| 2375 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2376 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2377 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2378 | + colorSection.add(opacity); |
---|
| 2379 | + |
---|
| 2380 | + colorSection.add(GetSeparator()); |
---|
| 2381 | + |
---|
1673 | 2382 | cGridBag texture = new cGridBag(); |
---|
1674 | 2383 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1675 | 2384 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1676 | 2385 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1677 | 2386 | colorSection.add(texture); |
---|
1678 | 2387 | |
---|
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()); |
---|
| 2388 | + panel.add(GetSeparator()); |
---|
1698 | 2389 | |
---|
1699 | 2390 | panel.add(colorSection); |
---|
1700 | 2391 | |
---|
.. | .. |
---|
1744 | 2435 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1745 | 2436 | diffuseSection.add(fakedepth); |
---|
1746 | 2437 | |
---|
1747 | | - panel.add(new JSeparator()); |
---|
| 2438 | + cGridBag shadowbias = new cGridBag(); |
---|
| 2439 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 2440 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2441 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2442 | + diffuseSection.add(shadowbias); |
---|
| 2443 | + |
---|
| 2444 | + panel.add(GetSeparator()); |
---|
1748 | 2445 | |
---|
1749 | 2446 | panel.add(diffuseSection); |
---|
1750 | 2447 | |
---|
.. | .. |
---|
1794 | 2491 | // aConstraints.gridy += 1; |
---|
1795 | 2492 | // aConstraints.gridwidth = 1; |
---|
1796 | 2493 | |
---|
| 2494 | + cGridBag anisoU = new cGridBag(); |
---|
| 2495 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 2496 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2497 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2498 | + specularSection.add(anisoU); |
---|
1797 | 2499 | |
---|
1798 | | - panel.add(new JSeparator()); |
---|
| 2500 | + cGridBag anisoV = new cGridBag(); |
---|
| 2501 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 2502 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2503 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2504 | + specularSection.add(anisoV); |
---|
| 2505 | + |
---|
| 2506 | + |
---|
| 2507 | + panel.add(GetSeparator()); |
---|
1799 | 2508 | |
---|
1800 | 2509 | panel.add(specularSection); |
---|
1801 | 2510 | |
---|
1802 | 2511 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1803 | 2512 | |
---|
1804 | | - cGridBag globalSection = new cGridBag().setVertical(true); |
---|
| 2513 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1805 | 2514 | |
---|
1806 | 2515 | cGridBag camera = new cGridBag(); |
---|
1807 | 2516 | camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
1808 | 2517 | cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1809 | 2518 | camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1810 | | - globalSection.add(camera); |
---|
| 2519 | + colorSection.add(camera); |
---|
1811 | 2520 | |
---|
1812 | 2521 | cGridBag ambient = new cGridBag(); |
---|
1813 | 2522 | ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
1814 | 2523 | ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1815 | 2524 | ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1816 | | - globalSection.add(ambient); |
---|
| 2525 | + colorSection.add(ambient); |
---|
1817 | 2526 | |
---|
1818 | 2527 | cGridBag backlit = new cGridBag(); |
---|
1819 | 2528 | backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
1820 | 2529 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1821 | 2530 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1822 | | - globalSection.add(backlit); |
---|
| 2531 | + colorSection.add(backlit); |
---|
1823 | 2532 | |
---|
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()); |
---|
| 2533 | + //panel.add(new JSeparator()); |
---|
1831 | 2534 | |
---|
1832 | | - panel.add(globalSection); |
---|
| 2535 | + //panel.add(globalSection); |
---|
1833 | 2536 | |
---|
1834 | 2537 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1835 | 2538 | |
---|
.. | .. |
---|
1871 | 2574 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1872 | 2575 | textureSection.add(opacityPower); |
---|
1873 | 2576 | |
---|
1874 | | - panel.add(new JSeparator()); |
---|
| 2577 | + panel.add(GetSeparator()); |
---|
1875 | 2578 | |
---|
1876 | 2579 | panel.add(textureSection); |
---|
1877 | 2580 | |
---|
.. | .. |
---|
1936 | 2639 | // 3D models |
---|
1937 | 2640 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1938 | 2641 | { |
---|
1939 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1940 | | - LoadFile(filename, lastConverter); |
---|
| 2642 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2643 | + //LoadFile(filename, lastConverter); |
---|
| 2644 | + LoadObjFile(filename); // New 3ds loader |
---|
1941 | 2645 | continue; |
---|
1942 | 2646 | } |
---|
1943 | 2647 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
2663 | 3367 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2664 | 3368 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2665 | 3369 | } |
---|
| 3370 | + |
---|
2666 | 3371 | //cJME.count++; |
---|
2667 | 3372 | //cJME.count %= 12; |
---|
2668 | 3373 | if (gc) |
---|
.. | .. |
---|
2846 | 3551 | } |
---|
2847 | 3552 | } |
---|
2848 | 3553 | } |
---|
| 3554 | + |
---|
2849 | 3555 | cFileSystemPane FSPane; |
---|
2850 | 3556 | |
---|
2851 | 3557 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2855 | 3561 | |
---|
2856 | 3562 | freezematerial = true; |
---|
2857 | 3563 | colorField.setFloat(mat.color); |
---|
2858 | | - modulationField.setFloat(mat.modulation); |
---|
| 3564 | + saturationField.setFloat(mat.modulation); |
---|
2859 | 3565 | metalnessField.setFloat(mat.metalness); |
---|
2860 | 3566 | diffuseField.setFloat(mat.diffuse); |
---|
2861 | 3567 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
2899 | 3605 | } |
---|
2900 | 3606 | } |
---|
2901 | 3607 | } |
---|
| 3608 | + |
---|
2902 | 3609 | freezematerial = false; |
---|
2903 | 3610 | } |
---|
2904 | 3611 | |
---|
.. | .. |
---|
2916 | 3623 | |
---|
2917 | 3624 | if (multiplyToggle != null) |
---|
2918 | 3625 | multiplyToggle.setSelected(mat.multiply); |
---|
2919 | | - |
---|
2920 | | - assert (object.projectedVertices != null); |
---|
2921 | | - |
---|
2922 | | - if (object.projectedVertices.length <= 2) |
---|
2923 | | - { |
---|
2924 | | - // Side effect... |
---|
2925 | | - Object3D.cVector2[] keep = object.projectedVertices; |
---|
2926 | | - object.projectedVertices = new Object3D.cVector2[3]; |
---|
2927 | | - for (int i = 0; i < 3; i++) |
---|
2928 | | - { |
---|
2929 | | - if (i < keep.length) |
---|
2930 | | - { |
---|
2931 | | - object.projectedVertices[i] = keep[i]; |
---|
2932 | | - } else |
---|
2933 | | - { |
---|
2934 | | - object.projectedVertices[i] = new Object3D.cVector2(); |
---|
2935 | | - } |
---|
2936 | | - /* |
---|
2937 | | - if(keep.length == 0) |
---|
2938 | | - object.projectedVertices[0] = new Object3D.cVector2(); |
---|
2939 | | - else |
---|
2940 | | - object.projectedVertices[0] = keep[0]; |
---|
2941 | | - object.projectedVertices[1] = new Object3D.cVector2(); |
---|
2942 | | - */ |
---|
2943 | | - } |
---|
2944 | | - } |
---|
| 3626 | + |
---|
| 3627 | + AllocProjectedVertices(object); |
---|
2945 | 3628 | |
---|
2946 | 3629 | SetMaterial(mat, object.projectedVertices); |
---|
2947 | 3630 | } |
---|
.. | .. |
---|
3017 | 3700 | // } |
---|
3018 | 3701 | |
---|
3019 | 3702 | /**/ |
---|
3020 | | - if (deselect) |
---|
| 3703 | + if (deselect || child == null) |
---|
3021 | 3704 | { |
---|
3022 | 3705 | //group.deselectAll(); |
---|
3023 | 3706 | //freeze = true; |
---|
3024 | 3707 | GetTree().clearSelection(); |
---|
3025 | 3708 | //freeze = false; |
---|
| 3709 | + |
---|
| 3710 | + if (child == null) |
---|
| 3711 | + { |
---|
| 3712 | + return; |
---|
| 3713 | + } |
---|
3026 | 3714 | } |
---|
3027 | 3715 | |
---|
3028 | 3716 | //group.addSelectee(child); |
---|
.. | .. |
---|
3056 | 3744 | public void itemStateChanged(ItemEvent event) |
---|
3057 | 3745 | { |
---|
3058 | 3746 | // System.out.println("Propagate = " + propagate); |
---|
| 3747 | + if (event.getSource() == pinButton) |
---|
| 3748 | + { |
---|
| 3749 | + copy.pinned ^= true; |
---|
| 3750 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3751 | + { |
---|
| 3752 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3753 | + copy.CloseUI(); |
---|
| 3754 | + //copy.editWindow.refreshContents(); |
---|
| 3755 | + } |
---|
| 3756 | + } |
---|
| 3757 | + else |
---|
3059 | 3758 | if (event.getSource() == propagateToggle) |
---|
3060 | 3759 | { |
---|
3061 | 3760 | propagate ^= true; |
---|
.. | .. |
---|
3160 | 3859 | } else if (event.getSource() == liveCB) |
---|
3161 | 3860 | { |
---|
3162 | 3861 | copy.live ^= true; |
---|
| 3862 | + objEditor.refreshContents(true); // To show item colors |
---|
3163 | 3863 | return; |
---|
3164 | | - } else if (event.getSource() == selectCB) |
---|
| 3864 | + } else if (event.getSource() == selectableCB) |
---|
3165 | 3865 | { |
---|
3166 | 3866 | copy.dontselect ^= true; |
---|
3167 | 3867 | return; |
---|
.. | .. |
---|
3169 | 3869 | { |
---|
3170 | 3870 | copy.hide ^= true; |
---|
3171 | 3871 | copy.Touch(); // display list issue |
---|
3172 | | - objEditor.refreshContents(); |
---|
| 3872 | + objEditor.refreshContents(true); // To show item colors |
---|
3173 | 3873 | return; |
---|
3174 | 3874 | } else if (event.getSource() == link2masterCB) |
---|
3175 | 3875 | { |
---|
.. | .. |
---|
3234 | 3934 | //System.out.println("ObjEditor " + event); |
---|
3235 | 3935 | applySelf0(true); |
---|
3236 | 3936 | //parent.applySelf(); |
---|
3237 | | - objEditor.refreshContents(); |
---|
| 3937 | + // conflicts with requestFocus objEditor.refreshContents(); |
---|
3238 | 3938 | } else if (source == resetButton) |
---|
3239 | 3939 | { |
---|
3240 | 3940 | CameraPane.fullreset = true; |
---|
.. | .. |
---|
3346 | 4046 | { |
---|
3347 | 4047 | Close(); |
---|
3348 | 4048 | //return true; |
---|
3349 | | - } else if (source == loadItem) |
---|
| 4049 | + } else if (source == openItem) |
---|
3350 | 4050 | { |
---|
3351 | | - load(); |
---|
| 4051 | + Open(); |
---|
3352 | 4052 | //return true; |
---|
3353 | 4053 | } else if (source == newItem) |
---|
3354 | 4054 | { |
---|
.. | .. |
---|
3373 | 4073 | { |
---|
3374 | 4074 | generatePOV(); |
---|
3375 | 4075 | //return true; |
---|
| 4076 | + } else if (event.getSource() == archiveItem) |
---|
| 4077 | + { |
---|
| 4078 | + cTools.Archive(frame); |
---|
| 4079 | + return; |
---|
3376 | 4080 | } else if (source == zBufferItem) |
---|
3377 | 4081 | { |
---|
3378 | 4082 | try |
---|
.. | .. |
---|
3421 | 4125 | |
---|
3422 | 4126 | static public byte[] Compress(Object3D o) |
---|
3423 | 4127 | { |
---|
| 4128 | + // Slower to actually compress. |
---|
3424 | 4129 | try |
---|
3425 | 4130 | { |
---|
3426 | 4131 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
3427 | | - java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
3428 | | - ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 4132 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 4133 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
3429 | 4134 | |
---|
3430 | 4135 | Object3D parent = o.parent; |
---|
3431 | 4136 | o.parent = null; |
---|
.. | .. |
---|
3436 | 4141 | |
---|
3437 | 4142 | out.flush(); |
---|
3438 | 4143 | |
---|
3439 | | - zstream.close(); |
---|
| 4144 | + baos //zstream |
---|
| 4145 | + .close(); |
---|
3440 | 4146 | out.close(); |
---|
3441 | 4147 | |
---|
3442 | | - return baos.toByteArray(); |
---|
| 4148 | + byte[] bytes = baos.toByteArray(); |
---|
| 4149 | + |
---|
| 4150 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 4151 | + return bytes; |
---|
3443 | 4152 | } catch (Exception e) |
---|
3444 | 4153 | { |
---|
3445 | 4154 | System.err.println(e); |
---|
.. | .. |
---|
3449 | 4158 | |
---|
3450 | 4159 | static public Object Uncompress(byte[] bytes) |
---|
3451 | 4160 | { |
---|
3452 | | - System.out.println("#bytes = " + bytes.length); |
---|
| 4161 | + System.out.println("restore #bytes = " + bytes.length); |
---|
3453 | 4162 | try |
---|
3454 | 4163 | { |
---|
3455 | 4164 | ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
3456 | | - java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
3457 | | - ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 4165 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 4166 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
3458 | 4167 | Object obj = in.readObject(); |
---|
| 4168 | + |
---|
| 4169 | + bais //istream |
---|
| 4170 | + .close(); |
---|
3459 | 4171 | in.close(); |
---|
3460 | 4172 | |
---|
3461 | 4173 | return obj; |
---|
.. | .. |
---|
3510 | 4222 | return null; |
---|
3511 | 4223 | } |
---|
3512 | 4224 | |
---|
3513 | | - java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3514 | 4225 | |
---|
3515 | 4226 | public void Save() |
---|
3516 | 4227 | { |
---|
| 4228 | + //Save(true); |
---|
| 4229 | + Replace(); |
---|
| 4230 | + SetVersionStates(); |
---|
| 4231 | + } |
---|
| 4232 | + |
---|
| 4233 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 4234 | + { |
---|
| 4235 | + if (compress.length != name.length) |
---|
| 4236 | + { |
---|
| 4237 | + return false; |
---|
| 4238 | + } |
---|
| 4239 | + |
---|
| 4240 | + for (int i=compress.length; --i>=0;) |
---|
| 4241 | + { |
---|
| 4242 | + if (compress[i] != name[i]) |
---|
| 4243 | + return false; |
---|
| 4244 | + } |
---|
| 4245 | + |
---|
| 4246 | + return true; |
---|
| 4247 | + } |
---|
| 4248 | + |
---|
| 4249 | + void DeleteVersion() |
---|
| 4250 | + { |
---|
| 4251 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4252 | + { |
---|
| 4253 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4254 | + } |
---|
| 4255 | + |
---|
| 4256 | + if (copy.versionlist[copy.versionindex] == null) |
---|
| 4257 | + copy.versionindex -= 1; |
---|
| 4258 | + |
---|
| 4259 | + if (copy.versionindex != -1) |
---|
| 4260 | + CopyChanged(); |
---|
| 4261 | + |
---|
| 4262 | + SetVersionStates(); |
---|
| 4263 | + } |
---|
| 4264 | + |
---|
| 4265 | + public boolean Save(boolean user) |
---|
| 4266 | + { |
---|
3517 | 4267 | System.err.println("Save"); |
---|
| 4268 | + Replace(); |
---|
3518 | 4269 | |
---|
3519 | | - cRadio tab = GetCurrentTab(); |
---|
| 4270 | + //cRadio tab = GetCurrentTab(); |
---|
3520 | 4271 | |
---|
3521 | | - boolean temp = CameraPane.SWITCH; |
---|
3522 | | - CameraPane.SWITCH = false; |
---|
| 4272 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
3523 | 4273 | |
---|
3524 | | - copy.ExtractBigData(hashtable); |
---|
| 4274 | + boolean thesame = false; |
---|
| 4275 | + |
---|
| 4276 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4277 | +// { |
---|
| 4278 | +// thesame = true; |
---|
| 4279 | +// } |
---|
3525 | 4280 | |
---|
3526 | 4281 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3527 | | - tab.graphs[tab.undoindex++] = Compress(copy); |
---|
3528 | | - |
---|
3529 | | - copy.RestoreBigData(hashtable); |
---|
3530 | | - |
---|
3531 | | - CameraPane.SWITCH = temp; |
---|
3532 | | - |
---|
3533 | | - //assert(hashtable.isEmpty()); |
---|
3534 | | - |
---|
3535 | | - for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 4282 | + if (!thesame) |
---|
3536 | 4283 | { |
---|
3537 | | - tab.graphs[i] = null; |
---|
| 4284 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4285 | + { |
---|
| 4286 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4287 | + } |
---|
| 4288 | + |
---|
| 4289 | + //tab.user[tab.versionindex] = user; |
---|
| 4290 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 4291 | + |
---|
| 4292 | + copy.versionlist[++copy.versionindex] = compress; |
---|
| 4293 | + |
---|
| 4294 | + // if (increment) |
---|
| 4295 | + // tab.versionindex++; |
---|
3538 | 4296 | } |
---|
3539 | 4297 | |
---|
3540 | | - SetUndoStates(); |
---|
| 4298 | + //copy.RestoreBigData(versiontable); |
---|
| 4299 | + |
---|
| 4300 | + //assert(hashtable.isEmpty()); |
---|
| 4301 | + |
---|
| 4302 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4303 | +// { |
---|
| 4304 | +// //tab.user[i] = false; |
---|
| 4305 | +// copy.versionlist[i] = null; |
---|
| 4306 | +// } |
---|
| 4307 | + |
---|
| 4308 | + SetVersionStates(); |
---|
3541 | 4309 | |
---|
3542 | 4310 | // test save |
---|
3543 | 4311 | if (false) |
---|
3544 | 4312 | { |
---|
3545 | 4313 | try |
---|
3546 | 4314 | { |
---|
3547 | | - FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 4315 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
3548 | 4316 | ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
3549 | 4317 | |
---|
3550 | 4318 | p.writeObject(copy); |
---|
.. | .. |
---|
3557 | 4325 | e.printStackTrace(); |
---|
3558 | 4326 | } |
---|
3559 | 4327 | } |
---|
| 4328 | + |
---|
| 4329 | + return !thesame; |
---|
| 4330 | + } |
---|
| 4331 | + |
---|
| 4332 | + boolean flashIt = true; |
---|
| 4333 | + |
---|
| 4334 | + void RefreshSelection() |
---|
| 4335 | + { |
---|
| 4336 | + Object3D selection = new Object3D(); |
---|
| 4337 | + |
---|
| 4338 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4339 | + { |
---|
| 4340 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4341 | + |
---|
| 4342 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4343 | + |
---|
| 4344 | + if (obj == null) |
---|
| 4345 | + { |
---|
| 4346 | + copy.selection.remove(i--); |
---|
| 4347 | + } |
---|
| 4348 | + else |
---|
| 4349 | + { |
---|
| 4350 | + selection.add(obj); |
---|
| 4351 | + copy.selection.setElementAt(obj, i); |
---|
| 4352 | + } |
---|
| 4353 | + } |
---|
| 4354 | + |
---|
| 4355 | + flashIt = false; |
---|
| 4356 | + GetTree().clearSelection(); |
---|
| 4357 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4358 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4359 | + flashIt = true; |
---|
| 4360 | + |
---|
| 4361 | + //refreshContents(false); |
---|
3560 | 4362 | } |
---|
3561 | 4363 | |
---|
3562 | | - void CopyChanged(Object3D obj) |
---|
| 4364 | + void CopyChanged() |
---|
3563 | 4365 | { |
---|
3564 | | - SetUndoStates(); |
---|
| 4366 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4367 | + |
---|
| 4368 | + SetVersionStates(); |
---|
3565 | 4369 | |
---|
3566 | 4370 | boolean temp = CameraPane.SWITCH; |
---|
3567 | 4371 | CameraPane.SWITCH = false; |
---|
3568 | 4372 | |
---|
3569 | | - copy.ExtractBigData(hashtable); |
---|
| 4373 | + copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
3570 | 4374 | |
---|
3571 | 4375 | copy.clear(); |
---|
3572 | 4376 | |
---|
| 4377 | + copy.skyboxname = obj.skyboxname; |
---|
| 4378 | + copy.skyboxext = obj.skyboxext; |
---|
| 4379 | + |
---|
3573 | 4380 | for (int i=0; i<obj.Size(); i++) |
---|
3574 | 4381 | { |
---|
3575 | 4382 | copy.add(obj.get(i)); |
---|
3576 | 4383 | } |
---|
3577 | 4384 | |
---|
3578 | | - copy.RestoreBigData(hashtable); |
---|
| 4385 | + copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
3579 | 4386 | |
---|
3580 | 4387 | CameraPane.SWITCH = temp; |
---|
3581 | 4388 | |
---|
| 4389 | + RefreshSelection(); |
---|
3582 | 4390 | //assert(hashtable.isEmpty()); |
---|
3583 | 4391 | |
---|
3584 | 4392 | copy.Touch(); |
---|
.. | .. |
---|
3599 | 4407 | } |
---|
3600 | 4408 | } |
---|
3601 | 4409 | |
---|
3602 | | - refreshContents(); |
---|
| 4410 | + refreshContents(true); |
---|
3603 | 4411 | } |
---|
3604 | 4412 | |
---|
3605 | | - cButton undoButton; |
---|
3606 | | - cButton redoButton; |
---|
| 4413 | + cButton previousVersionButton; |
---|
| 4414 | + cButton restoreButton; |
---|
| 4415 | + cButton replaceButton; |
---|
| 4416 | + cButton nextVersionButton; |
---|
| 4417 | + cButton saveVersionButton; |
---|
| 4418 | + cButton deleteVersionButton; |
---|
3607 | 4419 | |
---|
3608 | | - void SetUndoStates() |
---|
| 4420 | + boolean muteSlider; |
---|
| 4421 | + |
---|
| 4422 | + int VersionCount() |
---|
3609 | 4423 | { |
---|
3610 | | - cRadio tab = GetCurrentTab(); |
---|
| 4424 | + int count = 0; |
---|
3611 | 4425 | |
---|
3612 | | - undoButton.setEnabled(tab.undoindex > 0); |
---|
3613 | | - redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null); |
---|
| 4426 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 4427 | + { |
---|
| 4428 | + if (copy.versionlist[i] != null) |
---|
| 4429 | + count++; |
---|
| 4430 | + } |
---|
| 4431 | + |
---|
| 4432 | + return count; |
---|
3614 | 4433 | } |
---|
3615 | 4434 | |
---|
3616 | | - public void Undo() |
---|
| 4435 | + void SetVersionStates() |
---|
3617 | 4436 | { |
---|
| 4437 | + //if (true) |
---|
| 4438 | + // return; |
---|
| 4439 | + |
---|
| 4440 | + //cRadio tab = GetCurrentTab(); |
---|
| 4441 | + |
---|
| 4442 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4443 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4444 | + |
---|
| 4445 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4446 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4447 | + |
---|
| 4448 | + deleteVersionButton.setEnabled(copy.versionindex != -1); |
---|
| 4449 | + //copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4450 | + |
---|
| 4451 | + muteSlider = true; |
---|
| 4452 | + versionSlider.setMinimum(0); |
---|
| 4453 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4454 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4455 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
| 4456 | + muteSlider = false; |
---|
| 4457 | + } |
---|
| 4458 | + |
---|
| 4459 | + public boolean PreviousVersion() |
---|
| 4460 | + { |
---|
| 4461 | + // Option? |
---|
| 4462 | + Replace(); |
---|
| 4463 | + |
---|
3618 | 4464 | System.err.println("Undo"); |
---|
3619 | 4465 | |
---|
3620 | | - cRadio tab = GetCurrentTab(); |
---|
| 4466 | + //cRadio tab = GetCurrentTab(); |
---|
3621 | 4467 | |
---|
3622 | | - if (tab.undoindex == 0) |
---|
| 4468 | + if (copy.versionindex == 0) |
---|
3623 | 4469 | { |
---|
3624 | 4470 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3625 | | - return; |
---|
| 4471 | + return false; |
---|
3626 | 4472 | } |
---|
3627 | 4473 | |
---|
3628 | | - if (tab.graphs[tab.undoindex] == null) |
---|
3629 | | - { |
---|
3630 | | - Save(); |
---|
3631 | | - tab.undoindex -= 1; |
---|
3632 | | - } |
---|
| 4474 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 4475 | +// { |
---|
| 4476 | +// if (Save(false)) |
---|
| 4477 | +// tab.versionindex -= 1; |
---|
| 4478 | +// else |
---|
| 4479 | +// { |
---|
| 4480 | +// if (tab.versionindex <= 0) |
---|
| 4481 | +// return false; |
---|
| 4482 | +// else |
---|
| 4483 | +// tab.versionindex -= 1; |
---|
| 4484 | +// } |
---|
| 4485 | +// } |
---|
3633 | 4486 | |
---|
3634 | | - tab.undoindex -= 1; |
---|
| 4487 | + copy.versionindex -= 1; |
---|
3635 | 4488 | |
---|
3636 | | - CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 4489 | + CopyChanged(); |
---|
| 4490 | + |
---|
| 4491 | + return true; |
---|
3637 | 4492 | } |
---|
3638 | 4493 | |
---|
3639 | | - public void Redo() |
---|
| 4494 | + public boolean Restore() |
---|
3640 | 4495 | { |
---|
3641 | | - cRadio tab = GetCurrentTab(); |
---|
| 4496 | + System.err.println("Restore"); |
---|
3642 | 4497 | |
---|
3643 | | - if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 4498 | + //cRadio tab = GetCurrentTab(); |
---|
| 4499 | + |
---|
| 4500 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4501 | + { |
---|
| 4502 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4503 | + return false; |
---|
| 4504 | + } |
---|
| 4505 | + |
---|
| 4506 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4507 | + CopyChanged(); |
---|
| 4508 | + |
---|
| 4509 | + return true; |
---|
| 4510 | + } |
---|
| 4511 | + |
---|
| 4512 | + public boolean Replace() |
---|
| 4513 | + { |
---|
| 4514 | + //System.err.println("Replace"); |
---|
| 4515 | + |
---|
| 4516 | + //cRadio tab = GetCurrentTab(); |
---|
| 4517 | + |
---|
| 4518 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4519 | + { |
---|
| 4520 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4521 | + return false; |
---|
| 4522 | + } |
---|
| 4523 | + |
---|
| 4524 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
| 4525 | + |
---|
| 4526 | + return true; |
---|
| 4527 | + } |
---|
| 4528 | + |
---|
| 4529 | + public void NextVersion() |
---|
| 4530 | + { |
---|
| 4531 | + // Option? |
---|
| 4532 | + Replace(); |
---|
| 4533 | + |
---|
| 4534 | + //cRadio tab = GetCurrentTab(); |
---|
| 4535 | + |
---|
| 4536 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3644 | 4537 | { |
---|
3645 | 4538 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3646 | 4539 | return; |
---|
3647 | 4540 | } |
---|
3648 | 4541 | |
---|
3649 | | - tab.undoindex += 1; |
---|
| 4542 | + copy.versionindex += 1; |
---|
3650 | 4543 | |
---|
3651 | | - CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 4544 | + CopyChanged(); |
---|
| 4545 | + |
---|
| 4546 | + //if (!tab.user[tab.versionindex]) |
---|
| 4547 | + // tab.graphs[tab.versionindex] = null; |
---|
3652 | 4548 | } |
---|
3653 | 4549 | |
---|
3654 | 4550 | void ImportGFD() |
---|
.. | .. |
---|
3842 | 4738 | // else |
---|
3843 | 4739 | // applySelf(true); |
---|
3844 | 4740 | // } |
---|
| 4741 | + |
---|
| 4742 | + boolean Equal(double a, double b) |
---|
| 4743 | + { |
---|
| 4744 | + return Math.abs(a - b) < 0.001; |
---|
| 4745 | + } |
---|
| 4746 | + |
---|
3845 | 4747 | void applySelf0(boolean name) |
---|
3846 | 4748 | { |
---|
3847 | 4749 | if (name) |
---|
.. | .. |
---|
3859 | 4761 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
3860 | 4762 | |
---|
3861 | 4763 | current.color = (float) colorField.getFloat(); |
---|
3862 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4764 | + current.modulation = (float) saturationField.getFloat(); |
---|
3863 | 4765 | current.metalness = (float) metalnessField.getFloat(); |
---|
3864 | 4766 | current.diffuse = (float) diffuseField.getFloat(); |
---|
3865 | 4767 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
3891 | 4793 | { |
---|
3892 | 4794 | cMaterial mat = copy.material; |
---|
3893 | 4795 | |
---|
3894 | | - colorField.SetToolTipValue((mat.color)); |
---|
3895 | | - modulationField.SetToolTipValue((mat.modulation)); |
---|
3896 | | - metalnessField.SetToolTipValue((mat.metalness)); |
---|
3897 | | - diffuseField.SetToolTipValue((mat.diffuse)); |
---|
3898 | | - specularField.SetToolTipValue((mat.specular)); |
---|
3899 | | - shininessField.SetToolTipValue((mat.shininess)); |
---|
3900 | | - shiftField.SetToolTipValue((mat.shift)); |
---|
3901 | | - ambientField.SetToolTipValue((mat.ambient)); |
---|
3902 | | - lightareaField.SetToolTipValue((mat.lightarea)); |
---|
3903 | | - diffusenessField.SetToolTipValue((mat.factor)); |
---|
3904 | | - velvetField.SetToolTipValue((mat.velvet)); |
---|
3905 | | - sheenField.SetToolTipValue((mat.sheen)); |
---|
3906 | | - subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
3907 | | - backlitField.SetToolTipValue((mat.bump)); |
---|
3908 | | - anisoField.SetToolTipValue((mat.aniso)); |
---|
3909 | | - anisoVField.SetToolTipValue((mat.anisoV)); |
---|
3910 | | - cameraField.SetToolTipValue((mat.cameralight)); |
---|
3911 | | - selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
3912 | | - shadowField.SetToolTipValue((mat.shadow)); |
---|
3913 | | - textureField.SetToolTipValue((mat.texture)); |
---|
3914 | | - opacityField.SetToolTipValue((mat.opacity)); |
---|
3915 | | - fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
3916 | | - shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4796 | + if (!Equal(colorField.getFloat(), mat.color)) |
---|
| 4797 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4798 | + if (!Equal(saturationField.getFloat(), mat.modulation)) |
---|
| 4799 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4800 | + if (!Equal(metalnessField.getFloat(), mat.metalness)) |
---|
| 4801 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4802 | + if (!Equal(diffuseField.getFloat(), mat.diffuse)) |
---|
| 4803 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4804 | + if (!Equal(specularField.getFloat(), mat.specular)) |
---|
| 4805 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4806 | + if (!Equal(shininessField.getFloat(), mat.shininess)) |
---|
| 4807 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4808 | + if (!Equal(shiftField.getFloat(), mat.shift)) |
---|
| 4809 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4810 | + if (!Equal(ambientField.getFloat(), mat.ambient)) |
---|
| 4811 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4812 | + if (!Equal(lightareaField.getFloat(), mat.lightarea)) |
---|
| 4813 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4814 | + if (!Equal(diffusenessField.getFloat(), mat.factor)) |
---|
| 4815 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4816 | + if (!Equal(velvetField.getFloat(), mat.velvet)) |
---|
| 4817 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4818 | + if (!Equal(sheenField.getFloat(), mat.sheen)) |
---|
| 4819 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4820 | + if (!Equal(subsurfaceField.getFloat(), mat.subsurface)) |
---|
| 4821 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4822 | + if (!Equal(backlitField.getFloat(), mat.bump)) |
---|
| 4823 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4824 | + if (!Equal(anisoField.getFloat(), mat.aniso)) |
---|
| 4825 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4826 | + if (!Equal(anisoVField.getFloat(), mat.anisoV)) |
---|
| 4827 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4828 | + if (!Equal(cameraField.getFloat(), mat.cameralight)) |
---|
| 4829 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4830 | + if (!Equal(selfshadowField.getFloat(), mat.diffuseness)) |
---|
| 4831 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4832 | + if (!Equal(shadowField.getFloat(), mat.shadow)) |
---|
| 4833 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4834 | + if (!Equal(textureField.getFloat(), mat.texture)) |
---|
| 4835 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4836 | + if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
| 4837 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4838 | + if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
| 4839 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4840 | + if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
| 4841 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
3917 | 4842 | } |
---|
3918 | 4843 | |
---|
3919 | 4844 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
.. | .. |
---|
3944 | 4869 | //copy.Touch(); |
---|
3945 | 4870 | } |
---|
3946 | 4871 | |
---|
| 4872 | + cNumberSlider versionSlider; |
---|
| 4873 | + |
---|
3947 | 4874 | public void stateChanged(ChangeEvent e) |
---|
3948 | 4875 | { |
---|
3949 | 4876 | // assert(false); |
---|
| 4877 | + if (e.getSource() == versionSlider) |
---|
| 4878 | + { |
---|
| 4879 | + if (muteSlider) |
---|
| 4880 | + return; |
---|
| 4881 | + |
---|
| 4882 | + Replace(); |
---|
| 4883 | + |
---|
| 4884 | + int version = versionSlider.getInteger(); |
---|
| 4885 | + |
---|
| 4886 | + if (version != -1 && copy.versionlist[version] != null) |
---|
| 4887 | + { |
---|
| 4888 | + copy.versionindex = version; |
---|
| 4889 | + CopyChanged(); |
---|
| 4890 | + } |
---|
| 4891 | + |
---|
| 4892 | + return; |
---|
| 4893 | + } |
---|
3950 | 4894 | |
---|
3951 | 4895 | if (freezematerial) |
---|
3952 | 4896 | { |
---|
.. | .. |
---|
3982 | 4926 | { |
---|
3983 | 4927 | //System.out.println("stateChanged = " + this); |
---|
3984 | 4928 | materialtouched = true; |
---|
| 4929 | + |
---|
| 4930 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4931 | + { |
---|
| 4932 | + saturationField.setFloat(1); |
---|
| 4933 | + } |
---|
| 4934 | + |
---|
3985 | 4935 | applySelf(); |
---|
3986 | 4936 | //System.out.println("this = " + this); |
---|
3987 | 4937 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
4281 | 5231 | { |
---|
4282 | 5232 | if (GetTree() != null) |
---|
4283 | 5233 | { |
---|
| 5234 | + GetTree().revalidate(); |
---|
4284 | 5235 | GetTree().repaint(); |
---|
4285 | 5236 | } |
---|
4286 | 5237 | |
---|
.. | .. |
---|
4289 | 5240 | ctrlPanel.validate(); // ? new |
---|
4290 | 5241 | ctrlPanel.repaint(); |
---|
4291 | 5242 | } |
---|
| 5243 | + |
---|
| 5244 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5245 | + SetVersionStates(); |
---|
| 5246 | + |
---|
| 5247 | + cameraView.requestFocusInWindow(); |
---|
4292 | 5248 | } |
---|
4293 | 5249 | |
---|
4294 | 5250 | static TweenManager tweenManager = new TweenManager(); |
---|
4295 | 5251 | |
---|
4296 | 5252 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4297 | 5253 | { |
---|
4298 | | - if (Globals.SAVEONMAKE) // && resetmodel) |
---|
| 5254 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
4299 | 5255 | Save(); |
---|
4300 | 5256 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4301 | 5257 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
.. | .. |
---|
4320 | 5276 | // group = (Composite) group.get(0); |
---|
4321 | 5277 | // } |
---|
4322 | 5278 | |
---|
4323 | | - System.out.println("makeSomething of " + thing); |
---|
| 5279 | + //System.out.println("makeSomething of " + thing); |
---|
4324 | 5280 | |
---|
4325 | 5281 | /* |
---|
4326 | 5282 | if (deselect && jList != null) |
---|
.. | .. |
---|
4537 | 5493 | readobj.ResetDisplayList(); |
---|
4538 | 5494 | } catch (Exception e) |
---|
4539 | 5495 | { |
---|
4540 | | - //e.printStackTrace(); |
---|
| 5496 | + if (!e.toString().contains("GZIP")) |
---|
| 5497 | + e.printStackTrace(); |
---|
| 5498 | + |
---|
4541 | 5499 | try |
---|
4542 | 5500 | { |
---|
4543 | 5501 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
.. | .. |
---|
4611 | 5569 | |
---|
4612 | 5570 | if (readobj != null) |
---|
4613 | 5571 | { |
---|
4614 | | - if (Globals.SAVEONMAKE) |
---|
4615 | | - Save(); |
---|
| 5572 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 5573 | + // Save(); |
---|
4616 | 5574 | try |
---|
4617 | 5575 | { |
---|
4618 | 5576 | //readobj.deepCopySelf(copy); |
---|
4619 | 5577 | copy.clear(); // june 2014 |
---|
| 5578 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5579 | + copy.skyboxext = readobj.skyboxext; |
---|
4620 | 5580 | for (int i = 0; i < readobj.size(); i++) |
---|
4621 | 5581 | { |
---|
4622 | 5582 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4657 | 5617 | } |
---|
4658 | 5618 | } catch (ClassCastException e) |
---|
4659 | 5619 | { |
---|
| 5620 | + e.printStackTrace(); |
---|
4660 | 5621 | assert (false); |
---|
4661 | 5622 | Composite c = (Composite) copy; |
---|
4662 | 5623 | c.children.clear(); |
---|
.. | .. |
---|
4667 | 5628 | c.addChild(csg); |
---|
4668 | 5629 | } |
---|
4669 | 5630 | |
---|
| 5631 | + copy.versionlist = readobj.versionlist; |
---|
| 5632 | + copy.versionindex = readobj.versionindex; |
---|
| 5633 | + copy.versiontable = readobj.versiontable; |
---|
| 5634 | + |
---|
| 5635 | + if (copy.versionlist == null) |
---|
| 5636 | + { |
---|
| 5637 | + // Backward compatibility |
---|
| 5638 | + copy.versionlist = new Object3D[100]; |
---|
| 5639 | + copy.versionindex = -1; |
---|
| 5640 | + |
---|
| 5641 | + //Save(true); |
---|
| 5642 | + } |
---|
| 5643 | + |
---|
| 5644 | + //? SetUndoStates(); |
---|
| 5645 | + |
---|
4670 | 5646 | ResetModel(); |
---|
4671 | 5647 | copy.HardTouch(); // recompile? |
---|
4672 | 5648 | refreshContents(); |
---|
4673 | 5649 | } |
---|
4674 | 5650 | } |
---|
4675 | 5651 | |
---|
4676 | | - void load() // throws ClassNotFoundException |
---|
| 5652 | + void Open() // throws ClassNotFoundException |
---|
4677 | 5653 | { |
---|
4678 | 5654 | if (Grafreed.standAlone) |
---|
4679 | 5655 | { |
---|
4680 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5656 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4681 | 5657 | browser.show(); |
---|
4682 | 5658 | String filename = browser.getFile(); |
---|
4683 | 5659 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4754 | 5730 | |
---|
4755 | 5731 | void save() |
---|
4756 | 5732 | { |
---|
| 5733 | + Replace(); |
---|
| 5734 | + |
---|
4757 | 5735 | if (lastname == null) |
---|
4758 | 5736 | { |
---|
4759 | 5737 | return; |
---|
.. | .. |
---|
4776 | 5754 | //ps.print(buffer.toString()); |
---|
4777 | 5755 | } catch (IOException e) |
---|
4778 | 5756 | { |
---|
| 5757 | + e.printStackTrace(); |
---|
4779 | 5758 | } |
---|
4780 | 5759 | } |
---|
4781 | 5760 | |
---|
.. | .. |
---|
4958 | 5937 | MenuBar menuBar; |
---|
4959 | 5938 | Menu fileMenu; |
---|
4960 | 5939 | MenuItem newItem; |
---|
4961 | | - MenuItem loadItem; |
---|
| 5940 | + MenuItem openItem; |
---|
4962 | 5941 | MenuItem saveItem; |
---|
4963 | 5942 | MenuItem saveAsItem; |
---|
4964 | 5943 | MenuItem exportAsItem; |
---|
.. | .. |
---|
4981 | 5960 | CheckboxMenuItem toggleSwitchItem; |
---|
4982 | 5961 | CheckboxMenuItem toggleRootItem; |
---|
4983 | 5962 | CheckboxMenuItem animationItem; |
---|
| 5963 | + MenuItem archiveItem; |
---|
4984 | 5964 | CheckboxMenuItem toggleHandleItem; |
---|
4985 | 5965 | CheckboxMenuItem togglePaintItem; |
---|
4986 | 5966 | JSplitPane mainPanel; |
---|
.. | .. |
---|
4994 | 5974 | ButtonGroup buttonGroup; |
---|
4995 | 5975 | |
---|
4996 | 5976 | cGridBag toolboxPanel; |
---|
| 5977 | + cGridBag skyboxPanel; |
---|
4997 | 5978 | cGridBag materialPanel; |
---|
4998 | 5979 | cGridBag ctrlPanel; |
---|
4999 | 5980 | |
---|
.. | .. |
---|
5067 | 6048 | JLabel colorLabel; |
---|
5068 | 6049 | cNumberSlider colorField; |
---|
5069 | 6050 | JLabel modulationLabel; |
---|
5070 | | - cNumberSlider modulationField; |
---|
| 6051 | + cNumberSlider saturationField; |
---|
5071 | 6052 | JLabel metalnessLabel; |
---|
5072 | 6053 | cNumberSlider metalnessField; |
---|
5073 | 6054 | JLabel diffuseLabel; |
---|
.. | .. |
---|
5098 | 6079 | cNumberSlider anisoField; |
---|
5099 | 6080 | JLabel anisoVLabel; |
---|
5100 | 6081 | cNumberSlider anisoVField; |
---|
| 6082 | + |
---|
5101 | 6083 | JLabel cameraLabel; |
---|
5102 | 6084 | cNumberSlider cameraField; |
---|
5103 | 6085 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
5112 | 6094 | cNumberSlider fakedepthField; |
---|
5113 | 6095 | JLabel shadowbiasLabel; |
---|
5114 | 6096 | cNumberSlider shadowbiasField; |
---|
| 6097 | + |
---|
5115 | 6098 | JLabel bumpLabel; |
---|
5116 | 6099 | cNumberSlider bumpField; |
---|
5117 | 6100 | JLabel noiseLabel; |
---|