.. | .. |
---|
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.*; |
---|
.. | .. |
---|
35 | 36 | |
---|
36 | 37 | GroupEditor callee; |
---|
37 | 38 | JFrame frame; |
---|
| 39 | + |
---|
| 40 | + static ObjEditor theFrame; |
---|
| 41 | + |
---|
| 42 | + cButton GetButton(String name, boolean border) |
---|
| 43 | + { |
---|
| 44 | + try |
---|
| 45 | + { |
---|
| 46 | + ImageIcon icon = GetIcon(name); |
---|
| 47 | + return new cButton(icon, border); |
---|
| 48 | + } |
---|
| 49 | + catch (Exception e) |
---|
| 50 | + { |
---|
| 51 | + return new cButton(name, border); |
---|
| 52 | + } |
---|
| 53 | + } |
---|
| 54 | + |
---|
| 55 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 56 | + { |
---|
| 57 | + try |
---|
| 58 | + { |
---|
| 59 | + ImageIcon icon = GetIcon(name); |
---|
| 60 | + return new cCheckBox(icon, border); |
---|
| 61 | + } |
---|
| 62 | + catch (Exception e) |
---|
| 63 | + { |
---|
| 64 | + return new cCheckBox(name, border); |
---|
| 65 | + } |
---|
| 66 | + } |
---|
| 67 | + |
---|
| 68 | + private ImageIcon GetIcon(String name) throws IOException |
---|
| 69 | + { |
---|
| 70 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 71 | + |
---|
| 72 | + if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 73 | + { |
---|
| 74 | + BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
| 75 | + Graphics2D g = resized.createGraphics(); |
---|
| 76 | + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 77 | + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 78 | + g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 79 | + g.dispose(); |
---|
| 80 | + |
---|
| 81 | + image = resized; |
---|
| 82 | + } |
---|
| 83 | + |
---|
| 84 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 85 | + return icon; |
---|
| 86 | + } |
---|
38 | 87 | |
---|
39 | 88 | // SCRIPT |
---|
40 | 89 | |
---|
.. | .. |
---|
168 | 217 | // objEditor.ctrlPanel.remove(remarkButton); |
---|
169 | 218 | |
---|
170 | 219 | objEditor.ctrlPanel.remove(setupPanel); |
---|
171 | | - objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 220 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 221 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
172 | 222 | objEditor.ctrlPanel.remove(pushPanel); |
---|
173 | 223 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
174 | 224 | |
---|
.. | .. |
---|
243 | 293 | //localCopy.parent = null; |
---|
244 | 294 | |
---|
245 | 295 | frame = new JFrame(); |
---|
| 296 | + frame.setUndecorated(true); |
---|
246 | 297 | objEditor = this; |
---|
247 | 298 | this.callee = callee; |
---|
248 | 299 | |
---|
.. | .. |
---|
276 | 327 | void SetupMenu() |
---|
277 | 328 | { |
---|
278 | 329 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
279 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
280 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
281 | | - windowMenu.add("-"); |
---|
282 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
283 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 330 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 331 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 332 | + fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
| 333 | + |
---|
| 334 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 335 | + Menu menu = new Menu("Import"); |
---|
| 336 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 337 | + importOBJItem.addActionListener(this); |
---|
| 338 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 339 | + import3DSItem.addActionListener(this); |
---|
| 340 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 341 | + importVRMLX3DItem.addActionListener(this); |
---|
| 342 | + menu.add("-"); |
---|
| 343 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 344 | + importGFDItem.addActionListener(this); |
---|
| 345 | + fileMenu.add(menu); |
---|
| 346 | + fileMenu.add("-"); |
---|
| 347 | + |
---|
| 348 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 349 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
284 | 350 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
285 | | - windowMenu.add("-"); |
---|
286 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
287 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
288 | | - windowMenu.add("-"); |
---|
| 351 | + fileMenu.add("-"); |
---|
| 352 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 353 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 354 | + fileMenu.add("-"); |
---|
289 | 355 | if (client.parent != null) |
---|
290 | 356 | { |
---|
291 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 357 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
292 | 358 | } else |
---|
293 | 359 | { |
---|
294 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 360 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
295 | 361 | } |
---|
296 | 362 | |
---|
| 363 | + newItem.addActionListener(this); |
---|
297 | 364 | loadItem.addActionListener(this); |
---|
298 | 365 | saveItem.addActionListener(this); |
---|
299 | 366 | saveAsItem.addActionListener(this); |
---|
.. | .. |
---|
302 | 369 | //povItem.addActionListener(this); |
---|
303 | 370 | closeItem.addActionListener(this); |
---|
304 | 371 | |
---|
305 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
306 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
307 | | - //zBufferItem.addActionListener(this); |
---|
308 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
309 | | - //normalLensItem.addActionListener(this); |
---|
310 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
311 | | - revertCameraItem.addActionListener(this); |
---|
312 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
313 | | - toggleTimelineItem.addItemListener(this); |
---|
314 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
315 | | - toggleFullScreenItem.addItemListener(this); |
---|
316 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
317 | | - cameraMenu.add("-"); |
---|
318 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
319 | | - toggleTextureItem.addItemListener(this); |
---|
320 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
321 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
322 | | - toggleLiveItem.addItemListener(this); |
---|
323 | | - toggleLiveItem.setState(Globals.isLIVE()); |
---|
324 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
325 | | - stepItem.addActionListener(this); |
---|
326 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
327 | | -// toggleDLItem.addItemListener(this); |
---|
328 | | -// toggleDLItem.setState(false); |
---|
329 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
330 | | - toggleRenderItem.addItemListener(this); |
---|
331 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
332 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
333 | | - toggleDebugItem.addItemListener(this); |
---|
334 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
335 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
336 | | - toggleFrustumItem.addItemListener(this); |
---|
337 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
338 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
339 | | - toggleFootContactItem.addItemListener(this); |
---|
340 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
341 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
342 | | - toggleRandomItem.addItemListener(this); |
---|
343 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
344 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
345 | | - toggleHandleItem.addItemListener(this); |
---|
346 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
347 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
348 | | - togglePaintItem.addItemListener(this); |
---|
349 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
350 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
351 | | -// toggleRootItem.addItemListener(this); |
---|
352 | | -// toggleRootItem.setState(false); |
---|
353 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
354 | | -// animationItem.addItemListener(this); |
---|
355 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
356 | | - cameraMenu.add("-"); |
---|
357 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
358 | | - editCameraItem.addActionListener(this); |
---|
359 | | - |
---|
360 | 372 | objectPanel = new JTabbedPane(); |
---|
361 | 373 | toolbarPanel = new JPanel(); |
---|
362 | 374 | toolbarPanel.setName("Toolbar"); |
---|
363 | 375 | treePanel = new cGridBag(); |
---|
364 | 376 | treePanel.setName("Tree"); |
---|
| 377 | + |
---|
| 378 | + editPanel = new cGridBag().setVertical(true); |
---|
| 379 | + editPanel.setName("Edit"); |
---|
| 380 | + |
---|
365 | 381 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
366 | | - ctrlPanel.setName("Edit"); |
---|
| 382 | + |
---|
| 383 | + editCommandsPanel = new cGridBag(); |
---|
| 384 | + editPanel.add(editCommandsPanel); |
---|
| 385 | + editPanel.add(ctrlPanel); |
---|
| 386 | + |
---|
367 | 387 | materialPanel = new cGridBag().setVertical(true); |
---|
| 388 | + |
---|
368 | 389 | materialPanel.setName("Material"); |
---|
369 | 390 | /*JTextPane*/ |
---|
370 | 391 | infoarea = createTextPane(); |
---|
.. | .. |
---|
458 | 479 | e.printStackTrace(); |
---|
459 | 480 | } |
---|
460 | 481 | |
---|
461 | | - String selection = infoarea.getText(); |
---|
462 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
463 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
464 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 482 | +// String selection = infoarea.getText(); |
---|
| 483 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 484 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 485 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
465 | 486 | //clipboard.setContents(data, data); |
---|
466 | 487 | } |
---|
467 | 488 | |
---|
.. | .. |
---|
484 | 505 | //SendInfo("Name:", "bold"); |
---|
485 | 506 | if (sel.GetTextures() != null || debug) |
---|
486 | 507 | { |
---|
487 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 508 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
488 | 509 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
489 | 510 | if (sel.Size() > 0) |
---|
490 | 511 | { |
---|
491 | 512 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
492 | 513 | } |
---|
493 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 514 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
494 | 515 | if (debug) |
---|
495 | 516 | { |
---|
496 | 517 | try |
---|
.. | .. |
---|
532 | 553 | } |
---|
533 | 554 | if (sel.support != null) |
---|
534 | 555 | { |
---|
535 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 556 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
536 | 557 | } |
---|
537 | 558 | if (sel.scriptnode != null) |
---|
538 | 559 | { |
---|
.. | .. |
---|
621 | 642 | } |
---|
622 | 643 | } |
---|
623 | 644 | |
---|
| 645 | +static GraphicsDevice device = GraphicsEnvironment |
---|
| 646 | + .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 647 | + |
---|
| 648 | + Rectangle keeprect; |
---|
| 649 | + cRadio radio; |
---|
| 650 | + |
---|
| 651 | +cButton keepButton; |
---|
| 652 | + cButton twoButton; // Full 3D |
---|
| 653 | + cButton sixButton; |
---|
| 654 | + cButton threeButton; |
---|
| 655 | + cButton sevenButton; |
---|
| 656 | + cButton fourButton; // full panel |
---|
| 657 | + cButton oneButton; // full XYZ |
---|
| 658 | + //cButton currentLayout; |
---|
| 659 | + |
---|
| 660 | + boolean maximized; |
---|
| 661 | + |
---|
| 662 | + void Minimize() |
---|
| 663 | + { |
---|
| 664 | + frame.setState(Frame.ICONIFIED); |
---|
| 665 | + } |
---|
| 666 | + |
---|
| 667 | + void Maximize() |
---|
| 668 | + { |
---|
| 669 | + if (maximized) |
---|
| 670 | + { |
---|
| 671 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 672 | + } |
---|
| 673 | + else |
---|
| 674 | + { |
---|
| 675 | + keeprect = frame.getBounds(); |
---|
| 676 | + Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 677 | + Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 678 | + frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 679 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 680 | + } |
---|
| 681 | + |
---|
| 682 | + maximized ^= true; |
---|
| 683 | + } |
---|
| 684 | + |
---|
624 | 685 | void ToggleFullScreen() |
---|
625 | 686 | { |
---|
626 | 687 | if (CameraPane.FULLSCREEN) |
---|
627 | 688 | { |
---|
628 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
629 | | - framePanel.add(bigThree); |
---|
630 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 689 | + device.setFullScreenWindow(null); |
---|
| 690 | + //frame.setVisible(false); |
---|
| 691 | +// frame.removeNotify(); |
---|
| 692 | +// frame.setUndecorated(false); |
---|
| 693 | +// frame.addNotify(); |
---|
| 694 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 695 | + |
---|
| 696 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 697 | +// X framePanel.add(bigThree); |
---|
| 698 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 699 | + framePanel.setDividerLocation(1); |
---|
| 700 | + |
---|
| 701 | + //frame.setVisible(true); |
---|
| 702 | + radio.layout = keepButton; |
---|
| 703 | + //theFrame = null; |
---|
| 704 | + keepButton = null; |
---|
| 705 | + radio.layout.doClick(); |
---|
| 706 | + |
---|
631 | 707 | } else |
---|
632 | 708 | { |
---|
633 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
634 | | - framePanel.remove(bigThree); |
---|
635 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 709 | + keepButton = radio.layout; |
---|
| 710 | + //keeprect = frame.getBounds(); |
---|
| 711 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 712 | +// frame.getToolkit().getScreenSize().height); |
---|
| 713 | + //frame.setVisible(false); |
---|
| 714 | + device.setFullScreenWindow(frame); |
---|
| 715 | +// frame.removeNotify(); |
---|
| 716 | +// frame.setUndecorated(true); |
---|
| 717 | +// frame.addNotify(); |
---|
| 718 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 719 | +// X framePanel.remove(bigThree); |
---|
| 720 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 721 | + framePanel.setDividerLocation(0); |
---|
| 722 | + |
---|
| 723 | + radio.layout = twoButton; |
---|
| 724 | + radio.layout.doClick(); |
---|
| 725 | + //frame.setVisible(true); |
---|
636 | 726 | } |
---|
| 727 | + |
---|
637 | 728 | cameraView.ToggleFullScreen(); |
---|
638 | 729 | } |
---|
639 | 730 | |
---|
.. | .. |
---|
735 | 826 | protected static ImageIcon createImageIcon(String path, |
---|
736 | 827 | String description) |
---|
737 | 828 | { |
---|
738 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 829 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
739 | 830 | if (imgURL != null) |
---|
740 | 831 | { |
---|
741 | 832 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
767 | 858 | // NumberSlider vDivsField; |
---|
768 | 859 | // JCheckBox endcaps; |
---|
769 | 860 | JCheckBox liveCB; |
---|
| 861 | + JCheckBox selectCB; |
---|
770 | 862 | JCheckBox hideCB; |
---|
771 | 863 | JCheckBox link2masterCB; |
---|
772 | 864 | JCheckBox markCB; |
---|
.. | .. |
---|
783 | 875 | JButton fasterButton; |
---|
784 | 876 | JButton remarkButton; |
---|
785 | 877 | |
---|
| 878 | + cGridBag editPanel; |
---|
| 879 | + cGridBag editCommandsPanel; |
---|
| 880 | + |
---|
786 | 881 | cGridBag namePanel; |
---|
787 | 882 | cGridBag setupPanel; |
---|
788 | | - cGridBag commandsPanel; |
---|
| 883 | + cGridBag setupPanel2; |
---|
| 884 | + cGridBag objectCommandsPanel; |
---|
789 | 885 | cGridBag pushPanel; |
---|
790 | 886 | cGridBag fillPanel; |
---|
791 | 887 | |
---|
.. | .. |
---|
969 | 1065 | |
---|
970 | 1066 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
971 | 1067 | liveCB.setToolTipText("Animate object"); |
---|
| 1068 | + selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1069 | + selectCB.setToolTipText("Make object selectable"); |
---|
| 1070 | +// Return(); |
---|
972 | 1071 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
973 | 1072 | hideCB.setToolTipText("Hide object"); |
---|
974 | | -// Return(); |
---|
975 | 1073 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
976 | 1074 | markCB.setToolTipText("Set the animation target transform"); |
---|
977 | 1075 | |
---|
978 | | - rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 1076 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1077 | + |
---|
| 1078 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
979 | 1079 | rewindCB.setToolTipText("Rewind animation"); |
---|
980 | 1080 | |
---|
981 | | - randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
982 | | - randomCB.setToolTipText("Option for switch node"); |
---|
| 1081 | + randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
| 1082 | + randomCB.setToolTipText("Randomly Rewind or Go back and forth"); |
---|
983 | 1083 | |
---|
984 | 1084 | if (Globals.ADVANCED) |
---|
985 | 1085 | { |
---|
986 | | - link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
| 1086 | + link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
987 | 1087 | link2masterCB.setToolTipText("Attach to support"); |
---|
988 | | - speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 1088 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
989 | 1089 | speedupCB.setToolTipText("Option motion capture"); |
---|
990 | 1090 | } |
---|
991 | 1091 | |
---|
992 | 1092 | oe.ctrlPanel.add(setupPanel); |
---|
993 | 1093 | oe.ctrlPanel.Return(); |
---|
| 1094 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1095 | + oe.ctrlPanel.Return(); |
---|
994 | 1096 | |
---|
995 | | - commandsPanel = new cGridBag().setVertical(false); |
---|
| 1097 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
996 | 1098 | |
---|
997 | | - resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 1099 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
998 | 1100 | resetButton.setToolTipText("Jump to frame zero"); |
---|
999 | | - stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1101 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
1000 | 1102 | stepButton.setToolTipText("Step one frame"); |
---|
1001 | 1103 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
1002 | 1104 | // stepAllButton = AddButton(oe, "Step All"); |
---|
1003 | 1105 | // Return(); |
---|
1004 | | - slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 1106 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
1005 | 1107 | slowerButton.setToolTipText("Decrease animation speed"); |
---|
1006 | | - fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 1108 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
1007 | 1109 | fasterButton.setToolTipText("Increase animation speed"); |
---|
1008 | | - remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1110 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
1009 | 1111 | remarkButton.setToolTipText("Set the current transform as the target"); |
---|
1010 | 1112 | |
---|
1011 | | - oe.ctrlPanel.add(commandsPanel); |
---|
| 1113 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
1012 | 1114 | oe.ctrlPanel.Return(); |
---|
1013 | 1115 | |
---|
1014 | | - pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1); |
---|
| 1116 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
1015 | 1117 | normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
1016 | 1118 | //Return(); |
---|
1017 | 1119 | |
---|
.. | .. |
---|
1214 | 1316 | //worldPanel.setName("World"); |
---|
1215 | 1317 | centralPanel = new cGridBag(); |
---|
1216 | 1318 | centralPanel.preferredWidth = 20; |
---|
1217 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1218 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1319 | + |
---|
| 1320 | + if (Globals.ADVANCED) |
---|
| 1321 | + { |
---|
| 1322 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1323 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1219 | 1324 | |
---|
1220 | 1325 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1221 | 1326 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1224 | 1329 | // cameraPanel.setDividerSize(9); |
---|
1225 | 1330 | cameraPanel.setResizeWeight(1.0); |
---|
1226 | 1331 | |
---|
| 1332 | + } |
---|
| 1333 | + |
---|
1227 | 1334 | centralPanel.add(cameraView); |
---|
| 1335 | + centralPanel.setFocusable(true); |
---|
1228 | 1336 | //frame.setJMenuBar(timelineMenubar); |
---|
1229 | 1337 | //centralPanel.add(timelinePanel); |
---|
1230 | 1338 | |
---|
.. | .. |
---|
1291 | 1399 | // north.setName("Edit"); |
---|
1292 | 1400 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1293 | 1401 | // objectPanel.add(north); |
---|
1294 | | - objectPanel.add(ctrlPanel); |
---|
| 1402 | + objectPanel.add(editPanel); |
---|
1295 | 1403 | objectPanel.add(infoPanel); |
---|
1296 | 1404 | |
---|
1297 | 1405 | /* |
---|
.. | .. |
---|
1313 | 1421 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1314 | 1422 | |
---|
1315 | 1423 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1316 | | - scenePanel.preferredWidth = 7; |
---|
| 1424 | + scenePanel.preferredWidth = 6; |
---|
1317 | 1425 | |
---|
1318 | 1426 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1319 | 1427 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1419 | 1527 | |
---|
1420 | 1528 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1421 | 1529 | |
---|
1422 | | - frame.setSize(1024, 768); |
---|
1423 | | - frame.show(); |
---|
| 1530 | + frame.setSize(1280, 860); |
---|
| 1531 | + frame.setVisible(true); |
---|
1424 | 1532 | |
---|
| 1533 | + cameraView.requestFocusInWindow(); |
---|
| 1534 | + |
---|
1425 | 1535 | gridPanel.setDividerLocation(1.0); |
---|
1426 | 1536 | |
---|
1427 | 1537 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
.. | .. |
---|
1459 | 1569 | |
---|
1460 | 1570 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1461 | 1571 | |
---|
1462 | | - editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1572 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
1463 | 1573 | createMaterialButton.setToolTipText("Create material"); |
---|
1464 | 1574 | |
---|
1465 | 1575 | /* |
---|
1466 | 1576 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1467 | 1577 | */ |
---|
1468 | 1578 | |
---|
1469 | | - editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1579 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
1470 | 1580 | clearMaterialButton.setToolTipText("Clear material"); |
---|
1471 | 1581 | |
---|
1472 | | - editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
1473 | | - editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
1474 | | - editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1582 | + if (Globals.ADVANCED) |
---|
| 1583 | + { |
---|
| 1584 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1585 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1586 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1587 | + } |
---|
1475 | 1588 | |
---|
1476 | 1589 | editBar.preferredHeight = 15; |
---|
1477 | 1590 | |
---|
.. | .. |
---|
1740 | 1853 | opacityPowerField.addChangeListener(this); |
---|
1741 | 1854 | /**/ |
---|
1742 | 1855 | |
---|
1743 | | - resetSlidersButton.addActionListener(this); |
---|
1744 | 1856 | clearMaterialButton.addActionListener(this); |
---|
1745 | 1857 | createMaterialButton.addActionListener(this); |
---|
1746 | | - |
---|
1747 | | - propagateToggle.addItemListener(this); |
---|
1748 | | - multiplyToggle.addItemListener(this); |
---|
| 1858 | + |
---|
| 1859 | + if (Globals.ADVANCED) |
---|
| 1860 | + { |
---|
| 1861 | + resetSlidersButton.addActionListener(this); |
---|
| 1862 | + propagateToggle.addItemListener(this); |
---|
| 1863 | + multiplyToggle.addItemListener(this); |
---|
| 1864 | + } |
---|
1749 | 1865 | } |
---|
1750 | 1866 | |
---|
1751 | 1867 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1916 | 2032 | |
---|
1917 | 2033 | //? flashIt = false; |
---|
1918 | 2034 | CameraPane pane = (CameraPane) cameraView; |
---|
1919 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2035 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1920 | 2036 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1921 | 2037 | |
---|
1922 | 2038 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1965 | 2081 | e2.printStackTrace(); |
---|
1966 | 2082 | } |
---|
1967 | 2083 | } |
---|
| 2084 | + |
---|
1968 | 2085 | LoadJMEThread loadThread; |
---|
1969 | 2086 | |
---|
1970 | 2087 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2022 | 2139 | //LoadFile0(filename, converter); |
---|
2023 | 2140 | } |
---|
2024 | 2141 | } |
---|
| 2142 | + |
---|
2025 | 2143 | LoadOBJThread loadObjThread; |
---|
2026 | 2144 | |
---|
2027 | 2145 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2100 | 2218 | |
---|
2101 | 2219 | void LoadObjFile(String fullname) |
---|
2102 | 2220 | { |
---|
2103 | | - /* |
---|
| 2221 | + System.out.println("Loading " + fullname); |
---|
| 2222 | + /**/ |
---|
2104 | 2223 | //lastFilename = fullname; |
---|
2105 | 2224 | if(loadObjThread == null) |
---|
2106 | 2225 | { |
---|
2107 | | - loadObjThread = new LoadOBJThread(); |
---|
2108 | | - loadObjThread.start(); |
---|
| 2226 | + loadObjThread = new LoadOBJThread(); |
---|
| 2227 | + loadObjThread.start(); |
---|
2109 | 2228 | } |
---|
2110 | 2229 | |
---|
2111 | 2230 | loadObjThread.add(fullname); |
---|
2112 | | - */ |
---|
| 2231 | + /**/ |
---|
2113 | 2232 | |
---|
2114 | | - System.out.println("Loading " + fullname); |
---|
2115 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2233 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2116 | 2234 | } |
---|
2117 | 2235 | |
---|
2118 | 2236 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2373 | 2491 | |
---|
2374 | 2492 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2375 | 2493 | { |
---|
2376 | | - if (GrafreeD.standAlone) |
---|
| 2494 | + if (Grafreed.standAlone) |
---|
2377 | 2495 | { |
---|
2378 | 2496 | /**/ |
---|
2379 | 2497 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2380 | | - browser.show(); |
---|
| 2498 | + browser.setVisible(true); |
---|
2381 | 2499 | String filename = browser.getFile(); |
---|
2382 | 2500 | if (filename != null && filename.length() > 0) |
---|
2383 | 2501 | { |
---|
.. | .. |
---|
2737 | 2855 | return; |
---|
2738 | 2856 | } |
---|
2739 | 2857 | |
---|
2740 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2858 | + if (multiplyToggle != null) |
---|
| 2859 | + multiplyToggle.setSelected(mat.multiply); |
---|
2741 | 2860 | |
---|
2742 | 2861 | assert (object.projectedVertices != null); |
---|
2743 | 2862 | |
---|
.. | .. |
---|
2952 | 3071 | frame.validate(); |
---|
2953 | 3072 | |
---|
2954 | 3073 | return; |
---|
2955 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3074 | + } else if (event.getSource() == toggleSwitchItem) |
---|
2956 | 3075 | { |
---|
2957 | | - cameraView.ToggleRandom(); |
---|
| 3076 | + cameraView.ToggleSwitch(); |
---|
2958 | 3077 | cameraView.repaint(); |
---|
2959 | 3078 | return; |
---|
2960 | 3079 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
2982 | 3101 | } else if (event.getSource() == liveCB) |
---|
2983 | 3102 | { |
---|
2984 | 3103 | copy.live ^= true; |
---|
| 3104 | + return; |
---|
| 3105 | + } else if (event.getSource() == selectCB) |
---|
| 3106 | + { |
---|
| 3107 | + copy.dontselect ^= true; |
---|
2985 | 3108 | return; |
---|
2986 | 3109 | } else if (event.getSource() == hideCB) |
---|
2987 | 3110 | { |
---|
.. | .. |
---|
3021 | 3144 | |
---|
3022 | 3145 | public void actionPerformed(ActionEvent event) |
---|
3023 | 3146 | { |
---|
| 3147 | + Object source = event.getSource(); |
---|
3024 | 3148 | // SCRIPT DIALOG |
---|
3025 | | - if (event.getSource() == okbutton) |
---|
| 3149 | + if (source == okbutton) |
---|
3026 | 3150 | { |
---|
3027 | 3151 | textpanel.setVisible(false); |
---|
3028 | 3152 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3034 | 3158 | textarea = null; |
---|
3035 | 3159 | textpanel = null; |
---|
3036 | 3160 | } |
---|
3037 | | - if (event.getSource() == cancelbutton) |
---|
| 3161 | + if (source == cancelbutton) |
---|
3038 | 3162 | { |
---|
3039 | 3163 | textpanel.setVisible(false); |
---|
3040 | 3164 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3046 | 3170 | //applySelf(); |
---|
3047 | 3171 | //client.refreshEditWindow(); |
---|
3048 | 3172 | //refreshContents(); |
---|
3049 | | - if (event.getSource() == nameField) |
---|
| 3173 | + if (source == nameField) |
---|
3050 | 3174 | { |
---|
3051 | 3175 | //System.out.println("ObjEditor " + event); |
---|
3052 | 3176 | applySelf0(true); |
---|
3053 | 3177 | //parent.applySelf(); |
---|
3054 | 3178 | objEditor.refreshContents(); |
---|
3055 | | - } else if (event.getSource() == resetButton) |
---|
| 3179 | + } else if (source == resetButton) |
---|
3056 | 3180 | { |
---|
3057 | 3181 | CameraPane.fullreset = true; |
---|
3058 | 3182 | copy.Reset(); // ResetMeshes(); |
---|
3059 | 3183 | copy.Touch(); |
---|
3060 | 3184 | objEditor.refreshContents(); |
---|
3061 | | - } else if (event.getSource() == stepItem) |
---|
| 3185 | + } else if (source == stepItem) |
---|
3062 | 3186 | { |
---|
3063 | 3187 | //cameraView.ONESTEP = true; |
---|
3064 | 3188 | Globals.ONESTEP = true; |
---|
3065 | 3189 | cameraView.repaint(); |
---|
3066 | 3190 | return; |
---|
3067 | | - } else if (event.getSource() == stepButton) |
---|
| 3191 | + } else if (source == stepButton) |
---|
3068 | 3192 | { |
---|
3069 | 3193 | copy.Step(); |
---|
3070 | 3194 | copy.Touch(); |
---|
3071 | 3195 | objEditor.refreshContents(); |
---|
3072 | | - } else if (event.getSource() == slowerButton) |
---|
| 3196 | + } else if (source == slowerButton) |
---|
3073 | 3197 | { |
---|
3074 | 3198 | copy.Slower(); |
---|
3075 | 3199 | copy.Touch(); |
---|
3076 | 3200 | objEditor.refreshContents(); |
---|
3077 | | - } else if (event.getSource() == fasterButton) |
---|
| 3201 | + } else if (source == fasterButton) |
---|
3078 | 3202 | { |
---|
3079 | 3203 | copy.Faster(); |
---|
3080 | 3204 | copy.Touch(); |
---|
3081 | 3205 | objEditor.refreshContents(); |
---|
3082 | | - } else if (event.getSource() == remarkButton) |
---|
| 3206 | + } else if (source == remarkButton) |
---|
3083 | 3207 | { |
---|
3084 | 3208 | copy.Remark(); |
---|
3085 | 3209 | copy.Touch(); |
---|
3086 | 3210 | objEditor.refreshContents(); |
---|
3087 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3211 | + } else if (source == stepAllButton) |
---|
3088 | 3212 | { |
---|
3089 | 3213 | copy.StepAll(); |
---|
3090 | 3214 | copy.Touch(); |
---|
3091 | 3215 | objEditor.refreshContents(); |
---|
3092 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3216 | + } else if (source == resetAllButton) |
---|
3093 | 3217 | { |
---|
3094 | 3218 | //CameraPane.fullreset = true; |
---|
3095 | 3219 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3122 | 3246 | // Close(); |
---|
3123 | 3247 | // } |
---|
3124 | 3248 | // else |
---|
3125 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3249 | + if (source == resetSlidersButton) |
---|
3126 | 3250 | { |
---|
3127 | 3251 | ResetSliders(); |
---|
3128 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3252 | + } else if (source == clearMaterialButton) |
---|
3129 | 3253 | { |
---|
3130 | 3254 | ClearMaterial(); |
---|
3131 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3255 | + } else if (source == createMaterialButton) |
---|
3132 | 3256 | { |
---|
3133 | 3257 | CreateMaterial(); |
---|
3134 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3258 | + } else if (source == clearPanelButton) |
---|
3135 | 3259 | { |
---|
3136 | 3260 | copy.ClearUI(); |
---|
3137 | 3261 | refreshContents(true); |
---|
3138 | | - } /* |
---|
3139 | | - } |
---|
3140 | | - |
---|
3141 | | - public boolean action(Event event, Object arg) |
---|
3142 | | - { |
---|
3143 | | - */ else if (event.getSource() == closeItem) |
---|
| 3262 | + } else if (source == importGFDItem) |
---|
| 3263 | + { |
---|
| 3264 | + ImportGFD(); |
---|
| 3265 | + } else |
---|
| 3266 | + if (source == importVRMLX3DItem) |
---|
| 3267 | + { |
---|
| 3268 | + ImportVRMLX3D(); |
---|
| 3269 | + } else |
---|
| 3270 | + if (source == import3DSItem) |
---|
| 3271 | + { |
---|
| 3272 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3273 | + } else |
---|
| 3274 | + if (source == importOBJItem) |
---|
| 3275 | + { |
---|
| 3276 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3277 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3278 | + browser.setVisible(true); |
---|
| 3279 | + String filename = browser.getFile(); |
---|
| 3280 | + if (filename != null && filename.length() > 0) |
---|
| 3281 | + { |
---|
| 3282 | + String fullname = browser.getDirectory() + filename; |
---|
| 3283 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3284 | + } |
---|
| 3285 | + } else |
---|
| 3286 | + if (source == closeItem) |
---|
3144 | 3287 | { |
---|
3145 | 3288 | Close(); |
---|
3146 | 3289 | //return true; |
---|
3147 | | - } else if (event.getSource() == loadItem) |
---|
| 3290 | + } else if (source == loadItem) |
---|
3148 | 3291 | { |
---|
3149 | 3292 | load(); |
---|
3150 | 3293 | //return true; |
---|
3151 | | - } else if (event.getSource() == saveItem) |
---|
| 3294 | + } else if (source == newItem) |
---|
| 3295 | + { |
---|
| 3296 | + New(); |
---|
| 3297 | + } else if (source == saveItem) |
---|
3152 | 3298 | { |
---|
3153 | 3299 | save(); |
---|
3154 | 3300 | //return true; |
---|
3155 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3301 | + } else if (source == saveAsItem) |
---|
3156 | 3302 | { |
---|
3157 | 3303 | saveAs(); |
---|
3158 | 3304 | //return true; |
---|
3159 | | - } else if (event.getSource() == reexportItem) |
---|
| 3305 | + } else if (source == reexportItem) |
---|
3160 | 3306 | { |
---|
3161 | 3307 | reexport(); |
---|
3162 | 3308 | //return true; |
---|
3163 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3309 | + } else if (source == exportAsItem) |
---|
3164 | 3310 | { |
---|
3165 | 3311 | export(); |
---|
3166 | 3312 | //return true; |
---|
3167 | | - } else if (event.getSource() == povItem) |
---|
| 3313 | + } else if (source == povItem) |
---|
3168 | 3314 | { |
---|
3169 | 3315 | generatePOV(); |
---|
3170 | 3316 | //return true; |
---|
3171 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3317 | + } else if (source == zBufferItem) |
---|
3172 | 3318 | { |
---|
3173 | 3319 | try |
---|
3174 | 3320 | { |
---|
.. | .. |
---|
3190 | 3336 | cameraView.repaint(); |
---|
3191 | 3337 | //return true; |
---|
3192 | 3338 | } |
---|
3193 | | - */ else if (event.getSource() == editCameraItem) |
---|
3194 | | - { |
---|
3195 | | - cameraView.ProtectCamera(); |
---|
3196 | | - cameraView.repaint(); |
---|
3197 | | - return; |
---|
3198 | | - } else if (event.getSource() == revertCameraItem) |
---|
3199 | | - { |
---|
3200 | | - cameraView.RevertCamera(); |
---|
3201 | | - cameraView.repaint(); |
---|
3202 | | - return; |
---|
3203 | | -// } else if (event.getSource() == textureButton) |
---|
3204 | | -// { |
---|
3205 | | -// return; // true; |
---|
3206 | | - } else // combos... |
---|
3207 | | - if (event.getSource() == texresMenu) |
---|
| 3339 | + */ else // combos... |
---|
| 3340 | + if (source == texresMenu) |
---|
3208 | 3341 | { |
---|
3209 | 3342 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3210 | 3343 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3216 | 3349 | } |
---|
3217 | 3350 | } |
---|
3218 | 3351 | |
---|
| 3352 | + void New() |
---|
| 3353 | + { |
---|
| 3354 | + while (copy.Size() > 1) |
---|
| 3355 | + { |
---|
| 3356 | + copy.remove(1); |
---|
| 3357 | + } |
---|
| 3358 | + |
---|
| 3359 | + ResetModel(); |
---|
| 3360 | + objEditor.refreshContents(); |
---|
| 3361 | + } |
---|
| 3362 | + |
---|
| 3363 | + static public byte[] Compress(Object3D o) |
---|
| 3364 | + { |
---|
| 3365 | + try |
---|
| 3366 | + { |
---|
| 3367 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3368 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3369 | + ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 3370 | + |
---|
| 3371 | + Object3D parent = o.parent; |
---|
| 3372 | + o.parent = null; |
---|
| 3373 | + |
---|
| 3374 | + out.writeObject(o); |
---|
| 3375 | + |
---|
| 3376 | + o.parent = parent; |
---|
| 3377 | + |
---|
| 3378 | + out.flush(); |
---|
| 3379 | + |
---|
| 3380 | + zstream.close(); |
---|
| 3381 | + out.close(); |
---|
| 3382 | + |
---|
| 3383 | + return baos.toByteArray(); |
---|
| 3384 | + } catch (Exception e) |
---|
| 3385 | + { |
---|
| 3386 | + System.err.println(e); |
---|
| 3387 | + return null; |
---|
| 3388 | + } |
---|
| 3389 | + } |
---|
| 3390 | + |
---|
| 3391 | + static public Object Uncompress(byte[] bytes) |
---|
| 3392 | + { |
---|
| 3393 | + System.out.println("#bytes = " + bytes.length); |
---|
| 3394 | + try |
---|
| 3395 | + { |
---|
| 3396 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3397 | + java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3398 | + ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 3399 | + Object obj = in.readObject(); |
---|
| 3400 | + in.close(); |
---|
| 3401 | + |
---|
| 3402 | + return obj; |
---|
| 3403 | + } catch (Exception e) |
---|
| 3404 | + { |
---|
| 3405 | + System.err.println(e); |
---|
| 3406 | + return null; |
---|
| 3407 | + } |
---|
| 3408 | + } |
---|
| 3409 | + |
---|
| 3410 | + static public Object clone(Object o) |
---|
| 3411 | + { |
---|
| 3412 | + try |
---|
| 3413 | + { |
---|
| 3414 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3415 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3416 | + |
---|
| 3417 | + out.writeObject(o); |
---|
| 3418 | + |
---|
| 3419 | + out.flush(); |
---|
| 3420 | + out.close(); |
---|
| 3421 | + |
---|
| 3422 | + byte[] bytes = baos.toByteArray(); |
---|
| 3423 | + |
---|
| 3424 | + System.out.println("clone = " + bytes.length); |
---|
| 3425 | + |
---|
| 3426 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3427 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3428 | + Object obj = in.readObject(); |
---|
| 3429 | + in.close(); |
---|
| 3430 | + |
---|
| 3431 | + return obj; |
---|
| 3432 | + } catch (Exception e) |
---|
| 3433 | + { |
---|
| 3434 | + System.err.println(e); |
---|
| 3435 | + return null; |
---|
| 3436 | + } |
---|
| 3437 | + } |
---|
| 3438 | + |
---|
| 3439 | + cRadio GetCurrentTab() |
---|
| 3440 | + { |
---|
| 3441 | + cRadio ab; |
---|
| 3442 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3443 | + { |
---|
| 3444 | + ab = (cRadio)e.nextElement(); |
---|
| 3445 | + if(ab.GetObject() == copy) |
---|
| 3446 | + { |
---|
| 3447 | + return ab; |
---|
| 3448 | + } |
---|
| 3449 | + } |
---|
| 3450 | + |
---|
| 3451 | + return null; |
---|
| 3452 | + } |
---|
| 3453 | + |
---|
| 3454 | + java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3455 | + |
---|
| 3456 | + public void Save() |
---|
| 3457 | + { |
---|
| 3458 | + System.err.println("Save"); |
---|
| 3459 | + |
---|
| 3460 | + cRadio tab = GetCurrentTab(); |
---|
| 3461 | + |
---|
| 3462 | + boolean temp = CameraPane.SWITCH; |
---|
| 3463 | + CameraPane.SWITCH = false; |
---|
| 3464 | + |
---|
| 3465 | + copy.ExtractBigData(hashtable); |
---|
| 3466 | + |
---|
| 3467 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3468 | + tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3469 | + |
---|
| 3470 | + copy.RestoreBigData(hashtable); |
---|
| 3471 | + |
---|
| 3472 | + CameraPane.SWITCH = temp; |
---|
| 3473 | + |
---|
| 3474 | + //assert(hashtable.isEmpty()); |
---|
| 3475 | + |
---|
| 3476 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3477 | + { |
---|
| 3478 | + tab.graphs[i] = null; |
---|
| 3479 | + } |
---|
| 3480 | + |
---|
| 3481 | + // test save |
---|
| 3482 | + if (false) |
---|
| 3483 | + { |
---|
| 3484 | + try |
---|
| 3485 | + { |
---|
| 3486 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3487 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3488 | + |
---|
| 3489 | + p.writeObject(copy); |
---|
| 3490 | + |
---|
| 3491 | + p.flush(); |
---|
| 3492 | + |
---|
| 3493 | + ostream.close(); |
---|
| 3494 | + } catch (Exception e) |
---|
| 3495 | + { |
---|
| 3496 | + e.printStackTrace(); |
---|
| 3497 | + } |
---|
| 3498 | + } |
---|
| 3499 | + } |
---|
| 3500 | + |
---|
| 3501 | + void CopyChanged(Object3D obj) |
---|
| 3502 | + { |
---|
| 3503 | + boolean temp = CameraPane.SWITCH; |
---|
| 3504 | + CameraPane.SWITCH = false; |
---|
| 3505 | + |
---|
| 3506 | + copy.ExtractBigData(hashtable); |
---|
| 3507 | + |
---|
| 3508 | + copy.clear(); |
---|
| 3509 | + |
---|
| 3510 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3511 | + { |
---|
| 3512 | + copy.add(obj.get(i)); |
---|
| 3513 | + } |
---|
| 3514 | + |
---|
| 3515 | + copy.RestoreBigData(hashtable); |
---|
| 3516 | + |
---|
| 3517 | + CameraPane.SWITCH = temp; |
---|
| 3518 | + |
---|
| 3519 | + //assert(hashtable.isEmpty()); |
---|
| 3520 | + |
---|
| 3521 | + copy.Touch(); |
---|
| 3522 | + |
---|
| 3523 | + ResetModel(); |
---|
| 3524 | + copy.HardTouch(); // recompile? |
---|
| 3525 | + |
---|
| 3526 | + cRadio ab; |
---|
| 3527 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3528 | + { |
---|
| 3529 | + ab = (cRadio)e.nextElement(); |
---|
| 3530 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3531 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3532 | + if (test != null) |
---|
| 3533 | + { |
---|
| 3534 | + test.editWindow = ab.object.editWindow; |
---|
| 3535 | + ab.object = test; |
---|
| 3536 | + } |
---|
| 3537 | + } |
---|
| 3538 | + |
---|
| 3539 | + refreshContents(); |
---|
| 3540 | + } |
---|
| 3541 | + |
---|
| 3542 | + public void Undo() |
---|
| 3543 | + { |
---|
| 3544 | + System.err.println("Undo"); |
---|
| 3545 | + |
---|
| 3546 | + cRadio tab = GetCurrentTab(); |
---|
| 3547 | + |
---|
| 3548 | + if (tab.undoindex == 0) |
---|
| 3549 | + { |
---|
| 3550 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3551 | + return; |
---|
| 3552 | + } |
---|
| 3553 | + |
---|
| 3554 | + if (tab.graphs[tab.undoindex] == null) |
---|
| 3555 | + { |
---|
| 3556 | + Save(); |
---|
| 3557 | + tab.undoindex -= 1; |
---|
| 3558 | + } |
---|
| 3559 | + |
---|
| 3560 | + tab.undoindex -= 1; |
---|
| 3561 | + |
---|
| 3562 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3563 | + } |
---|
| 3564 | + |
---|
| 3565 | + public void Redo() |
---|
| 3566 | + { |
---|
| 3567 | + cRadio tab = GetCurrentTab(); |
---|
| 3568 | + |
---|
| 3569 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3570 | + { |
---|
| 3571 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3572 | + return; |
---|
| 3573 | + } |
---|
| 3574 | + |
---|
| 3575 | + tab.undoindex += 1; |
---|
| 3576 | + |
---|
| 3577 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3578 | + } |
---|
| 3579 | + |
---|
| 3580 | + void ImportGFD() |
---|
| 3581 | + { |
---|
| 3582 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
| 3583 | + browser.show(); |
---|
| 3584 | + String filename = browser.getFile(); |
---|
| 3585 | + if (filename != null && filename.length() > 0) |
---|
| 3586 | + { |
---|
| 3587 | + String fullname = browser.getDirectory() + filename; |
---|
| 3588 | + |
---|
| 3589 | + //Object3D readobj = |
---|
| 3590 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3591 | + //makeSomething(readobj); |
---|
| 3592 | + } |
---|
| 3593 | + } |
---|
| 3594 | + |
---|
| 3595 | + void ImportVRMLX3D() |
---|
| 3596 | + { |
---|
| 3597 | + if (Grafreed.standAlone) |
---|
| 3598 | + { |
---|
| 3599 | + /**/ |
---|
| 3600 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3601 | + browser.show(); |
---|
| 3602 | + String filename = browser.getFile(); |
---|
| 3603 | + if (filename != null && filename.length() > 0) |
---|
| 3604 | + { |
---|
| 3605 | + String fullname = browser.getDirectory() + filename; |
---|
| 3606 | + LoadVRMLX3D(fullname); |
---|
| 3607 | + } |
---|
| 3608 | + /**/ |
---|
| 3609 | + } |
---|
| 3610 | + } |
---|
| 3611 | + |
---|
3219 | 3612 | void ToggleAnimation() |
---|
3220 | 3613 | { |
---|
3221 | 3614 | if (!Globals.ANIMATION) |
---|
.. | .. |
---|
3231 | 3624 | |
---|
3232 | 3625 | Globals.ANIMATION ^= true; |
---|
3233 | 3626 | |
---|
3234 | | - GrafreeD.wav.cursor = 0; |
---|
3235 | | - GrafreeD.wav.loop = 0; |
---|
| 3627 | + Grafreed.wav.cursor = 0; |
---|
| 3628 | + Grafreed.wav.loop = 0; |
---|
3236 | 3629 | } |
---|
3237 | 3630 | } else |
---|
3238 | 3631 | { |
---|
.. | .. |
---|
3253 | 3646 | callee.refreshContents(); |
---|
3254 | 3647 | } else |
---|
3255 | 3648 | { |
---|
3256 | | - new Exception().printStackTrace(); |
---|
3257 | 3649 | System.exit(0); |
---|
3258 | 3650 | } |
---|
3259 | 3651 | } |
---|
.. | .. |
---|
3283 | 3675 | void CreateMaterial() |
---|
3284 | 3676 | { |
---|
3285 | 3677 | //copy.ClearMaterial(); // PATCH |
---|
3286 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3678 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3287 | 3679 | if (copy.selection.size() > 0) |
---|
3288 | 3680 | //SetMaterial(copy); |
---|
3289 | 3681 | { |
---|
.. | .. |
---|
3342 | 3734 | { |
---|
3343 | 3735 | copy.ResetBlockLoop(); // temporary problem |
---|
3344 | 3736 | |
---|
3345 | | - boolean random = CameraPane.RANDOM; |
---|
3346 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3737 | + boolean random = CameraPane.SWITCH; |
---|
| 3738 | + CameraPane.SWITCH = false; // parse everything |
---|
3347 | 3739 | copy.ResetDisplayList(); |
---|
3348 | 3740 | copy.HardTouch(); |
---|
3349 | | - CameraPane.RANDOM = random; |
---|
| 3741 | + CameraPane.SWITCH = random; |
---|
3350 | 3742 | } |
---|
3351 | 3743 | |
---|
3352 | 3744 | // public void applySelf() |
---|
.. | .. |
---|
3420 | 3812 | { |
---|
3421 | 3813 | //System.out.println("Propagate = " + propagate); |
---|
3422 | 3814 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 3815 | + |
---|
| 3816 | + if (copy.material != null) |
---|
| 3817 | + { |
---|
| 3818 | + cMaterial mat = copy.material; |
---|
| 3819 | + |
---|
| 3820 | + colorField.SetToolTipValue((mat.color)); |
---|
| 3821 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 3822 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 3823 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 3824 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 3825 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 3826 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 3827 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 3828 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 3829 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 3830 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 3831 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 3832 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 3833 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 3834 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 3835 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 3836 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 3837 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 3838 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 3839 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 3840 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 3841 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 3842 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 3843 | + } |
---|
| 3844 | + |
---|
3423 | 3845 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3424 | 3846 | { |
---|
3425 | 3847 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3535 | 3957 | } |
---|
3536 | 3958 | |
---|
3537 | 3959 | if (normalpushField != null) |
---|
3538 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 3960 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3539 | 3961 | } |
---|
3540 | 3962 | |
---|
3541 | 3963 | void SnapObject() |
---|
.. | .. |
---|
3799 | 4221 | |
---|
3800 | 4222 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3801 | 4223 | { |
---|
| 4224 | + if (Globals.SAVEONMAKE) |
---|
| 4225 | + Save(); |
---|
3802 | 4226 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3803 | 4227 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3804 | 4228 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
4002 | 4426 | } |
---|
4003 | 4427 | } |
---|
4004 | 4428 | } |
---|
| 4429 | + |
---|
4005 | 4430 | LoadGFDThread loadGFDThread; |
---|
4006 | 4431 | |
---|
4007 | 4432 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4021 | 4446 | |
---|
4022 | 4447 | try |
---|
4023 | 4448 | { |
---|
| 4449 | + // Try compressed version first. |
---|
4024 | 4450 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4025 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4451 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4452 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4026 | 4453 | |
---|
4027 | 4454 | readobj = (Object3D) p.readObject(); |
---|
4028 | 4455 | istream.close(); |
---|
.. | .. |
---|
4030 | 4457 | readobj.ResetDisplayList(); |
---|
4031 | 4458 | } catch (Exception e) |
---|
4032 | 4459 | { |
---|
4033 | | - e.printStackTrace(); |
---|
| 4460 | + //e.printStackTrace(); |
---|
| 4461 | + try |
---|
| 4462 | + { |
---|
| 4463 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4464 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4465 | + |
---|
| 4466 | + readobj = (Object3D) p.readObject(); |
---|
| 4467 | + istream.close(); |
---|
| 4468 | + |
---|
| 4469 | + readobj.ResetDisplayList(); |
---|
| 4470 | + } catch (Exception e2) |
---|
| 4471 | + { |
---|
| 4472 | + e2.printStackTrace(); |
---|
| 4473 | + } |
---|
4034 | 4474 | } |
---|
4035 | 4475 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4036 | 4476 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4076 | 4516 | |
---|
4077 | 4517 | void LoadIt(Object obj) |
---|
4078 | 4518 | { |
---|
| 4519 | + if (obj == null) |
---|
| 4520 | + { |
---|
| 4521 | + // Invalid file |
---|
| 4522 | + return; |
---|
| 4523 | + } |
---|
| 4524 | + |
---|
4079 | 4525 | System.out.println("Loaded " + obj); |
---|
4080 | 4526 | //new Exception().printStackTrace(); |
---|
4081 | 4527 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4085 | 4531 | |
---|
4086 | 4532 | if (readobj != null) |
---|
4087 | 4533 | { |
---|
| 4534 | + if (Globals.SAVEONMAKE) |
---|
| 4535 | + Save(); |
---|
4088 | 4536 | try |
---|
4089 | 4537 | { |
---|
4090 | 4538 | //readobj.deepCopySelf(copy); |
---|
.. | .. |
---|
4147 | 4595 | |
---|
4148 | 4596 | void load() // throws ClassNotFoundException |
---|
4149 | 4597 | { |
---|
4150 | | - if (GrafreeD.standAlone) |
---|
| 4598 | + if (Grafreed.standAlone) |
---|
4151 | 4599 | { |
---|
4152 | 4600 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4153 | 4601 | browser.show(); |
---|
.. | .. |
---|
4234 | 4682 | try |
---|
4235 | 4683 | { |
---|
4236 | 4684 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4237 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4685 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4686 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4238 | 4687 | |
---|
4239 | 4688 | p.writeObject(copy); |
---|
4240 | 4689 | p.flush(); |
---|
4241 | 4690 | |
---|
| 4691 | + zstream.close(); |
---|
4242 | 4692 | ostream.close(); |
---|
4243 | 4693 | |
---|
4244 | 4694 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4248 | 4698 | { |
---|
4249 | 4699 | } |
---|
4250 | 4700 | } |
---|
| 4701 | + |
---|
4251 | 4702 | String lastname; |
---|
4252 | 4703 | |
---|
4253 | 4704 | void saveAs() |
---|
4254 | 4705 | { |
---|
4255 | | - if (GrafreeD.standAlone) |
---|
| 4706 | + if (Grafreed.standAlone) |
---|
4256 | 4707 | { |
---|
4257 | 4708 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4258 | 4709 | browser.setVisible(true); |
---|
.. | .. |
---|
4357 | 4808 | try |
---|
4358 | 4809 | { |
---|
4359 | 4810 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4360 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4361 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 4811 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4812 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4362 | 4813 | |
---|
4363 | 4814 | Object3D objectparent = obj.parent; |
---|
4364 | 4815 | obj.parent = null; |
---|
4365 | 4816 | |
---|
4366 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 4817 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4367 | 4818 | |
---|
4368 | 4819 | obj.parent = objectparent; |
---|
4369 | 4820 | |
---|
.. | .. |
---|
4375 | 4826 | p.writeObject(object); |
---|
4376 | 4827 | p.flush(); |
---|
4377 | 4828 | |
---|
| 4829 | + zstream.close(); |
---|
4378 | 4830 | ostream.close(); |
---|
4379 | | - // zstream.close(); |
---|
4380 | 4831 | |
---|
4381 | 4832 | // group.selection.get(0).parent = parent; |
---|
4382 | 4833 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4397 | 4848 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4398 | 4849 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4399 | 4850 | copy.generatePOV(buffer); |
---|
4400 | | - if (GrafreeD.standAlone) |
---|
| 4851 | + if (Grafreed.standAlone) |
---|
4401 | 4852 | { |
---|
4402 | 4853 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4403 | 4854 | browser.show(); |
---|
.. | .. |
---|
4423 | 4874 | Object3D client; |
---|
4424 | 4875 | Object3D copy; |
---|
4425 | 4876 | MenuBar menuBar; |
---|
4426 | | - Menu windowMenu; |
---|
| 4877 | + Menu fileMenu; |
---|
| 4878 | + MenuItem newItem; |
---|
4427 | 4879 | MenuItem loadItem; |
---|
4428 | 4880 | MenuItem saveItem; |
---|
4429 | 4881 | MenuItem saveAsItem; |
---|
.. | .. |
---|
4431 | 4883 | MenuItem reexportItem; |
---|
4432 | 4884 | MenuItem povItem; |
---|
4433 | 4885 | MenuItem closeItem; |
---|
4434 | | - Menu cameraMenu; |
---|
| 4886 | + |
---|
4435 | 4887 | CheckboxMenuItem zBufferItem; |
---|
4436 | 4888 | //MenuItem normalLensItem; |
---|
4437 | | - MenuItem editCameraItem; |
---|
4438 | | - MenuItem revertCameraItem; |
---|
4439 | 4889 | MenuItem stepItem; |
---|
4440 | 4890 | CheckboxMenuItem toggleLiveItem; |
---|
4441 | 4891 | CheckboxMenuItem toggleFullScreenItem; |
---|
.. | .. |
---|
4446 | 4896 | CheckboxMenuItem toggleFootContactItem; |
---|
4447 | 4897 | CheckboxMenuItem toggleDLItem; |
---|
4448 | 4898 | CheckboxMenuItem toggleTextureItem; |
---|
4449 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 4899 | + CheckboxMenuItem toggleSwitchItem; |
---|
4450 | 4900 | CheckboxMenuItem toggleRootItem; |
---|
4451 | 4901 | CheckboxMenuItem animationItem; |
---|
4452 | 4902 | CheckboxMenuItem toggleHandleItem; |
---|
.. | .. |
---|
4583 | 5033 | //ObjectUI parent; |
---|
4584 | 5034 | |
---|
4585 | 5035 | cNumberSlider normalpushField; |
---|
| 5036 | + |
---|
| 5037 | + private MenuItem importGFDItem; |
---|
| 5038 | + private MenuItem importVRMLX3DItem; |
---|
| 5039 | + private MenuItem import3DSItem; |
---|
| 5040 | + private MenuItem importOBJItem; |
---|
4586 | 5041 | } |
---|