.. | .. |
---|
4 | 4 | |
---|
5 | 5 | import java.awt.*; |
---|
6 | 6 | import java.awt.event.*; |
---|
| 7 | +import java.awt.image.BufferedImage; |
---|
7 | 8 | import javax.swing.*; |
---|
8 | 9 | import javax.swing.event.*; |
---|
9 | 10 | import javax.swing.text.*; |
---|
.. | .. |
---|
13 | 14 | import javax.swing.plaf.metal.MetalLookAndFeel; |
---|
14 | 15 | //import javax.swing.plaf.ColorUIResource; |
---|
15 | 16 | //import javax.swing.plaf.metal.DefaultMetalTheme; |
---|
| 17 | + |
---|
| 18 | +import javax.swing.plaf.basic.BasicSplitPaneDivider; |
---|
| 19 | +import javax.swing.plaf.basic.BasicSplitPaneUI; |
---|
16 | 20 | |
---|
17 | 21 | //import javax.media.opengl.GLCanvas; |
---|
18 | 22 | |
---|
.. | .. |
---|
30 | 34 | iSendInfo |
---|
31 | 35 | //KeyListener |
---|
32 | 36 | { |
---|
| 37 | + public cToggleButton pinButton; |
---|
33 | 38 | boolean timeline; |
---|
34 | 39 | boolean wasFullScreen; |
---|
35 | 40 | |
---|
36 | 41 | GroupEditor callee; |
---|
37 | 42 | JFrame frame; |
---|
| 43 | + |
---|
| 44 | + static ObjEditor theFrame; |
---|
| 45 | + |
---|
| 46 | + public cGridBag GetSeparator() |
---|
| 47 | + { |
---|
| 48 | + cGridBag separator = new cGridBag(); |
---|
| 49 | + separator.add(new JSeparator()); |
---|
| 50 | + separator.preferredHeight = 5; |
---|
| 51 | + return separator; |
---|
| 52 | + } |
---|
| 53 | + |
---|
| 54 | + cButton GetButton(String name, boolean border) |
---|
| 55 | + { |
---|
| 56 | + ImageIcon icon = GetIcon(name); |
---|
| 57 | + return new cButton(icon, border); |
---|
| 58 | + } |
---|
| 59 | + |
---|
| 60 | + cLabel GetLabel(String name, boolean border) |
---|
| 61 | + { |
---|
| 62 | + //ImageIcon icon = GetIcon(name); |
---|
| 63 | + return new cLabel(GetImage(name), border); |
---|
| 64 | + } |
---|
| 65 | + |
---|
| 66 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 67 | + { |
---|
| 68 | + ImageIcon icon = GetIcon(name); |
---|
| 69 | + return new cToggleButton(icon, border); |
---|
| 70 | + } |
---|
| 71 | + |
---|
| 72 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 73 | + { |
---|
| 74 | + ImageIcon icon = GetIcon(name); |
---|
| 75 | + return new cCheckBox(icon, border); |
---|
| 76 | + } |
---|
| 77 | + |
---|
| 78 | + static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); |
---|
| 79 | + |
---|
| 80 | + ImageIcon GetIcon(String name) |
---|
| 81 | + { |
---|
| 82 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 83 | + if (iconCache != null) |
---|
| 84 | + { |
---|
| 85 | + return iconCache; |
---|
| 86 | + } |
---|
| 87 | + |
---|
| 88 | + try |
---|
| 89 | + { |
---|
| 90 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 91 | + |
---|
| 92 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 93 | +// { |
---|
| 94 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 95 | +// Graphics2D g = resized.createGraphics(); |
---|
| 96 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 97 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 98 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 99 | +// g.dispose(); |
---|
| 100 | +// |
---|
| 101 | +// image = resized; |
---|
| 102 | +// } |
---|
| 103 | + |
---|
| 104 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 105 | + |
---|
| 106 | + icons.put(name, icon); |
---|
| 107 | + |
---|
| 108 | + return icon; |
---|
| 109 | + } |
---|
| 110 | + catch (Exception e) |
---|
| 111 | + { |
---|
| 112 | + //icons.put(name, null); |
---|
| 113 | + return null; |
---|
| 114 | + } |
---|
| 115 | + } |
---|
| 116 | + |
---|
| 117 | + BufferedImage GetImage(String name) |
---|
| 118 | + { |
---|
| 119 | + try |
---|
| 120 | + { |
---|
| 121 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 122 | + |
---|
| 123 | + return image; |
---|
| 124 | + } |
---|
| 125 | + catch (Exception e) |
---|
| 126 | + { |
---|
| 127 | + return null; |
---|
| 128 | + } |
---|
| 129 | + } |
---|
38 | 130 | |
---|
39 | 131 | // SCRIPT |
---|
40 | 132 | |
---|
.. | .. |
---|
145 | 237 | |
---|
146 | 238 | objEditor.ctrlPanel.remove(namePanel); |
---|
147 | 239 | |
---|
148 | | - if (!GroupEditor.allparams) |
---|
| 240 | + if (!allparams) |
---|
149 | 241 | return; |
---|
150 | 242 | |
---|
151 | 243 | // objEditor.ctrlPanel.remove(liveCB); |
---|
.. | .. |
---|
168 | 260 | // objEditor.ctrlPanel.remove(remarkButton); |
---|
169 | 261 | |
---|
170 | 262 | objEditor.ctrlPanel.remove(setupPanel); |
---|
171 | | - objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 263 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 264 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
172 | 265 | objEditor.ctrlPanel.remove(pushPanel); |
---|
173 | 266 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
174 | 267 | |
---|
.. | .. |
---|
216 | 309 | client = inClient; |
---|
217 | 310 | copy = client; |
---|
218 | 311 | |
---|
| 312 | +// if (copy.versionlist == null) |
---|
| 313 | +// { |
---|
| 314 | +// copy.versionlist = new Object3D[100]; |
---|
| 315 | +// copy.versionindex = -1; |
---|
| 316 | +// |
---|
| 317 | +// callee.Save(true); |
---|
| 318 | +// } |
---|
| 319 | + |
---|
219 | 320 | // "this" is not called: SetupUI2(objEditor); |
---|
220 | 321 | } |
---|
221 | 322 | |
---|
.. | .. |
---|
229 | 330 | client = inClient; |
---|
230 | 331 | copy = client; |
---|
231 | 332 | |
---|
| 333 | + if (copy.versionlist == null) |
---|
| 334 | + { |
---|
| 335 | + copy.versionlist = new Object3D[100]; |
---|
| 336 | + copy.versionindex = -1; |
---|
| 337 | + |
---|
| 338 | +// Save(true); |
---|
| 339 | + } |
---|
| 340 | + |
---|
232 | 341 | SetupUI2(callee.GetEditor()); |
---|
233 | 342 | } |
---|
234 | 343 | |
---|
.. | .. |
---|
243 | 352 | //localCopy.parent = null; |
---|
244 | 353 | |
---|
245 | 354 | frame = new JFrame(); |
---|
| 355 | + frame.setUndecorated(false); |
---|
246 | 356 | objEditor = this; |
---|
247 | 357 | this.callee = callee; |
---|
248 | 358 | |
---|
.. | .. |
---|
260 | 370 | copy = localCopy; |
---|
261 | 371 | copy.editWindow = this; |
---|
262 | 372 | |
---|
| 373 | +// if (copy.versionlist == null) |
---|
| 374 | +// { |
---|
| 375 | +// copy.versionlist = new Object3D[100]; |
---|
| 376 | +// copy.versionindex = -1; |
---|
| 377 | +// |
---|
| 378 | +// Save(true); |
---|
| 379 | +// } |
---|
| 380 | + |
---|
263 | 381 | SetupMenu(); |
---|
264 | 382 | |
---|
265 | 383 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
273 | 391 | return frame.action(event, obj); |
---|
274 | 392 | } |
---|
275 | 393 | |
---|
| 394 | + // Cannot work without static |
---|
| 395 | + static boolean allparams = true; |
---|
| 396 | + |
---|
| 397 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 398 | + |
---|
276 | 399 | void SetupMenu() |
---|
277 | 400 | { |
---|
278 | 401 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
279 | 402 | menuBar.add(fileMenu = new Menu("File")); |
---|
280 | 403 | fileMenu.add(newItem = new MenuItem("New")); |
---|
281 | | - fileMenu.add(loadItem = new MenuItem("Load...")); |
---|
| 404 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
282 | 405 | |
---|
283 | 406 | //oe.menuBar.add(menu = new Menu("Include")); |
---|
284 | 407 | Menu menu = new Menu("Import"); |
---|
.. | .. |
---|
310 | 433 | } |
---|
311 | 434 | |
---|
312 | 435 | newItem.addActionListener(this); |
---|
313 | | - loadItem.addActionListener(this); |
---|
| 436 | + openItem.addActionListener(this); |
---|
314 | 437 | saveItem.addActionListener(this); |
---|
315 | 438 | saveAsItem.addActionListener(this); |
---|
316 | 439 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
319 | 442 | closeItem.addActionListener(this); |
---|
320 | 443 | |
---|
321 | 444 | objectPanel = new JTabbedPane(); |
---|
| 445 | + |
---|
| 446 | + ChangeListener changeListener = new ChangeListener() |
---|
| 447 | + { |
---|
| 448 | + //String name; |
---|
| 449 | + |
---|
| 450 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 451 | + { |
---|
| 452 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 453 | +// { |
---|
| 454 | +// if (latestObject != null) |
---|
| 455 | +// { |
---|
| 456 | +// refreshContents(true); |
---|
| 457 | +// SetMaterial(latestObject); |
---|
| 458 | +// } |
---|
| 459 | +// |
---|
| 460 | +// materialFlushed = true; |
---|
| 461 | +// } |
---|
| 462 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 463 | +// { |
---|
| 464 | +// if (listUI.size() == 0) |
---|
| 465 | +// EditSelection(false); |
---|
| 466 | +// } |
---|
| 467 | + |
---|
| 468 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 469 | +// { |
---|
| 470 | +// name = copy.skyboxname; |
---|
| 471 | +// |
---|
| 472 | +// if (name == null) |
---|
| 473 | +// { |
---|
| 474 | +// name = ""; |
---|
| 475 | +// } |
---|
| 476 | +// |
---|
| 477 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 478 | +// copy.skyboxext = "jpg"; |
---|
| 479 | +// } |
---|
| 480 | +// else |
---|
| 481 | +// { |
---|
| 482 | +// if (name != null) |
---|
| 483 | +// { |
---|
| 484 | +// if (name.equals("")) |
---|
| 485 | +// { |
---|
| 486 | +// copy.skyboxname = null; |
---|
| 487 | +// copy.skyboxext = null; |
---|
| 488 | +// } |
---|
| 489 | +// else |
---|
| 490 | +// { |
---|
| 491 | +// copy.skyboxname = name; |
---|
| 492 | +// } |
---|
| 493 | +// } |
---|
| 494 | +// } |
---|
| 495 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 496 | + |
---|
| 497 | +// refreshContents(false); // To refresh Info tab |
---|
| 498 | + cameraView.repaint(); |
---|
| 499 | + } |
---|
| 500 | + }; |
---|
| 501 | + objectPanel.addChangeListener(changeListener); |
---|
| 502 | + |
---|
322 | 503 | toolbarPanel = new JPanel(); |
---|
323 | 504 | toolbarPanel.setName("Toolbar"); |
---|
| 505 | + |
---|
324 | 506 | treePanel = new cGridBag(); |
---|
325 | 507 | treePanel.setName("Tree"); |
---|
| 508 | + |
---|
| 509 | + editPanel = new cGridBag().setVertical(true); |
---|
| 510 | + //editPanel.setName("Edit"); |
---|
| 511 | + |
---|
326 | 512 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
327 | | - ctrlPanel.setName("Edit"); |
---|
328 | | - materialPanel = new cGridBag().setVertical(true); |
---|
329 | | - materialPanel.setName("Material"); |
---|
| 513 | + |
---|
| 514 | + editCommandsPanel = new cGridBag(); |
---|
| 515 | + editPanel.add(editCommandsPanel); |
---|
| 516 | + editPanel.add(ctrlPanel); |
---|
| 517 | + |
---|
| 518 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 519 | + //toolboxPanel.setName("Toolbox"); |
---|
| 520 | + |
---|
| 521 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 522 | + |
---|
| 523 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 524 | + //materialPanel.setName("Material"); |
---|
| 525 | + |
---|
330 | 526 | /*JTextPane*/ |
---|
331 | 527 | infoarea = createTextPane(); |
---|
332 | 528 | doc = infoarea.getStyledDocument(); |
---|
333 | 529 | |
---|
334 | 530 | infoarea.setEditable(true); |
---|
335 | 531 | SetText(); |
---|
| 532 | + |
---|
336 | 533 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
337 | 534 | // infoarea.setOpaque(false); |
---|
338 | 535 | // //infoarea.setForeground(textcolor); |
---|
339 | 536 | // TEXTAREA infoarea.setLineWrap(true); |
---|
340 | 537 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
341 | 538 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
342 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
343 | | - infoPanel.setName("Info"); |
---|
| 539 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
| 540 | + //infoPanel.setName("Info"); |
---|
344 | 541 | //infoPanel.setLayout(new BorderLayout()); |
---|
345 | 542 | //infoPanel.add(createTextPane()); |
---|
346 | 543 | |
---|
.. | .. |
---|
351 | 548 | mainPanel.setDividerSize(9); |
---|
352 | 549 | mainPanel.setDividerLocation(0.5); //1.0); |
---|
353 | 550 | mainPanel.setResizeWeight(0.5); |
---|
354 | | - |
---|
| 551 | + |
---|
| 552 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 553 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 554 | + divider.setDividerSize(15); |
---|
| 555 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 556 | + |
---|
| 557 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 558 | + |
---|
355 | 559 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
356 | 560 | //mainPanel.setLayout(new GridBagLayout()); |
---|
357 | 561 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
.. | .. |
---|
419 | 623 | e.printStackTrace(); |
---|
420 | 624 | } |
---|
421 | 625 | |
---|
422 | | - String selection = infoarea.getText(); |
---|
423 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
424 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
425 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 626 | +// String selection = infoarea.getText(); |
---|
| 627 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 628 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 629 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
426 | 630 | //clipboard.setContents(data, data); |
---|
427 | 631 | } |
---|
428 | 632 | |
---|
.. | .. |
---|
582 | 786 | } |
---|
583 | 787 | } |
---|
584 | 788 | |
---|
| 789 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 790 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 791 | + |
---|
| 792 | + Rectangle keeprect; |
---|
| 793 | + cRadio radio; |
---|
| 794 | + |
---|
| 795 | +cButton keepButton; |
---|
| 796 | + cButton twoButton; // Full 3D |
---|
| 797 | + cButton sixButton; |
---|
| 798 | + cButton threeButton; |
---|
| 799 | + cButton sevenButton; |
---|
| 800 | + cButton fourButton; // full panel |
---|
| 801 | + cButton oneButton; // full XYZ |
---|
| 802 | + //cButton currentLayout; |
---|
| 803 | + |
---|
| 804 | + boolean maximized; |
---|
| 805 | + |
---|
| 806 | + cButton fullscreenLayout; |
---|
| 807 | + cButton expandedLayout; |
---|
| 808 | + |
---|
| 809 | + void Minimize() |
---|
| 810 | + { |
---|
| 811 | + frame.setState(Frame.ICONIFIED); |
---|
| 812 | + frame.validate(); |
---|
| 813 | + } |
---|
| 814 | + |
---|
| 815 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 816 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 817 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
| 818 | + void Maximize() |
---|
| 819 | + { |
---|
| 820 | + if (CameraPane.FULLSCREEN) |
---|
| 821 | + { |
---|
| 822 | + ToggleFullScreen(); |
---|
| 823 | + } |
---|
| 824 | + |
---|
| 825 | + if (maximized) |
---|
| 826 | + { |
---|
| 827 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 828 | + } |
---|
| 829 | + else |
---|
| 830 | + { |
---|
| 831 | + keeprect = frame.getBounds(); |
---|
| 832 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 833 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 834 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 835 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 836 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
| 837 | + } |
---|
| 838 | + |
---|
| 839 | + maximized ^= true; |
---|
| 840 | + |
---|
| 841 | + frame.validate(); |
---|
| 842 | + } |
---|
| 843 | + |
---|
| 844 | + cButton minButton; |
---|
| 845 | + cButton maxButton; |
---|
| 846 | + cButton fullButton; |
---|
| 847 | + cButton collapseButton; |
---|
| 848 | + cButton maximize3DButton; |
---|
| 849 | + |
---|
585 | 850 | void ToggleFullScreen() |
---|
586 | 851 | { |
---|
587 | | - if (CameraPane.FULLSCREEN) |
---|
| 852 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 853 | + |
---|
| 854 | + cameraView.ToggleFullScreen(); |
---|
| 855 | + |
---|
| 856 | + if (!CameraPane.FULLSCREEN) |
---|
588 | 857 | { |
---|
589 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
590 | | - framePanel.add(bigThree); |
---|
591 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 858 | + device.setFullScreenWindow(null); |
---|
| 859 | + frame.dispose(); |
---|
| 860 | + frame.setUndecorated(false); |
---|
| 861 | + frame.validate(); |
---|
| 862 | + frame.setVisible(true); |
---|
| 863 | + |
---|
| 864 | + //frame.setVisible(false); |
---|
| 865 | +// frame.removeNotify(); |
---|
| 866 | +// frame.setUndecorated(false); |
---|
| 867 | +// frame.addNotify(); |
---|
| 868 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 869 | + |
---|
| 870 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 871 | +// X framePanel.add(bigThree); |
---|
| 872 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 873 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
| 874 | + |
---|
| 875 | + //frame.setVisible(true); |
---|
| 876 | +// radio.layout = keepButton; |
---|
| 877 | + //theFrame = null; |
---|
| 878 | + keepButton = null; |
---|
| 879 | +// radio.layout.doClick(); |
---|
| 880 | + |
---|
592 | 881 | } else |
---|
593 | 882 | { |
---|
594 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
595 | | - framePanel.remove(bigThree); |
---|
596 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 883 | + keepButton = radio.layout; |
---|
| 884 | + //keeprect = frame.getBounds(); |
---|
| 885 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 886 | +// frame.getToolkit().getScreenSize().height); |
---|
| 887 | + //frame.setVisible(false); |
---|
| 888 | + |
---|
| 889 | + frame.dispose(); |
---|
| 890 | + frame.setUndecorated(true); |
---|
| 891 | + device.setFullScreenWindow(frame); |
---|
| 892 | + frame.validate(); |
---|
| 893 | + frame.setVisible(true); |
---|
| 894 | +// frame.removeNotify(); |
---|
| 895 | +// frame.setUndecorated(true); |
---|
| 896 | +// frame.addNotify(); |
---|
| 897 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 898 | +// X framePanel.remove(bigThree); |
---|
| 899 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 900 | +// framePanel.setDividerLocation(0); |
---|
| 901 | + |
---|
| 902 | +// radio.layout = fullscreenLayout; |
---|
| 903 | +// radio.layout.doClick(); |
---|
| 904 | + //frame.setVisible(true); |
---|
597 | 905 | } |
---|
598 | | - cameraView.ToggleFullScreen(); |
---|
| 906 | + frame.validate(); |
---|
| 907 | + |
---|
| 908 | + cameraView.requestFocusInWindow(); |
---|
599 | 909 | } |
---|
| 910 | + |
---|
| 911 | + void CollapseToolbar() |
---|
| 912 | + { |
---|
| 913 | + framePanel.setDividerLocation(0); |
---|
| 914 | + //frame.validate(); |
---|
| 915 | + |
---|
| 916 | + cameraView.requestFocusInWindow(); |
---|
| 917 | + } |
---|
| 918 | + |
---|
| 919 | + private Object3D Duplicate(Object3D object) |
---|
| 920 | + { |
---|
| 921 | + boolean temp = CameraPane.SWITCH; |
---|
| 922 | + CameraPane.SWITCH = false; |
---|
| 923 | + |
---|
| 924 | + object.ExtractBigData(versiontable); |
---|
| 925 | + // if (copy == client) |
---|
| 926 | + |
---|
| 927 | + Object3D versions[] = object.versionlist; |
---|
| 928 | + object.versionlist = null; |
---|
| 929 | + |
---|
| 930 | + //byte[] compress = Compress(copy); |
---|
| 931 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
| 932 | + |
---|
| 933 | + object.versionlist = versions; |
---|
| 934 | + |
---|
| 935 | + object.RestoreBigData(versiontable); |
---|
| 936 | + |
---|
| 937 | + CameraPane.SWITCH = temp; |
---|
| 938 | + |
---|
| 939 | + return compress; |
---|
| 940 | + } |
---|
600 | 941 | |
---|
601 | 942 | private JTextPane createTextPane() |
---|
602 | 943 | { |
---|
.. | .. |
---|
719 | 1060 | { |
---|
720 | 1061 | SetupMaterial(materialPanel); |
---|
721 | 1062 | } |
---|
| 1063 | + |
---|
722 | 1064 | //SetupName(); |
---|
723 | 1065 | //SetupViews(); |
---|
724 | 1066 | } |
---|
.. | .. |
---|
728 | 1070 | // NumberSlider vDivsField; |
---|
729 | 1071 | // JCheckBox endcaps; |
---|
730 | 1072 | JCheckBox liveCB; |
---|
731 | | - JCheckBox selectCB; |
---|
| 1073 | + JCheckBox selectableCB; |
---|
732 | 1074 | JCheckBox hideCB; |
---|
733 | 1075 | JCheckBox link2masterCB; |
---|
734 | 1076 | JCheckBox markCB; |
---|
.. | .. |
---|
736 | 1078 | JCheckBox speedupCB; |
---|
737 | 1079 | JCheckBox rewindCB; |
---|
738 | 1080 | JCheckBox flipVCB; |
---|
| 1081 | + |
---|
| 1082 | + cCheckBox toggleTextureCB; |
---|
| 1083 | + cCheckBox toggleSwitchCB; |
---|
| 1084 | + |
---|
739 | 1085 | JComboBox texresMenu; |
---|
| 1086 | + |
---|
740 | 1087 | JButton resetButton; |
---|
741 | 1088 | JButton stepButton; |
---|
742 | 1089 | JButton stepAllButton; |
---|
.. | .. |
---|
745 | 1092 | JButton fasterButton; |
---|
746 | 1093 | JButton remarkButton; |
---|
747 | 1094 | |
---|
| 1095 | + cGridBag editPanel; |
---|
| 1096 | + cGridBag editCommandsPanel; |
---|
| 1097 | + |
---|
748 | 1098 | cGridBag namePanel; |
---|
749 | 1099 | cGridBag setupPanel; |
---|
750 | | - cGridBag commandsPanel; |
---|
| 1100 | + cGridBag setupPanel2; |
---|
| 1101 | + cGridBag objectCommandsPanel; |
---|
751 | 1102 | cGridBag pushPanel; |
---|
752 | 1103 | cGridBag fillPanel; |
---|
753 | 1104 | |
---|
.. | .. |
---|
918 | 1269 | |
---|
919 | 1270 | namePanel = new cGridBag(); |
---|
920 | 1271 | |
---|
| 1272 | + //if (copy.pinned) |
---|
| 1273 | + { |
---|
| 1274 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1275 | + pinButton.setSelected(copy.pinned); |
---|
| 1276 | + cGridBag t = new cGridBag(); |
---|
| 1277 | + t.preferredWidth = 2; |
---|
| 1278 | + t.add(pinButton); |
---|
| 1279 | + namePanel.add(t); |
---|
| 1280 | + |
---|
| 1281 | + pinButton.addItemListener(this); |
---|
| 1282 | + } |
---|
| 1283 | + |
---|
921 | 1284 | nameField = AddText(namePanel, copy.GetName()); |
---|
922 | | - namePanel.add(nameField); |
---|
| 1285 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
923 | 1286 | oe.ctrlPanel.add(namePanel); |
---|
924 | 1287 | |
---|
925 | 1288 | oe.ctrlPanel.Return(); |
---|
926 | 1289 | |
---|
927 | | - if (!GroupEditor.allparams) |
---|
| 1290 | + if (!allparams) |
---|
928 | 1291 | return; |
---|
929 | 1292 | |
---|
930 | 1293 | setupPanel = new cGridBag().setVertical(false); |
---|
931 | 1294 | |
---|
932 | 1295 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
933 | 1296 | liveCB.setToolTipText("Animate object"); |
---|
934 | | - selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
935 | | - selectCB.setToolTipText("Make object selectable"); |
---|
| 1297 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1298 | + selectableCB.setToolTipText("Make object selectable"); |
---|
936 | 1299 | // Return(); |
---|
| 1300 | + |
---|
937 | 1301 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
938 | 1302 | hideCB.setToolTipText("Hide object"); |
---|
939 | 1303 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
940 | | - markCB.setToolTipText("Set the animation target transform"); |
---|
| 1304 | + markCB.setToolTipText("As animation target transform"); |
---|
941 | 1305 | |
---|
942 | | - rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 1306 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
| 1307 | + |
---|
| 1308 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1309 | + |
---|
| 1310 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
943 | 1311 | rewindCB.setToolTipText("Rewind animation"); |
---|
944 | 1312 | |
---|
945 | | - randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
946 | | - randomCB.setToolTipText("Option for switch node"); |
---|
| 1313 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1314 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
947 | 1315 | |
---|
| 1316 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1317 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1318 | + |
---|
948 | 1319 | if (Globals.ADVANCED) |
---|
949 | 1320 | { |
---|
950 | | - link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
951 | | - link2masterCB.setToolTipText("Attach to support"); |
---|
952 | | - speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 1321 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
953 | 1322 | speedupCB.setToolTipText("Option motion capture"); |
---|
954 | 1323 | } |
---|
955 | 1324 | |
---|
956 | 1325 | oe.ctrlPanel.add(setupPanel); |
---|
957 | 1326 | oe.ctrlPanel.Return(); |
---|
| 1327 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1328 | + oe.ctrlPanel.Return(); |
---|
958 | 1329 | |
---|
959 | | - commandsPanel = new cGridBag().setVertical(false); |
---|
| 1330 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
960 | 1331 | |
---|
961 | | - resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 1332 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
962 | 1333 | resetButton.setToolTipText("Jump to frame zero"); |
---|
963 | | - stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1334 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
964 | 1335 | stepButton.setToolTipText("Step one frame"); |
---|
965 | 1336 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
966 | 1337 | // stepAllButton = AddButton(oe, "Step All"); |
---|
967 | 1338 | // Return(); |
---|
968 | | - slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 1339 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
969 | 1340 | slowerButton.setToolTipText("Decrease animation speed"); |
---|
970 | | - fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 1341 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
971 | 1342 | fasterButton.setToolTipText("Increase animation speed"); |
---|
972 | | - remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1343 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
973 | 1344 | remarkButton.setToolTipText("Set the current transform as the target"); |
---|
974 | 1345 | |
---|
975 | | - oe.ctrlPanel.add(commandsPanel); |
---|
| 1346 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
976 | 1347 | oe.ctrlPanel.Return(); |
---|
977 | 1348 | |
---|
978 | 1349 | pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
.. | .. |
---|
1178 | 1549 | //worldPanel.setName("World"); |
---|
1179 | 1550 | centralPanel = new cGridBag(); |
---|
1180 | 1551 | centralPanel.preferredWidth = 20; |
---|
1181 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1182 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1552 | + |
---|
| 1553 | + if (Globals.ADVANCED) |
---|
| 1554 | + { |
---|
| 1555 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1556 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1183 | 1557 | |
---|
1184 | 1558 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1185 | 1559 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1188 | 1562 | // cameraPanel.setDividerSize(9); |
---|
1189 | 1563 | cameraPanel.setResizeWeight(1.0); |
---|
1190 | 1564 | |
---|
| 1565 | + } |
---|
| 1566 | + |
---|
1191 | 1567 | centralPanel.add(cameraView); |
---|
| 1568 | + centralPanel.setFocusable(true); |
---|
1192 | 1569 | //frame.setJMenuBar(timelineMenubar); |
---|
1193 | 1570 | //centralPanel.add(timelinePanel); |
---|
1194 | 1571 | |
---|
.. | .. |
---|
1214 | 1591 | XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1215 | 1592 | XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1216 | 1593 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1594 | + //XYZPanel.setName("XYZ"); |
---|
1217 | 1595 | |
---|
1218 | 1596 | /* |
---|
1219 | 1597 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1251 | 1629 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1252 | 1630 | //tmp.setName("Edit"); |
---|
1253 | 1631 | objectPanel.add(materialPanel); |
---|
| 1632 | + objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1633 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1634 | + |
---|
| 1635 | + objectPanel.add(toolboxPanel); |
---|
| 1636 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1637 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
| 1638 | + |
---|
| 1639 | + objectPanel.add(skyboxPanel); |
---|
| 1640 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1641 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1642 | + |
---|
1254 | 1643 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1255 | 1644 | // north.setName("Edit"); |
---|
1256 | 1645 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1257 | 1646 | // objectPanel.add(north); |
---|
1258 | | - objectPanel.add(ctrlPanel); |
---|
1259 | | - objectPanel.add(infoPanel); |
---|
1260 | | - |
---|
| 1647 | + objectPanel.add(editPanel); |
---|
| 1648 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1649 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
| 1650 | + |
---|
| 1651 | + objectPanel.add(XYZPanel); |
---|
| 1652 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1653 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
| 1654 | + |
---|
1261 | 1655 | /* |
---|
1262 | 1656 | aConstraints.gridx = 0; |
---|
1263 | 1657 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1265 | 1659 | aConstraints.gridy += 1; |
---|
1266 | 1660 | aConstraints.gridwidth = 1; |
---|
1267 | 1661 | mainPanel.add(objectPanel, aConstraints); |
---|
1268 | | - */ |
---|
| 1662 | + */ |
---|
1269 | 1663 | |
---|
1270 | 1664 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1271 | 1665 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1277 | 1671 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1278 | 1672 | |
---|
1279 | 1673 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1280 | | - scenePanel.preferredWidth = 6; |
---|
| 1674 | + scenePanel.preferredWidth = 5; |
---|
1281 | 1675 | |
---|
1282 | 1676 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1283 | 1677 | tabbedPane.add(scrollpane); |
---|
1284 | 1678 | |
---|
1285 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1286 | | - |
---|
1287 | | - optionsPanel = new cGridBag().setVertical(true); |
---|
| 1679 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1288 | 1680 | |
---|
1289 | 1681 | optionsPanel.setName("Options"); |
---|
1290 | 1682 | |
---|
.. | .. |
---|
1292 | 1684 | |
---|
1293 | 1685 | tabbedPane.add(optionsPanel); |
---|
1294 | 1686 | |
---|
| 1687 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1688 | + |
---|
1295 | 1689 | scenePanel.add(tabbedPane); |
---|
1296 | 1690 | |
---|
| 1691 | + //if (Globals.ADVANCED) |
---|
| 1692 | +// tabbedPane.add(infoPanel); |
---|
| 1693 | +// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1694 | +// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1695 | + |
---|
1297 | 1696 | /* |
---|
1298 | 1697 | cTree jTree = new cTree(null); |
---|
1299 | 1698 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1355 | 1754 | bigThree = new cGridBag(); |
---|
1356 | 1755 | bigThree.addComponent(scenePanel); |
---|
1357 | 1756 | bigThree.addComponent(centralPanel); |
---|
1358 | | - bigThree.addComponent(XYZPanel); |
---|
| 1757 | + //bigThree.addComponent(XYZPanel); |
---|
1359 | 1758 | |
---|
1360 | 1759 | // // SIDE EFFECT!!! |
---|
1361 | 1760 | // aConstraints.gridx = 0; |
---|
.. | .. |
---|
1364 | 1763 | // aConstraints.gridheight = 1; |
---|
1365 | 1764 | |
---|
1366 | 1765 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1367 | | - framePanel.setContinuousLayout(true); |
---|
1368 | | - framePanel.setOneTouchExpandable(true); |
---|
1369 | | - framePanel.setDividerLocation(0.8); |
---|
| 1766 | + |
---|
| 1767 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1768 | + new java.beans.PropertyChangeListener() |
---|
| 1769 | + { |
---|
| 1770 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1771 | + { |
---|
| 1772 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1773 | + { |
---|
| 1774 | + if (radio.layout != expandedLayout) |
---|
| 1775 | + { |
---|
| 1776 | + radio.layout = expandedLayout; |
---|
| 1777 | + radio.layout.doClick(); |
---|
| 1778 | + } |
---|
| 1779 | + } |
---|
| 1780 | + } |
---|
| 1781 | + }); |
---|
| 1782 | + |
---|
| 1783 | + framePanel.setContinuousLayout(false); |
---|
| 1784 | + framePanel.setOneTouchExpandable(false); |
---|
| 1785 | + //.setDividerLocation(0.8); |
---|
1370 | 1786 | //framePanel.setDividerSize(15); |
---|
1371 | 1787 | //framePanel.setResizeWeight(0.15); |
---|
1372 | 1788 | framePanel.setName("Frame"); |
---|
1373 | 1789 | |
---|
1374 | 1790 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1375 | 1791 | /**/ |
---|
1376 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1792 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1377 | 1793 | //worldPane.add(bigPanel); |
---|
1378 | 1794 | //worldPane.add(worldPanel); |
---|
1379 | 1795 | /**/ |
---|
.. | .. |
---|
1384 | 1800 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1385 | 1801 | |
---|
1386 | 1802 | frame.setSize(1280, 860); |
---|
1387 | | - frame.setVisible(true); |
---|
1388 | | - |
---|
| 1803 | + |
---|
| 1804 | + cameraView.requestFocusInWindow(); |
---|
| 1805 | + |
---|
1389 | 1806 | gridPanel.setDividerLocation(1.0); |
---|
| 1807 | + |
---|
| 1808 | + frame.validate(); |
---|
| 1809 | + |
---|
| 1810 | + frame.setVisible(true); |
---|
1390 | 1811 | |
---|
1391 | 1812 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1392 | 1813 | frame.addWindowListener(new WindowAdapter() |
---|
1393 | 1814 | { |
---|
1394 | | - |
---|
1395 | 1815 | public void windowClosing(WindowEvent e) |
---|
1396 | 1816 | { |
---|
1397 | 1817 | Close(); |
---|
.. | .. |
---|
1414 | 1834 | ctrlPanel.removeAll(); |
---|
1415 | 1835 | } |
---|
1416 | 1836 | |
---|
1417 | | - void SetupMaterial(cGridBag panel) |
---|
| 1837 | + void SetupMaterial(cGridBag materialpanel) |
---|
1418 | 1838 | { |
---|
1419 | | - /* |
---|
| 1839 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1840 | + |
---|
| 1841 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1842 | + skin.setToolTipText("Skin"); |
---|
| 1843 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1844 | + { |
---|
| 1845 | + public void mouseClicked(MouseEvent e) |
---|
| 1846 | + { |
---|
| 1847 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1848 | + cMaterial material = object.material; |
---|
| 1849 | + |
---|
| 1850 | + // Skin |
---|
| 1851 | + colorField.setFloat(material.color); |
---|
| 1852 | + saturationField.setFloat(material.modulation); |
---|
| 1853 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1854 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1855 | + diffusenessField.setFloat(material.factor); |
---|
| 1856 | + shininessField.setFloat(material.shininess); |
---|
| 1857 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1858 | + diffuseField.setFloat(material.diffuse); |
---|
| 1859 | + specularField.setFloat(material.specular); |
---|
| 1860 | + |
---|
| 1861 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1862 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1863 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1864 | + |
---|
| 1865 | + materialtouched = true; |
---|
| 1866 | + applySelf(); |
---|
| 1867 | + } |
---|
| 1868 | + }); |
---|
| 1869 | + presetpanel.add(skin); |
---|
| 1870 | + |
---|
| 1871 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1872 | + lambert.setToolTipText("Diffuse"); |
---|
| 1873 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1874 | + { |
---|
| 1875 | + public void mouseClicked(MouseEvent e) |
---|
| 1876 | + { |
---|
| 1877 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1878 | + cMaterial material = object.material; |
---|
| 1879 | + |
---|
| 1880 | + diffusenessField.setFloat(material.factor); |
---|
| 1881 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1882 | + |
---|
| 1883 | + materialtouched = true; |
---|
| 1884 | + applySelf(); |
---|
| 1885 | + } |
---|
| 1886 | + }); |
---|
| 1887 | + presetpanel.add(lambert); |
---|
| 1888 | + |
---|
| 1889 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1890 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1891 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1892 | + { |
---|
| 1893 | + public void mouseClicked(MouseEvent e) |
---|
| 1894 | + { |
---|
| 1895 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1896 | + cMaterial material = object.material; |
---|
| 1897 | + |
---|
| 1898 | + diffusenessField.setFloat(material.factor); |
---|
| 1899 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1900 | + |
---|
| 1901 | + materialtouched = true; |
---|
| 1902 | + applySelf(); |
---|
| 1903 | + } |
---|
| 1904 | + }); |
---|
| 1905 | + presetpanel.add(diffuse2); |
---|
| 1906 | + |
---|
| 1907 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1908 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1909 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1910 | + { |
---|
| 1911 | + public void mouseClicked(MouseEvent e) |
---|
| 1912 | + { |
---|
| 1913 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1914 | + cMaterial material = object.material; |
---|
| 1915 | + |
---|
| 1916 | + diffusenessField.setFloat(material.factor); |
---|
| 1917 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1918 | + |
---|
| 1919 | + materialtouched = true; |
---|
| 1920 | + applySelf(); |
---|
| 1921 | + } |
---|
| 1922 | + }); |
---|
| 1923 | + presetpanel.add(diffusemoon); |
---|
| 1924 | + |
---|
| 1925 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1926 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1927 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1928 | + { |
---|
| 1929 | + public void mouseClicked(MouseEvent e) |
---|
| 1930 | + { |
---|
| 1931 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1932 | + cMaterial material = object.material; |
---|
| 1933 | + |
---|
| 1934 | + diffusenessField.setFloat(material.factor); |
---|
| 1935 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1936 | + |
---|
| 1937 | + materialtouched = true; |
---|
| 1938 | + applySelf(); |
---|
| 1939 | + } |
---|
| 1940 | + }); |
---|
| 1941 | + presetpanel.add(diffusemoon2); |
---|
| 1942 | + |
---|
| 1943 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1944 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1945 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1946 | + { |
---|
| 1947 | + public void mouseClicked(MouseEvent e) |
---|
| 1948 | + { |
---|
| 1949 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1950 | + cMaterial material = object.material; |
---|
| 1951 | + |
---|
| 1952 | + diffusenessField.setFloat(material.factor); |
---|
| 1953 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1954 | + |
---|
| 1955 | + materialtouched = true; |
---|
| 1956 | + applySelf(); |
---|
| 1957 | + } |
---|
| 1958 | + }); |
---|
| 1959 | + presetpanel.add(diffusemoon3); |
---|
| 1960 | + |
---|
| 1961 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1962 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 1963 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 1964 | + { |
---|
| 1965 | + public void mouseClicked(MouseEvent e) |
---|
| 1966 | + { |
---|
| 1967 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 1968 | + cMaterial material = object.material; |
---|
| 1969 | + |
---|
| 1970 | + sheenField.setFloat(material.sheen); |
---|
| 1971 | + |
---|
| 1972 | + materialtouched = true; |
---|
| 1973 | + applySelf(); |
---|
| 1974 | + } |
---|
| 1975 | + }); |
---|
| 1976 | + presetpanel.add(diffusesheen); |
---|
| 1977 | + |
---|
| 1978 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 1979 | + rough.setToolTipText("Rough metal"); |
---|
| 1980 | + rough.addMouseListener(new MouseAdapter() |
---|
| 1981 | + { |
---|
| 1982 | + public void mouseClicked(MouseEvent e) |
---|
| 1983 | + { |
---|
| 1984 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 1985 | + cMaterial material = object.material; |
---|
| 1986 | + |
---|
| 1987 | + shininessField.setFloat(material.shininess); |
---|
| 1988 | + velvetField.setFloat(material.velvet); |
---|
| 1989 | + |
---|
| 1990 | + materialtouched = true; |
---|
| 1991 | + applySelf(); |
---|
| 1992 | + } |
---|
| 1993 | + }); |
---|
| 1994 | + presetpanel.add(rough); |
---|
| 1995 | + |
---|
| 1996 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 1997 | + rough2.setToolTipText("Medium metal"); |
---|
| 1998 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 1999 | + { |
---|
| 2000 | + public void mouseClicked(MouseEvent e) |
---|
| 2001 | + { |
---|
| 2002 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2003 | + cMaterial material = object.material; |
---|
| 2004 | + |
---|
| 2005 | + shininessField.setFloat(material.shininess); |
---|
| 2006 | + lightareaField.setFloat(material.lightarea); |
---|
| 2007 | + |
---|
| 2008 | + materialtouched = true; |
---|
| 2009 | + applySelf(); |
---|
| 2010 | + } |
---|
| 2011 | + }); |
---|
| 2012 | + presetpanel.add(rough2); |
---|
| 2013 | + |
---|
| 2014 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2015 | + shini0.setToolTipText("Shiny"); |
---|
| 2016 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2017 | + { |
---|
| 2018 | + public void mouseClicked(MouseEvent e) |
---|
| 2019 | + { |
---|
| 2020 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2021 | + cMaterial material = object.material; |
---|
| 2022 | + |
---|
| 2023 | + shininessField.setFloat(material.shininess); |
---|
| 2024 | + lightareaField.setFloat(material.lightarea); |
---|
| 2025 | + |
---|
| 2026 | + materialtouched = true; |
---|
| 2027 | + applySelf(); |
---|
| 2028 | + } |
---|
| 2029 | + }); |
---|
| 2030 | + presetpanel.add(shini0); |
---|
| 2031 | + |
---|
| 2032 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2033 | + shini1.setToolTipText("Shiny2"); |
---|
| 2034 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2035 | + { |
---|
| 2036 | + public void mouseClicked(MouseEvent e) |
---|
| 2037 | + { |
---|
| 2038 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2039 | + cMaterial material = object.material; |
---|
| 2040 | + |
---|
| 2041 | + shininessField.setFloat(material.shininess); |
---|
| 2042 | + lightareaField.setFloat(material.lightarea); |
---|
| 2043 | + |
---|
| 2044 | + materialtouched = true; |
---|
| 2045 | + applySelf(); |
---|
| 2046 | + } |
---|
| 2047 | + }); |
---|
| 2048 | + presetpanel.add(shini1); |
---|
| 2049 | + |
---|
| 2050 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2051 | + shini2.setToolTipText("Shiny3"); |
---|
| 2052 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2053 | + { |
---|
| 2054 | + public void mouseClicked(MouseEvent e) |
---|
| 2055 | + { |
---|
| 2056 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2057 | + cMaterial material = object.material; |
---|
| 2058 | + |
---|
| 2059 | + shininessField.setFloat(material.shininess); |
---|
| 2060 | + lightareaField.setFloat(material.lightarea); |
---|
| 2061 | + |
---|
| 2062 | + materialtouched = true; |
---|
| 2063 | + applySelf(); |
---|
| 2064 | + } |
---|
| 2065 | + }); |
---|
| 2066 | + presetpanel.add(shini2); |
---|
| 2067 | + |
---|
| 2068 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2069 | + aniso.setToolTipText("AnisoU"); |
---|
| 2070 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2071 | + { |
---|
| 2072 | + public void mouseClicked(MouseEvent e) |
---|
| 2073 | + { |
---|
| 2074 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2075 | + cMaterial material = object.material; |
---|
| 2076 | + |
---|
| 2077 | + anisoField.setFloat(material.aniso); |
---|
| 2078 | + anisoVField.setFloat(material.anisoV); |
---|
| 2079 | + |
---|
| 2080 | + materialtouched = true; |
---|
| 2081 | + applySelf(); |
---|
| 2082 | + } |
---|
| 2083 | + }); |
---|
| 2084 | + presetpanel.add(aniso); |
---|
| 2085 | + |
---|
| 2086 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2087 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2088 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2089 | + { |
---|
| 2090 | + public void mouseClicked(MouseEvent e) |
---|
| 2091 | + { |
---|
| 2092 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2093 | + cMaterial material = object.material; |
---|
| 2094 | + |
---|
| 2095 | + anisoField.setFloat(material.aniso); |
---|
| 2096 | + anisoVField.setFloat(material.anisoV); |
---|
| 2097 | + |
---|
| 2098 | + materialtouched = true; |
---|
| 2099 | + applySelf(); |
---|
| 2100 | + } |
---|
| 2101 | + }); |
---|
| 2102 | + presetpanel.add(aniso2); |
---|
| 2103 | + |
---|
| 2104 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2105 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2106 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2107 | + { |
---|
| 2108 | + public void mouseClicked(MouseEvent e) |
---|
| 2109 | + { |
---|
| 2110 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2111 | + cMaterial material = object.material; |
---|
| 2112 | + |
---|
| 2113 | + anisoField.setFloat(material.aniso); |
---|
| 2114 | + anisoVField.setFloat(material.anisoV); |
---|
| 2115 | + |
---|
| 2116 | + materialtouched = true; |
---|
| 2117 | + applySelf(); |
---|
| 2118 | + } |
---|
| 2119 | + }); |
---|
| 2120 | + presetpanel.add(aniso3); |
---|
| 2121 | + |
---|
| 2122 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2123 | + velvet0.setToolTipText("Velvet"); |
---|
| 2124 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2125 | + { |
---|
| 2126 | + public void mouseClicked(MouseEvent e) |
---|
| 2127 | + { |
---|
| 2128 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2129 | + cMaterial material = object.material; |
---|
| 2130 | + |
---|
| 2131 | + diffusenessField.setFloat(material.factor); |
---|
| 2132 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2133 | + sheenField.setFloat(material.sheen); |
---|
| 2134 | + shininessField.setFloat(material.shininess); |
---|
| 2135 | + velvetField.setFloat(material.velvet); |
---|
| 2136 | + shiftField.setFloat(material.shift); |
---|
| 2137 | + |
---|
| 2138 | + materialtouched = true; |
---|
| 2139 | + applySelf(); |
---|
| 2140 | + } |
---|
| 2141 | + }); |
---|
| 2142 | + presetpanel.add(velvet0); |
---|
| 2143 | + |
---|
| 2144 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2145 | + bump0.setToolTipText("Bump texture"); |
---|
| 2146 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2147 | + { |
---|
| 2148 | + public void mouseClicked(MouseEvent e) |
---|
| 2149 | + { |
---|
| 2150 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2151 | + cMaterial material = object.material; |
---|
| 2152 | + |
---|
| 2153 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2154 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2155 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2156 | + |
---|
| 2157 | + materialtouched = true; |
---|
| 2158 | + applySelf(); |
---|
| 2159 | + } |
---|
| 2160 | + }); |
---|
| 2161 | + presetpanel.add(bump0); |
---|
| 2162 | + |
---|
| 2163 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2164 | + halo.setToolTipText("Halo"); |
---|
| 2165 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2166 | + { |
---|
| 2167 | + public void mouseClicked(MouseEvent e) |
---|
| 2168 | + { |
---|
| 2169 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2170 | + cMaterial material = object.material; |
---|
| 2171 | + |
---|
| 2172 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2173 | + |
---|
| 2174 | + materialtouched = true; |
---|
| 2175 | + applySelf(); |
---|
| 2176 | + } |
---|
| 2177 | + }); |
---|
| 2178 | + presetpanel.add(halo); |
---|
| 2179 | + |
---|
| 2180 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2181 | + candle.setToolTipText("Candle"); |
---|
| 2182 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2183 | + { |
---|
| 2184 | + public void mouseClicked(MouseEvent e) |
---|
| 2185 | + { |
---|
| 2186 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2187 | + cMaterial material = object.material; |
---|
| 2188 | + |
---|
| 2189 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2190 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2191 | + ambientField.setFloat(material.ambient); |
---|
| 2192 | + specularField.setFloat(material.specular); |
---|
| 2193 | + lightareaField.setFloat(material.lightarea); |
---|
| 2194 | + shininessField.setFloat(material.shininess); |
---|
| 2195 | + |
---|
| 2196 | + materialtouched = true; |
---|
| 2197 | + applySelf(); |
---|
| 2198 | + } |
---|
| 2199 | + }); |
---|
| 2200 | + presetpanel.add(candle); |
---|
| 2201 | + |
---|
| 2202 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2203 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2204 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2205 | + { |
---|
| 2206 | + public void mouseClicked(MouseEvent e) |
---|
| 2207 | + { |
---|
| 2208 | + diffuseField.setFloat(0.001); |
---|
| 2209 | + ambientField.setFloat(0.001); |
---|
| 2210 | + cameraField.setFloat(0.001); |
---|
| 2211 | + specularField.setFloat(0.001); |
---|
| 2212 | + fakedepthField.setFloat(0.001); |
---|
| 2213 | + opacityField.setFloat(0.6); |
---|
| 2214 | + |
---|
| 2215 | + materialtouched = true; |
---|
| 2216 | + applySelf(); |
---|
| 2217 | + } |
---|
| 2218 | + }); |
---|
| 2219 | + presetpanel.add(shadowShader); |
---|
| 2220 | + |
---|
| 2221 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2222 | + |
---|
| 2223 | + presetpanel.preferredWidth = 1; |
---|
| 2224 | + |
---|
| 2225 | + materialpanel.add(presetpanel); |
---|
| 2226 | + materialpanel.add(panel); |
---|
| 2227 | + |
---|
| 2228 | + panel.preferredWidth = 8; |
---|
| 2229 | + |
---|
| 2230 | + /* |
---|
1420 | 2231 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1421 | 2232 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1422 | | - */ |
---|
| 2233 | + */ |
---|
1423 | 2234 | |
---|
1424 | 2235 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1425 | 2236 | |
---|
.. | .. |
---|
1453 | 2264 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1454 | 2265 | |
---|
1455 | 2266 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 2267 | + |
---|
| 2268 | + cGridBag huepanel = new cGridBag(); |
---|
| 2269 | + cGridBag huelabel = new cGridBag(); |
---|
| 2270 | + skin = GetLabel("icons/hue.png", false); |
---|
| 2271 | + skin.fit = true; |
---|
| 2272 | + huelabel.add(skin); |
---|
| 2273 | + huelabel.preferredWidth = 20; |
---|
| 2274 | + huepanel.add(new cGridBag()); // Label |
---|
| 2275 | + huepanel.add(huelabel); // Field/slider |
---|
| 2276 | + |
---|
| 2277 | + huepanel.preferredHeight = 7; |
---|
| 2278 | + |
---|
| 2279 | + colorSection.add(huepanel); |
---|
1456 | 2280 | |
---|
1457 | 2281 | cGridBag color = new cGridBag(); |
---|
1458 | | - color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
1459 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1460 | | - color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2282 | + |
---|
| 2283 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2284 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2285 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2286 | + |
---|
1461 | 2287 | //colorField.preferredWidth = 200; |
---|
1462 | 2288 | colorSection.add(color); |
---|
1463 | 2289 | |
---|
1464 | 2290 | cGridBag modulation = new cGridBag(); |
---|
1465 | 2291 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1466 | 2292 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1467 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2293 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1468 | 2294 | colorSection.add(modulation); |
---|
1469 | 2295 | |
---|
| 2296 | + cGridBag opacity = new cGridBag(); |
---|
| 2297 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2298 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2299 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2300 | + colorSection.add(opacity); |
---|
| 2301 | + |
---|
| 2302 | + colorSection.add(GetSeparator()); |
---|
| 2303 | + |
---|
1470 | 2304 | cGridBag texture = new cGridBag(); |
---|
1471 | 2305 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1472 | 2306 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1473 | 2307 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1474 | 2308 | colorSection.add(texture); |
---|
1475 | 2309 | |
---|
1476 | | - cGridBag anisoU = new cGridBag(); |
---|
1477 | | - anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
1478 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1479 | | - anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1480 | | - colorSection.add(anisoU); |
---|
1481 | | - |
---|
1482 | | - cGridBag anisoV = new cGridBag(); |
---|
1483 | | - anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
1484 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1485 | | - anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1486 | | - colorSection.add(anisoV); |
---|
1487 | | - |
---|
1488 | | - cGridBag shadowbias = new cGridBag(); |
---|
1489 | | - shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
1490 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1491 | | - shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1492 | | - colorSection.add(shadowbias); |
---|
1493 | | - |
---|
1494 | | - panel.add(new JSeparator()); |
---|
| 2310 | + panel.add(GetSeparator()); |
---|
1495 | 2311 | |
---|
1496 | 2312 | panel.add(colorSection); |
---|
1497 | 2313 | |
---|
.. | .. |
---|
1541 | 2357 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1542 | 2358 | diffuseSection.add(fakedepth); |
---|
1543 | 2359 | |
---|
1544 | | - panel.add(new JSeparator()); |
---|
| 2360 | + cGridBag shadowbias = new cGridBag(); |
---|
| 2361 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 2362 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2363 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2364 | + diffuseSection.add(shadowbias); |
---|
| 2365 | + |
---|
| 2366 | + panel.add(GetSeparator()); |
---|
1545 | 2367 | |
---|
1546 | 2368 | panel.add(diffuseSection); |
---|
1547 | 2369 | |
---|
.. | .. |
---|
1591 | 2413 | // aConstraints.gridy += 1; |
---|
1592 | 2414 | // aConstraints.gridwidth = 1; |
---|
1593 | 2415 | |
---|
| 2416 | + cGridBag anisoU = new cGridBag(); |
---|
| 2417 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 2418 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2419 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2420 | + specularSection.add(anisoU); |
---|
1594 | 2421 | |
---|
1595 | | - panel.add(new JSeparator()); |
---|
| 2422 | + cGridBag anisoV = new cGridBag(); |
---|
| 2423 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 2424 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2425 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2426 | + specularSection.add(anisoV); |
---|
| 2427 | + |
---|
| 2428 | + |
---|
| 2429 | + panel.add(GetSeparator()); |
---|
1596 | 2430 | |
---|
1597 | 2431 | panel.add(specularSection); |
---|
1598 | 2432 | |
---|
1599 | 2433 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1600 | 2434 | |
---|
1601 | | - cGridBag globalSection = new cGridBag().setVertical(true); |
---|
| 2435 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1602 | 2436 | |
---|
1603 | 2437 | cGridBag camera = new cGridBag(); |
---|
1604 | 2438 | camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
1605 | 2439 | cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1606 | 2440 | camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1607 | | - globalSection.add(camera); |
---|
| 2441 | + colorSection.add(camera); |
---|
1608 | 2442 | |
---|
1609 | 2443 | cGridBag ambient = new cGridBag(); |
---|
1610 | 2444 | ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
1611 | 2445 | ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1612 | 2446 | ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1613 | | - globalSection.add(ambient); |
---|
| 2447 | + colorSection.add(ambient); |
---|
1614 | 2448 | |
---|
1615 | 2449 | cGridBag backlit = new cGridBag(); |
---|
1616 | 2450 | backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
1617 | 2451 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1618 | 2452 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1619 | | - globalSection.add(backlit); |
---|
| 2453 | + colorSection.add(backlit); |
---|
1620 | 2454 | |
---|
1621 | | - cGridBag opacity = new cGridBag(); |
---|
1622 | | - opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1623 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1624 | | - opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1625 | | - globalSection.add(opacity); |
---|
1626 | | - |
---|
1627 | | - panel.add(new JSeparator()); |
---|
| 2455 | + //panel.add(new JSeparator()); |
---|
1628 | 2456 | |
---|
1629 | | - panel.add(globalSection); |
---|
| 2457 | + //panel.add(globalSection); |
---|
1630 | 2458 | |
---|
1631 | 2459 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1632 | 2460 | |
---|
.. | .. |
---|
1668 | 2496 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1669 | 2497 | textureSection.add(opacityPower); |
---|
1670 | 2498 | |
---|
1671 | | - panel.add(new JSeparator()); |
---|
| 2499 | + panel.add(GetSeparator()); |
---|
1672 | 2500 | |
---|
1673 | 2501 | panel.add(textureSection); |
---|
1674 | 2502 | |
---|
.. | .. |
---|
1733 | 2561 | // 3D models |
---|
1734 | 2562 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1735 | 2563 | { |
---|
1736 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1737 | | - LoadFile(filename, lastConverter); |
---|
| 2564 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2565 | + //LoadFile(filename, lastConverter); |
---|
| 2566 | + LoadObjFile(filename); // New 3ds loader |
---|
1738 | 2567 | continue; |
---|
1739 | 2568 | } |
---|
1740 | 2569 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
2072 | 2901 | |
---|
2073 | 2902 | void LoadObjFile(String fullname) |
---|
2074 | 2903 | { |
---|
2075 | | - /* |
---|
| 2904 | + System.out.println("Loading " + fullname); |
---|
| 2905 | + /**/ |
---|
2076 | 2906 | //lastFilename = fullname; |
---|
2077 | 2907 | if(loadObjThread == null) |
---|
2078 | 2908 | { |
---|
2079 | | - loadObjThread = new LoadOBJThread(); |
---|
2080 | | - loadObjThread.start(); |
---|
| 2909 | + loadObjThread = new LoadOBJThread(); |
---|
| 2910 | + loadObjThread.start(); |
---|
2081 | 2911 | } |
---|
2082 | 2912 | |
---|
2083 | 2913 | loadObjThread.add(fullname); |
---|
2084 | | - */ |
---|
| 2914 | + /**/ |
---|
2085 | 2915 | |
---|
2086 | | - System.out.println("Loading " + fullname); |
---|
2087 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2916 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2088 | 2917 | } |
---|
2089 | 2918 | |
---|
2090 | 2919 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2460 | 3289 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2461 | 3290 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2462 | 3291 | } |
---|
| 3292 | + |
---|
2463 | 3293 | //cJME.count++; |
---|
2464 | 3294 | //cJME.count %= 12; |
---|
2465 | 3295 | if (gc) |
---|
.. | .. |
---|
2643 | 3473 | } |
---|
2644 | 3474 | } |
---|
2645 | 3475 | } |
---|
| 3476 | + |
---|
2646 | 3477 | cFileSystemPane FSPane; |
---|
2647 | 3478 | |
---|
2648 | 3479 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2652 | 3483 | |
---|
2653 | 3484 | freezematerial = true; |
---|
2654 | 3485 | colorField.setFloat(mat.color); |
---|
2655 | | - modulationField.setFloat(mat.modulation); |
---|
| 3486 | + saturationField.setFloat(mat.modulation); |
---|
2656 | 3487 | metalnessField.setFloat(mat.metalness); |
---|
2657 | 3488 | diffuseField.setFloat(mat.diffuse); |
---|
2658 | 3489 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
2696 | 3527 | } |
---|
2697 | 3528 | } |
---|
2698 | 3529 | } |
---|
| 3530 | + |
---|
2699 | 3531 | freezematerial = false; |
---|
2700 | 3532 | } |
---|
2701 | 3533 | |
---|
2702 | 3534 | void SetMaterial(Object3D object) |
---|
2703 | 3535 | { |
---|
| 3536 | + latestObject = object; |
---|
| 3537 | + |
---|
2704 | 3538 | cMaterial mat = object.material; |
---|
2705 | 3539 | |
---|
2706 | 3540 | if (mat == null) |
---|
.. | .. |
---|
2812 | 3646 | // } |
---|
2813 | 3647 | |
---|
2814 | 3648 | /**/ |
---|
2815 | | - if (deselect) |
---|
| 3649 | + if (deselect || child == null) |
---|
2816 | 3650 | { |
---|
2817 | 3651 | //group.deselectAll(); |
---|
2818 | 3652 | //freeze = true; |
---|
2819 | 3653 | GetTree().clearSelection(); |
---|
2820 | 3654 | //freeze = false; |
---|
| 3655 | + |
---|
| 3656 | + if (child == null) |
---|
| 3657 | + { |
---|
| 3658 | + return; |
---|
| 3659 | + } |
---|
2821 | 3660 | } |
---|
2822 | 3661 | |
---|
2823 | 3662 | //group.addSelectee(child); |
---|
.. | .. |
---|
2851 | 3690 | public void itemStateChanged(ItemEvent event) |
---|
2852 | 3691 | { |
---|
2853 | 3692 | // System.out.println("Propagate = " + propagate); |
---|
| 3693 | + if (event.getSource() == pinButton) |
---|
| 3694 | + { |
---|
| 3695 | + copy.pinned ^= true; |
---|
| 3696 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3697 | + { |
---|
| 3698 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3699 | + copy.CloseUI(); |
---|
| 3700 | + //copy.editWindow.refreshContents(); |
---|
| 3701 | + } |
---|
| 3702 | + } |
---|
| 3703 | + else |
---|
2854 | 3704 | if (event.getSource() == propagateToggle) |
---|
2855 | 3705 | { |
---|
2856 | 3706 | propagate ^= true; |
---|
.. | .. |
---|
2886 | 3736 | cameraView.ToggleDL(); |
---|
2887 | 3737 | cameraView.repaint(); |
---|
2888 | 3738 | return; |
---|
2889 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3739 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2890 | 3740 | { |
---|
2891 | 3741 | cameraView.ToggleTexture(); |
---|
2892 | 3742 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
2925 | 3775 | frame.validate(); |
---|
2926 | 3776 | |
---|
2927 | 3777 | return; |
---|
2928 | | - } else if (event.getSource() == toggleSwitchItem) |
---|
| 3778 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
2929 | 3779 | { |
---|
2930 | 3780 | cameraView.ToggleSwitch(); |
---|
2931 | 3781 | cameraView.repaint(); |
---|
.. | .. |
---|
2955 | 3805 | } else if (event.getSource() == liveCB) |
---|
2956 | 3806 | { |
---|
2957 | 3807 | copy.live ^= true; |
---|
| 3808 | + objEditor.refreshContents(true); // To show item colors |
---|
2958 | 3809 | return; |
---|
2959 | | - } else if (event.getSource() == selectCB) |
---|
| 3810 | + } else if (event.getSource() == selectableCB) |
---|
2960 | 3811 | { |
---|
2961 | 3812 | copy.dontselect ^= true; |
---|
2962 | 3813 | return; |
---|
.. | .. |
---|
2964 | 3815 | { |
---|
2965 | 3816 | copy.hide ^= true; |
---|
2966 | 3817 | copy.Touch(); // display list issue |
---|
2967 | | - objEditor.refreshContents(); |
---|
| 3818 | + objEditor.refreshContents(true); // To show item colors |
---|
2968 | 3819 | return; |
---|
2969 | 3820 | } else if (event.getSource() == link2masterCB) |
---|
2970 | 3821 | { |
---|
.. | .. |
---|
3141 | 3992 | { |
---|
3142 | 3993 | Close(); |
---|
3143 | 3994 | //return true; |
---|
3144 | | - } else if (source == loadItem) |
---|
| 3995 | + } else if (source == openItem) |
---|
3145 | 3996 | { |
---|
3146 | | - load(); |
---|
| 3997 | + Open(); |
---|
3147 | 3998 | //return true; |
---|
3148 | 3999 | } else if (source == newItem) |
---|
3149 | 4000 | { |
---|
.. | .. |
---|
3168 | 4019 | { |
---|
3169 | 4020 | generatePOV(); |
---|
3170 | 4021 | //return true; |
---|
| 4022 | + } else if (event.getSource() == archiveItem) |
---|
| 4023 | + { |
---|
| 4024 | + cTools.Archive(frame); |
---|
| 4025 | + return; |
---|
3171 | 4026 | } else if (source == zBufferItem) |
---|
3172 | 4027 | { |
---|
3173 | 4028 | try |
---|
.. | .. |
---|
3214 | 4069 | objEditor.refreshContents(); |
---|
3215 | 4070 | } |
---|
3216 | 4071 | |
---|
3217 | | - static public byte[] Compress(Object o) |
---|
| 4072 | + static public byte[] Compress(Object3D o) |
---|
3218 | 4073 | { |
---|
| 4074 | + // Slower to actually compress. |
---|
3219 | 4075 | try |
---|
3220 | 4076 | { |
---|
3221 | 4077 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
3222 | | - java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
3223 | | - ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 4078 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 4079 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
3224 | 4080 | |
---|
| 4081 | + Object3D parent = o.parent; |
---|
| 4082 | + o.parent = null; |
---|
| 4083 | + |
---|
3225 | 4084 | out.writeObject(o); |
---|
3226 | 4085 | |
---|
| 4086 | + o.parent = parent; |
---|
| 4087 | + |
---|
3227 | 4088 | out.flush(); |
---|
3228 | 4089 | |
---|
3229 | | - zstream.close(); |
---|
| 4090 | + baos //zstream |
---|
| 4091 | + .close(); |
---|
3230 | 4092 | out.close(); |
---|
3231 | 4093 | |
---|
3232 | | - return baos.toByteArray(); |
---|
| 4094 | + byte[] bytes = baos.toByteArray(); |
---|
| 4095 | + |
---|
| 4096 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 4097 | + return bytes; |
---|
3233 | 4098 | } catch (Exception e) |
---|
3234 | 4099 | { |
---|
3235 | 4100 | System.err.println(e); |
---|
.. | .. |
---|
3239 | 4104 | |
---|
3240 | 4105 | static public Object Uncompress(byte[] bytes) |
---|
3241 | 4106 | { |
---|
3242 | | - System.out.println("#bytes = " + bytes.length); |
---|
| 4107 | + System.out.println("restore #bytes = " + bytes.length); |
---|
3243 | 4108 | try |
---|
3244 | 4109 | { |
---|
3245 | 4110 | ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
3246 | | - java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
3247 | | - ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 4111 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 4112 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
3248 | 4113 | Object obj = in.readObject(); |
---|
| 4114 | + |
---|
| 4115 | + bais //istream |
---|
| 4116 | + .close(); |
---|
3249 | 4117 | in.close(); |
---|
3250 | 4118 | |
---|
3251 | 4119 | return obj; |
---|
.. | .. |
---|
3300 | 4168 | return null; |
---|
3301 | 4169 | } |
---|
3302 | 4170 | |
---|
3303 | | - java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
3304 | 4171 | |
---|
3305 | 4172 | public void Save() |
---|
3306 | 4173 | { |
---|
3307 | | - cRadio tab = GetCurrentTab(); |
---|
| 4174 | + //Save(true); |
---|
| 4175 | + Replace(); |
---|
| 4176 | + SetVersionStates(); |
---|
| 4177 | + } |
---|
| 4178 | + |
---|
| 4179 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 4180 | + { |
---|
| 4181 | + if (compress.length != name.length) |
---|
| 4182 | + { |
---|
| 4183 | + return false; |
---|
| 4184 | + } |
---|
3308 | 4185 | |
---|
3309 | | - boolean temp = CameraPane.SWITCH; |
---|
3310 | | - CameraPane.SWITCH = false; |
---|
| 4186 | + for (int i=compress.length; --i>=0;) |
---|
| 4187 | + { |
---|
| 4188 | + if (compress[i] != name[i]) |
---|
| 4189 | + return false; |
---|
| 4190 | + } |
---|
3311 | 4191 | |
---|
3312 | | - copy.ExtractBigData(hashtable); |
---|
| 4192 | + return true; |
---|
| 4193 | + } |
---|
| 4194 | + |
---|
| 4195 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 4196 | + |
---|
| 4197 | + void DeleteVersion() |
---|
| 4198 | + { |
---|
| 4199 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4200 | + { |
---|
| 4201 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4202 | + } |
---|
| 4203 | + |
---|
| 4204 | + CopyChanged(); |
---|
| 4205 | + |
---|
| 4206 | + SetVersionStates(); |
---|
| 4207 | + } |
---|
| 4208 | + |
---|
| 4209 | + public boolean Save(boolean user) |
---|
| 4210 | + { |
---|
| 4211 | + System.err.println("Save"); |
---|
| 4212 | + Replace(); |
---|
| 4213 | + |
---|
| 4214 | + //cRadio tab = GetCurrentTab(); |
---|
| 4215 | + |
---|
| 4216 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
| 4217 | + |
---|
| 4218 | + boolean thesame = false; |
---|
| 4219 | + |
---|
| 4220 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4221 | +// { |
---|
| 4222 | +// thesame = true; |
---|
| 4223 | +// } |
---|
3313 | 4224 | |
---|
3314 | 4225 | //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
3315 | | - tab.graphs[tab.undoindex++] = Compress(copy); |
---|
3316 | | - |
---|
3317 | | - copy.RestoreBigData(hashtable); |
---|
3318 | | - |
---|
3319 | | - CameraPane.SWITCH = temp; |
---|
3320 | | - |
---|
3321 | | - //assert(hashtable.isEmpty()); |
---|
3322 | | - |
---|
3323 | | - for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 4226 | + if (!thesame) |
---|
3324 | 4227 | { |
---|
3325 | | - tab.graphs[i] = null; |
---|
| 4228 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4229 | + { |
---|
| 4230 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4231 | + } |
---|
| 4232 | + |
---|
| 4233 | + //tab.user[tab.versionindex] = user; |
---|
| 4234 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 4235 | + |
---|
| 4236 | + copy.versionlist[++copy.versionindex] = compress; |
---|
| 4237 | + |
---|
| 4238 | + // if (increment) |
---|
| 4239 | + // tab.versionindex++; |
---|
3326 | 4240 | } |
---|
3327 | 4241 | |
---|
| 4242 | + //copy.RestoreBigData(versiontable); |
---|
| 4243 | + |
---|
| 4244 | + //assert(hashtable.isEmpty()); |
---|
| 4245 | + |
---|
| 4246 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4247 | +// { |
---|
| 4248 | +// //tab.user[i] = false; |
---|
| 4249 | +// copy.versionlist[i] = null; |
---|
| 4250 | +// } |
---|
| 4251 | + |
---|
| 4252 | + SetVersionStates(); |
---|
| 4253 | + |
---|
3328 | 4254 | // test save |
---|
3329 | 4255 | if (false) |
---|
3330 | 4256 | { |
---|
3331 | 4257 | try |
---|
3332 | 4258 | { |
---|
3333 | | - FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 4259 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
3334 | 4260 | ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
3335 | 4261 | |
---|
3336 | 4262 | p.writeObject(copy); |
---|
.. | .. |
---|
3343 | 4269 | e.printStackTrace(); |
---|
3344 | 4270 | } |
---|
3345 | 4271 | } |
---|
| 4272 | + |
---|
| 4273 | + return !thesame; |
---|
| 4274 | + } |
---|
| 4275 | + |
---|
| 4276 | + boolean flashIt = true; |
---|
| 4277 | + |
---|
| 4278 | + void RefreshSelection() |
---|
| 4279 | + { |
---|
| 4280 | + Object3D selection = new Object3D(); |
---|
| 4281 | + |
---|
| 4282 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4283 | + { |
---|
| 4284 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4285 | + |
---|
| 4286 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4287 | + |
---|
| 4288 | + if (obj == null) |
---|
| 4289 | + { |
---|
| 4290 | + copy.selection.remove(i--); |
---|
| 4291 | + } |
---|
| 4292 | + else |
---|
| 4293 | + { |
---|
| 4294 | + selection.add(obj); |
---|
| 4295 | + copy.selection.setElementAt(obj, i); |
---|
| 4296 | + } |
---|
| 4297 | + } |
---|
| 4298 | + |
---|
| 4299 | + flashIt = false; |
---|
| 4300 | + GetTree().clearSelection(); |
---|
| 4301 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4302 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4303 | + flashIt = true; |
---|
| 4304 | + |
---|
| 4305 | + //refreshContents(false); |
---|
3346 | 4306 | } |
---|
3347 | 4307 | |
---|
3348 | | - void CopyChanged(Object3D obj) |
---|
| 4308 | + void CopyChanged() |
---|
3349 | 4309 | { |
---|
| 4310 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4311 | + |
---|
| 4312 | + SetVersionStates(); |
---|
| 4313 | + |
---|
3350 | 4314 | boolean temp = CameraPane.SWITCH; |
---|
3351 | 4315 | CameraPane.SWITCH = false; |
---|
3352 | 4316 | |
---|
3353 | | - copy.ExtractBigData(hashtable); |
---|
| 4317 | + copy.ExtractBigData(versiontable); |
---|
3354 | 4318 | |
---|
3355 | 4319 | copy.clear(); |
---|
3356 | 4320 | |
---|
| 4321 | + copy.skyboxname = obj.skyboxname; |
---|
| 4322 | + copy.skyboxext = obj.skyboxext; |
---|
| 4323 | + |
---|
3357 | 4324 | for (int i=0; i<obj.Size(); i++) |
---|
3358 | 4325 | { |
---|
3359 | 4326 | copy.add(obj.get(i)); |
---|
3360 | 4327 | } |
---|
3361 | 4328 | |
---|
3362 | | - copy.RestoreBigData(hashtable); |
---|
| 4329 | + copy.RestoreBigData(versiontable); |
---|
3363 | 4330 | |
---|
3364 | 4331 | CameraPane.SWITCH = temp; |
---|
3365 | 4332 | |
---|
| 4333 | + RefreshSelection(); |
---|
3366 | 4334 | //assert(hashtable.isEmpty()); |
---|
3367 | 4335 | |
---|
3368 | 4336 | copy.Touch(); |
---|
.. | .. |
---|
3383 | 4351 | } |
---|
3384 | 4352 | } |
---|
3385 | 4353 | |
---|
3386 | | - refreshContents(); |
---|
| 4354 | + refreshContents(true); |
---|
3387 | 4355 | } |
---|
3388 | 4356 | |
---|
3389 | | - public void Undo() |
---|
3390 | | - { |
---|
3391 | | - cRadio tab = GetCurrentTab(); |
---|
| 4357 | + cButton previousVersionButton; |
---|
| 4358 | + cButton restoreButton; |
---|
| 4359 | + cButton replaceButton; |
---|
| 4360 | + cButton nextVersionButton; |
---|
| 4361 | + cButton saveVersionButton; |
---|
| 4362 | + cButton deleteVersionButton; |
---|
3392 | 4363 | |
---|
3393 | | - if (tab.undoindex == 0) |
---|
| 4364 | + boolean muteSlider; |
---|
| 4365 | + |
---|
| 4366 | + int VersionCount() |
---|
| 4367 | + { |
---|
| 4368 | + int count = 0; |
---|
| 4369 | + |
---|
| 4370 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 4371 | + { |
---|
| 4372 | + if (copy.versionlist[i] != null) |
---|
| 4373 | + count++; |
---|
| 4374 | + } |
---|
| 4375 | + |
---|
| 4376 | + return count; |
---|
| 4377 | + } |
---|
| 4378 | + |
---|
| 4379 | + void SetVersionStates() |
---|
| 4380 | + { |
---|
| 4381 | + //if (true) |
---|
| 4382 | + // return; |
---|
| 4383 | + |
---|
| 4384 | + //cRadio tab = GetCurrentTab(); |
---|
| 4385 | + |
---|
| 4386 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4387 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4388 | + |
---|
| 4389 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4390 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4391 | + |
---|
| 4392 | + deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
| 4393 | + copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4394 | + |
---|
| 4395 | + muteSlider = true; |
---|
| 4396 | + versionSlider.setMinimum(0); |
---|
| 4397 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4398 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4399 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
| 4400 | + muteSlider = false; |
---|
| 4401 | + } |
---|
| 4402 | + |
---|
| 4403 | + public boolean PreviousVersion() |
---|
| 4404 | + { |
---|
| 4405 | + // Option? |
---|
| 4406 | + Replace(); |
---|
| 4407 | + |
---|
| 4408 | + System.err.println("Undo"); |
---|
| 4409 | + |
---|
| 4410 | + //cRadio tab = GetCurrentTab(); |
---|
| 4411 | + |
---|
| 4412 | + if (copy.versionindex == 0) |
---|
3394 | 4413 | { |
---|
3395 | 4414 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3396 | | - return; |
---|
| 4415 | + return false; |
---|
3397 | 4416 | } |
---|
3398 | 4417 | |
---|
3399 | | - if (tab.graphs[tab.undoindex] == null) |
---|
3400 | | - { |
---|
3401 | | - Save(); |
---|
3402 | | - tab.undoindex -= 1; |
---|
3403 | | - } |
---|
| 4418 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 4419 | +// { |
---|
| 4420 | +// if (Save(false)) |
---|
| 4421 | +// tab.versionindex -= 1; |
---|
| 4422 | +// else |
---|
| 4423 | +// { |
---|
| 4424 | +// if (tab.versionindex <= 0) |
---|
| 4425 | +// return false; |
---|
| 4426 | +// else |
---|
| 4427 | +// tab.versionindex -= 1; |
---|
| 4428 | +// } |
---|
| 4429 | +// } |
---|
3404 | 4430 | |
---|
3405 | | - tab.undoindex -= 1; |
---|
| 4431 | + copy.versionindex -= 1; |
---|
3406 | 4432 | |
---|
3407 | | - CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 4433 | + CopyChanged(); |
---|
| 4434 | + |
---|
| 4435 | + return true; |
---|
3408 | 4436 | } |
---|
3409 | 4437 | |
---|
3410 | | - public void Redo() |
---|
| 4438 | + public boolean Restore() |
---|
3411 | 4439 | { |
---|
3412 | | - cRadio tab = GetCurrentTab(); |
---|
| 4440 | + System.err.println("Restore"); |
---|
3413 | 4441 | |
---|
3414 | | - if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 4442 | + //cRadio tab = GetCurrentTab(); |
---|
| 4443 | + |
---|
| 4444 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4445 | + { |
---|
| 4446 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4447 | + return false; |
---|
| 4448 | + } |
---|
| 4449 | + |
---|
| 4450 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4451 | + CopyChanged(); |
---|
| 4452 | + |
---|
| 4453 | + return true; |
---|
| 4454 | + } |
---|
| 4455 | + |
---|
| 4456 | + public boolean Replace() |
---|
| 4457 | + { |
---|
| 4458 | + System.err.println("Replace"); |
---|
| 4459 | + |
---|
| 4460 | + //cRadio tab = GetCurrentTab(); |
---|
| 4461 | + |
---|
| 4462 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4463 | + { |
---|
| 4464 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4465 | + return false; |
---|
| 4466 | + } |
---|
| 4467 | + |
---|
| 4468 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
| 4469 | + |
---|
| 4470 | + return true; |
---|
| 4471 | + } |
---|
| 4472 | + |
---|
| 4473 | + public void NextVersion() |
---|
| 4474 | + { |
---|
| 4475 | + // Option? |
---|
| 4476 | + Replace(); |
---|
| 4477 | + |
---|
| 4478 | + //cRadio tab = GetCurrentTab(); |
---|
| 4479 | + |
---|
| 4480 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
3415 | 4481 | { |
---|
3416 | 4482 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
3417 | 4483 | return; |
---|
3418 | 4484 | } |
---|
3419 | 4485 | |
---|
3420 | | - tab.undoindex += 1; |
---|
| 4486 | + copy.versionindex += 1; |
---|
3421 | 4487 | |
---|
3422 | | - CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 4488 | + CopyChanged(); |
---|
| 4489 | + |
---|
| 4490 | + //if (!tab.user[tab.versionindex]) |
---|
| 4491 | + // tab.graphs[tab.versionindex] = null; |
---|
3423 | 4492 | } |
---|
3424 | 4493 | |
---|
3425 | 4494 | void ImportGFD() |
---|
.. | .. |
---|
3571 | 4640 | assert false; |
---|
3572 | 4641 | } |
---|
3573 | 4642 | |
---|
3574 | | - void EditSelection() |
---|
| 4643 | + void EditSelection(boolean newWindow) |
---|
3575 | 4644 | { |
---|
3576 | 4645 | } |
---|
3577 | 4646 | |
---|
.. | .. |
---|
3630 | 4699 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
3631 | 4700 | |
---|
3632 | 4701 | current.color = (float) colorField.getFloat(); |
---|
3633 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4702 | + current.modulation = (float) saturationField.getFloat(); |
---|
3634 | 4703 | current.metalness = (float) metalnessField.getFloat(); |
---|
3635 | 4704 | current.diffuse = (float) diffuseField.getFloat(); |
---|
3636 | 4705 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
3663 | 4732 | cMaterial mat = copy.material; |
---|
3664 | 4733 | |
---|
3665 | 4734 | colorField.SetToolTipValue((mat.color)); |
---|
3666 | | - modulationField.SetToolTipValue((mat.modulation)); |
---|
| 4735 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
3667 | 4736 | metalnessField.SetToolTipValue((mat.metalness)); |
---|
3668 | 4737 | diffuseField.SetToolTipValue((mat.diffuse)); |
---|
3669 | 4738 | specularField.SetToolTipValue((mat.specular)); |
---|
.. | .. |
---|
3715 | 4784 | //copy.Touch(); |
---|
3716 | 4785 | } |
---|
3717 | 4786 | |
---|
| 4787 | + cNumberSlider versionSlider; |
---|
| 4788 | + |
---|
3718 | 4789 | public void stateChanged(ChangeEvent e) |
---|
3719 | 4790 | { |
---|
3720 | 4791 | // assert(false); |
---|
| 4792 | + if (e.getSource() == versionSlider) |
---|
| 4793 | + { |
---|
| 4794 | + if (muteSlider) |
---|
| 4795 | + return; |
---|
| 4796 | + |
---|
| 4797 | + Replace(); |
---|
| 4798 | + |
---|
| 4799 | + int version = versionSlider.getInteger(); |
---|
| 4800 | + |
---|
| 4801 | + if (version != -1 && copy.versionlist[version] != null) |
---|
| 4802 | + { |
---|
| 4803 | + copy.versionindex = version; |
---|
| 4804 | + CopyChanged(); |
---|
| 4805 | + } |
---|
| 4806 | + |
---|
| 4807 | + return; |
---|
| 4808 | + } |
---|
3721 | 4809 | |
---|
3722 | 4810 | if (freezematerial) |
---|
3723 | 4811 | { |
---|
.. | .. |
---|
3753 | 4841 | { |
---|
3754 | 4842 | //System.out.println("stateChanged = " + this); |
---|
3755 | 4843 | materialtouched = true; |
---|
| 4844 | + |
---|
| 4845 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4846 | + { |
---|
| 4847 | + saturationField.setFloat(1); |
---|
| 4848 | + } |
---|
| 4849 | + |
---|
3756 | 4850 | applySelf(); |
---|
3757 | 4851 | //System.out.println("this = " + this); |
---|
3758 | 4852 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
4052 | 5146 | { |
---|
4053 | 5147 | if (GetTree() != null) |
---|
4054 | 5148 | { |
---|
| 5149 | + GetTree().revalidate(); |
---|
4055 | 5150 | GetTree().repaint(); |
---|
4056 | 5151 | } |
---|
4057 | 5152 | |
---|
.. | .. |
---|
4060 | 5155 | ctrlPanel.validate(); // ? new |
---|
4061 | 5156 | ctrlPanel.repaint(); |
---|
4062 | 5157 | } |
---|
| 5158 | + |
---|
| 5159 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5160 | + SetVersionStates(); |
---|
4063 | 5161 | } |
---|
4064 | 5162 | |
---|
4065 | 5163 | static TweenManager tweenManager = new TweenManager(); |
---|
4066 | 5164 | |
---|
4067 | 5165 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4068 | 5166 | { |
---|
4069 | | - Save(); |
---|
| 5167 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
| 5168 | + Save(); |
---|
4070 | 5169 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4071 | 5170 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
4072 | 5171 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
4153 | 5252 | { |
---|
4154 | 5253 | ResetModel(); |
---|
4155 | 5254 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 5255 | + |
---|
| 5256 | + if (thing.Size() == 0) |
---|
| 5257 | + { |
---|
| 5258 | + //EditSelection(false); |
---|
| 5259 | + } |
---|
| 5260 | + |
---|
4156 | 5261 | refreshContents(); |
---|
4157 | 5262 | } |
---|
4158 | 5263 | |
---|
.. | .. |
---|
4290 | 5395 | |
---|
4291 | 5396 | try |
---|
4292 | 5397 | { |
---|
| 5398 | + // Try compressed version first. |
---|
4293 | 5399 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4294 | 5400 | java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
4295 | 5401 | java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
.. | .. |
---|
4300 | 5406 | readobj.ResetDisplayList(); |
---|
4301 | 5407 | } catch (Exception e) |
---|
4302 | 5408 | { |
---|
4303 | | - //e.printStackTrace(); |
---|
| 5409 | + if (!e.toString().contains("GZIP")) |
---|
| 5410 | + e.printStackTrace(); |
---|
| 5411 | + |
---|
4304 | 5412 | try |
---|
4305 | 5413 | { |
---|
4306 | 5414 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
.. | .. |
---|
4359 | 5467 | |
---|
4360 | 5468 | void LoadIt(Object obj) |
---|
4361 | 5469 | { |
---|
| 5470 | + if (obj == null) |
---|
| 5471 | + { |
---|
| 5472 | + // Invalid file |
---|
| 5473 | + return; |
---|
| 5474 | + } |
---|
| 5475 | + |
---|
4362 | 5476 | System.out.println("Loaded " + obj); |
---|
4363 | 5477 | //new Exception().printStackTrace(); |
---|
4364 | 5478 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4368 | 5482 | |
---|
4369 | 5483 | if (readobj != null) |
---|
4370 | 5484 | { |
---|
4371 | | - Save(); |
---|
| 5485 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 5486 | + // Save(); |
---|
4372 | 5487 | try |
---|
4373 | 5488 | { |
---|
4374 | 5489 | //readobj.deepCopySelf(copy); |
---|
4375 | 5490 | copy.clear(); // june 2014 |
---|
| 5491 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5492 | + copy.skyboxext = readobj.skyboxext; |
---|
4376 | 5493 | for (int i = 0; i < readobj.size(); i++) |
---|
4377 | 5494 | { |
---|
4378 | 5495 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4413 | 5530 | } |
---|
4414 | 5531 | } catch (ClassCastException e) |
---|
4415 | 5532 | { |
---|
| 5533 | + e.printStackTrace(); |
---|
4416 | 5534 | assert (false); |
---|
4417 | 5535 | Composite c = (Composite) copy; |
---|
4418 | 5536 | c.children.clear(); |
---|
.. | .. |
---|
4423 | 5541 | c.addChild(csg); |
---|
4424 | 5542 | } |
---|
4425 | 5543 | |
---|
| 5544 | + copy.versionlist = readobj.versionlist; |
---|
| 5545 | + copy.versionindex = readobj.versionindex; |
---|
| 5546 | + |
---|
| 5547 | + if (copy.versionlist == null) |
---|
| 5548 | + { |
---|
| 5549 | + // Backward compatibility |
---|
| 5550 | + copy.versionlist = new Object3D[100]; |
---|
| 5551 | + copy.versionindex = -1; |
---|
| 5552 | + |
---|
| 5553 | + //Save(true); |
---|
| 5554 | + } |
---|
| 5555 | + |
---|
| 5556 | + //? SetUndoStates(); |
---|
| 5557 | + |
---|
4426 | 5558 | ResetModel(); |
---|
4427 | 5559 | copy.HardTouch(); // recompile? |
---|
4428 | 5560 | refreshContents(); |
---|
4429 | 5561 | } |
---|
4430 | 5562 | } |
---|
4431 | 5563 | |
---|
4432 | | - void load() // throws ClassNotFoundException |
---|
| 5564 | + void Open() // throws ClassNotFoundException |
---|
4433 | 5565 | { |
---|
4434 | 5566 | if (Grafreed.standAlone) |
---|
4435 | 5567 | { |
---|
4436 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5568 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4437 | 5569 | browser.show(); |
---|
4438 | 5570 | String filename = browser.getFile(); |
---|
4439 | 5571 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4510 | 5642 | |
---|
4511 | 5643 | void save() |
---|
4512 | 5644 | { |
---|
| 5645 | + Replace(); |
---|
| 5646 | + |
---|
4513 | 5647 | if (lastname == null) |
---|
4514 | 5648 | { |
---|
4515 | 5649 | return; |
---|
.. | .. |
---|
4532 | 5666 | //ps.print(buffer.toString()); |
---|
4533 | 5667 | } catch (IOException e) |
---|
4534 | 5668 | { |
---|
| 5669 | + e.printStackTrace(); |
---|
4535 | 5670 | } |
---|
4536 | 5671 | } |
---|
4537 | 5672 | |
---|
.. | .. |
---|
4546 | 5681 | String filename = browser.getFile(); |
---|
4547 | 5682 | if (filename != null && filename.length() > 0) |
---|
4548 | 5683 | { |
---|
| 5684 | + if (!filename.endsWith(".gfd")) |
---|
| 5685 | + filename += ".gfd"; |
---|
4549 | 5686 | lastname = browser.getDirectory() + filename; |
---|
4550 | 5687 | save(); |
---|
4551 | 5688 | } |
---|
.. | .. |
---|
4712 | 5849 | MenuBar menuBar; |
---|
4713 | 5850 | Menu fileMenu; |
---|
4714 | 5851 | MenuItem newItem; |
---|
4715 | | - MenuItem loadItem; |
---|
| 5852 | + MenuItem openItem; |
---|
4716 | 5853 | MenuItem saveItem; |
---|
4717 | 5854 | MenuItem saveAsItem; |
---|
4718 | 5855 | MenuItem exportAsItem; |
---|
.. | .. |
---|
4735 | 5872 | CheckboxMenuItem toggleSwitchItem; |
---|
4736 | 5873 | CheckboxMenuItem toggleRootItem; |
---|
4737 | 5874 | CheckboxMenuItem animationItem; |
---|
| 5875 | + MenuItem archiveItem; |
---|
4738 | 5876 | CheckboxMenuItem toggleHandleItem; |
---|
4739 | 5877 | CheckboxMenuItem togglePaintItem; |
---|
4740 | 5878 | JSplitPane mainPanel; |
---|
4741 | 5879 | JScrollPane scrollpane; |
---|
| 5880 | + |
---|
4742 | 5881 | JPanel toolbarPanel; |
---|
| 5882 | + |
---|
4743 | 5883 | cGridBag treePanel; |
---|
| 5884 | + |
---|
4744 | 5885 | JPanel radioPanel; |
---|
4745 | 5886 | ButtonGroup buttonGroup; |
---|
4746 | | - cGridBag ctrlPanel; |
---|
| 5887 | + |
---|
| 5888 | + cGridBag toolboxPanel; |
---|
| 5889 | + cGridBag skyboxPanel; |
---|
4747 | 5890 | cGridBag materialPanel; |
---|
| 5891 | + cGridBag ctrlPanel; |
---|
| 5892 | + |
---|
4748 | 5893 | JScrollPane infoPanel; |
---|
| 5894 | + |
---|
4749 | 5895 | cGridBag optionsPanel; |
---|
| 5896 | + |
---|
4750 | 5897 | JTabbedPane objectPanel; |
---|
| 5898 | + boolean materialFlushed; |
---|
| 5899 | + Object3D latestObject; |
---|
| 5900 | + |
---|
4751 | 5901 | cGridBag XYZPanel; |
---|
| 5902 | + |
---|
4752 | 5903 | JSplitPane gridPanel; |
---|
4753 | 5904 | JSplitPane bigPanel; |
---|
| 5905 | + |
---|
4754 | 5906 | cGridBag bigThree; |
---|
4755 | 5907 | cGridBag scenePanel; |
---|
4756 | 5908 | cGridBag centralPanel; |
---|
.. | .. |
---|
4808 | 5960 | JLabel colorLabel; |
---|
4809 | 5961 | cNumberSlider colorField; |
---|
4810 | 5962 | JLabel modulationLabel; |
---|
4811 | | - cNumberSlider modulationField; |
---|
| 5963 | + cNumberSlider saturationField; |
---|
4812 | 5964 | JLabel metalnessLabel; |
---|
4813 | 5965 | cNumberSlider metalnessField; |
---|
4814 | 5966 | JLabel diffuseLabel; |
---|
.. | .. |
---|
4839 | 5991 | cNumberSlider anisoField; |
---|
4840 | 5992 | JLabel anisoVLabel; |
---|
4841 | 5993 | cNumberSlider anisoVField; |
---|
| 5994 | + |
---|
4842 | 5995 | JLabel cameraLabel; |
---|
4843 | 5996 | cNumberSlider cameraField; |
---|
4844 | 5997 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
4853 | 6006 | cNumberSlider fakedepthField; |
---|
4854 | 6007 | JLabel shadowbiasLabel; |
---|
4855 | 6008 | cNumberSlider shadowbiasField; |
---|
| 6009 | + |
---|
4856 | 6010 | JLabel bumpLabel; |
---|
4857 | 6011 | cNumberSlider bumpField; |
---|
4858 | 6012 | JLabel noiseLabel; |
---|
.. | .. |
---|
4865 | 6019 | cNumberSlider fogField; |
---|
4866 | 6020 | JLabel opacityPowerLabel; |
---|
4867 | 6021 | cNumberSlider opacityPowerField; |
---|
4868 | | - JTree jTree; |
---|
| 6022 | + cTree jTree; |
---|
4869 | 6023 | //ObjectUI parent; |
---|
4870 | 6024 | |
---|
4871 | 6025 | cNumberSlider normalpushField; |
---|