.. | .. |
---|
4 | 4 | |
---|
5 | 5 | import java.awt.*; |
---|
6 | 6 | import java.awt.event.*; |
---|
| 7 | +import java.awt.image.BufferedImage; |
---|
7 | 8 | import javax.swing.*; |
---|
8 | 9 | import javax.swing.event.*; |
---|
9 | 10 | import javax.swing.text.*; |
---|
.. | .. |
---|
13 | 14 | import javax.swing.plaf.metal.MetalLookAndFeel; |
---|
14 | 15 | //import javax.swing.plaf.ColorUIResource; |
---|
15 | 16 | //import javax.swing.plaf.metal.DefaultMetalTheme; |
---|
| 17 | + |
---|
| 18 | +import javax.swing.plaf.basic.BasicSplitPaneDivider; |
---|
| 19 | +import javax.swing.plaf.basic.BasicSplitPaneUI; |
---|
16 | 20 | |
---|
17 | 21 | //import javax.media.opengl.GLCanvas; |
---|
18 | 22 | |
---|
.. | .. |
---|
35 | 39 | |
---|
36 | 40 | GroupEditor callee; |
---|
37 | 41 | JFrame frame; |
---|
| 42 | + |
---|
| 43 | + static ObjEditor theFrame; |
---|
| 44 | + |
---|
| 45 | + cButton GetButton(String name, boolean border) |
---|
| 46 | + { |
---|
| 47 | + try |
---|
| 48 | + { |
---|
| 49 | + ImageIcon icon = GetIcon(name); |
---|
| 50 | + return new cButton(icon, border); |
---|
| 51 | + } |
---|
| 52 | + catch (Exception e) |
---|
| 53 | + { |
---|
| 54 | + return new cButton(name, border); |
---|
| 55 | + } |
---|
| 56 | + } |
---|
| 57 | + |
---|
| 58 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 59 | + { |
---|
| 60 | + try |
---|
| 61 | + { |
---|
| 62 | + ImageIcon icon = GetIcon(name); |
---|
| 63 | + return new cToggleButton(icon, border); |
---|
| 64 | + } |
---|
| 65 | + catch (Exception e) |
---|
| 66 | + { |
---|
| 67 | + return new cToggleButton(name, border); |
---|
| 68 | + } |
---|
| 69 | + } |
---|
| 70 | + |
---|
| 71 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 72 | + { |
---|
| 73 | + try |
---|
| 74 | + { |
---|
| 75 | + ImageIcon icon = GetIcon(name); |
---|
| 76 | + return new cCheckBox(icon, border); |
---|
| 77 | + } |
---|
| 78 | + catch (Exception e) |
---|
| 79 | + { |
---|
| 80 | + return new cCheckBox(name, border); |
---|
| 81 | + } |
---|
| 82 | + } |
---|
| 83 | + |
---|
| 84 | + private ImageIcon GetIcon(String name) throws IOException |
---|
| 85 | + { |
---|
| 86 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 87 | + |
---|
| 88 | + if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 89 | + { |
---|
| 90 | + BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
| 91 | + Graphics2D g = resized.createGraphics(); |
---|
| 92 | + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 93 | + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 94 | + g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 95 | + g.dispose(); |
---|
| 96 | + |
---|
| 97 | + image = resized; |
---|
| 98 | + } |
---|
| 99 | + |
---|
| 100 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 101 | + return icon; |
---|
| 102 | + } |
---|
38 | 103 | |
---|
39 | 104 | // SCRIPT |
---|
40 | 105 | |
---|
.. | .. |
---|
145 | 210 | |
---|
146 | 211 | objEditor.ctrlPanel.remove(namePanel); |
---|
147 | 212 | |
---|
148 | | - if (!GroupEditor.allparams) |
---|
| 213 | + if (!allparams) |
---|
149 | 214 | return; |
---|
150 | 215 | |
---|
151 | 216 | // objEditor.ctrlPanel.remove(liveCB); |
---|
.. | .. |
---|
168 | 233 | // objEditor.ctrlPanel.remove(remarkButton); |
---|
169 | 234 | |
---|
170 | 235 | objEditor.ctrlPanel.remove(setupPanel); |
---|
171 | | - objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 236 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 237 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
172 | 238 | objEditor.ctrlPanel.remove(pushPanel); |
---|
173 | 239 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
174 | 240 | |
---|
.. | .. |
---|
243 | 309 | //localCopy.parent = null; |
---|
244 | 310 | |
---|
245 | 311 | frame = new JFrame(); |
---|
| 312 | + frame.setUndecorated(true); |
---|
246 | 313 | objEditor = this; |
---|
247 | 314 | this.callee = callee; |
---|
248 | 315 | |
---|
.. | .. |
---|
273 | 340 | return frame.action(event, obj); |
---|
274 | 341 | } |
---|
275 | 342 | |
---|
| 343 | + // Cannot work without static |
---|
| 344 | + static boolean allparams = true; |
---|
| 345 | + |
---|
| 346 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 347 | + |
---|
276 | 348 | void SetupMenu() |
---|
277 | 349 | { |
---|
278 | 350 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
279 | | - 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...")); |
---|
| 351 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 352 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 353 | + fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
| 354 | + |
---|
| 355 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 356 | + Menu menu = new Menu("Import"); |
---|
| 357 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 358 | + importOBJItem.addActionListener(this); |
---|
| 359 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 360 | + import3DSItem.addActionListener(this); |
---|
| 361 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 362 | + importVRMLX3DItem.addActionListener(this); |
---|
| 363 | + menu.add("-"); |
---|
| 364 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 365 | + importGFDItem.addActionListener(this); |
---|
| 366 | + fileMenu.add(menu); |
---|
| 367 | + fileMenu.add("-"); |
---|
| 368 | + |
---|
| 369 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 370 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
284 | 371 | //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("-"); |
---|
| 372 | + fileMenu.add("-"); |
---|
| 373 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 374 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 375 | + fileMenu.add("-"); |
---|
289 | 376 | if (client.parent != null) |
---|
290 | 377 | { |
---|
291 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 378 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
292 | 379 | } else |
---|
293 | 380 | { |
---|
294 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 381 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
295 | 382 | } |
---|
296 | 383 | |
---|
| 384 | + newItem.addActionListener(this); |
---|
297 | 385 | loadItem.addActionListener(this); |
---|
298 | 386 | saveItem.addActionListener(this); |
---|
299 | 387 | saveAsItem.addActionListener(this); |
---|
.. | .. |
---|
302 | 390 | //povItem.addActionListener(this); |
---|
303 | 391 | closeItem.addActionListener(this); |
---|
304 | 392 | |
---|
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 | | - |
---|
313 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
314 | | - toggleFullScreenItem.addItemListener(this); |
---|
315 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
316 | | - cameraMenu.add("-"); |
---|
317 | | - |
---|
318 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
319 | | - toggleTextureItem.addItemListener(this); |
---|
320 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
321 | | - |
---|
322 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
323 | | - toggleSwitchItem.addItemListener(this); |
---|
324 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
325 | | - |
---|
326 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
327 | | - toggleHandleItem.addItemListener(this); |
---|
328 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
329 | | - |
---|
330 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
331 | | - togglePaintItem.addItemListener(this); |
---|
332 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
333 | | - |
---|
334 | | - if (Globals.ADVANCED) |
---|
335 | | - { |
---|
336 | | - cameraMenu.add("-"); |
---|
337 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
338 | | - toggleLiveItem.addItemListener(this); |
---|
339 | | - toggleLiveItem.setState(Globals.isLIVE()); |
---|
340 | | - |
---|
341 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
342 | | - stepItem.addActionListener(this); |
---|
343 | | - // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
344 | | - // toggleDLItem.addItemListener(this); |
---|
345 | | - // toggleDLItem.setState(false); |
---|
346 | | - |
---|
347 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
348 | | - toggleRenderItem.addItemListener(this); |
---|
349 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
350 | | - |
---|
351 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
352 | | - toggleDebugItem.addItemListener(this); |
---|
353 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
354 | | - |
---|
355 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
356 | | - toggleFrustumItem.addItemListener(this); |
---|
357 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
358 | | - |
---|
359 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
360 | | - toggleFootContactItem.addItemListener(this); |
---|
361 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
362 | | - |
---|
363 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
364 | | - toggleTimelineItem.addItemListener(this); |
---|
365 | | - } |
---|
366 | | - |
---|
367 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
368 | | -// toggleRootItem.addItemListener(this); |
---|
369 | | -// toggleRootItem.setState(false); |
---|
370 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
371 | | -// animationItem.addItemListener(this); |
---|
372 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
373 | | - cameraMenu.add("-"); |
---|
374 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
375 | | - editCameraItem.addActionListener(this); |
---|
376 | | - |
---|
377 | 393 | objectPanel = new JTabbedPane(); |
---|
| 394 | + |
---|
| 395 | + ChangeListener changeListener = new ChangeListener() |
---|
| 396 | + { |
---|
| 397 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 398 | + { |
---|
| 399 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 400 | +// { |
---|
| 401 | +// if (latestObject != null) |
---|
| 402 | +// { |
---|
| 403 | +// refreshContents(true); |
---|
| 404 | +// SetMaterial(latestObject); |
---|
| 405 | +// } |
---|
| 406 | +// |
---|
| 407 | +// materialFlushed = true; |
---|
| 408 | +// } |
---|
| 409 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 410 | +// { |
---|
| 411 | +// if (listUI.size() == 0) |
---|
| 412 | +// EditSelection(false); |
---|
| 413 | +// } |
---|
| 414 | + |
---|
| 415 | + refreshContents(false); // To refresh Info tab |
---|
| 416 | + } |
---|
| 417 | + }; |
---|
| 418 | + objectPanel.addChangeListener(changeListener); |
---|
| 419 | + |
---|
378 | 420 | toolbarPanel = new JPanel(); |
---|
379 | 421 | toolbarPanel.setName("Toolbar"); |
---|
380 | 422 | treePanel = new cGridBag(); |
---|
381 | 423 | treePanel.setName("Tree"); |
---|
| 424 | + |
---|
| 425 | + editPanel = new cGridBag().setVertical(true); |
---|
| 426 | + editPanel.setName("Edit"); |
---|
| 427 | + |
---|
382 | 428 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
383 | | - ctrlPanel.setName("Edit"); |
---|
| 429 | + |
---|
| 430 | + editCommandsPanel = new cGridBag(); |
---|
| 431 | + editPanel.add(editCommandsPanel); |
---|
| 432 | + editPanel.add(ctrlPanel); |
---|
| 433 | + |
---|
| 434 | + toolboxPanel = new cGridBag().setVertical(false); |
---|
| 435 | + toolboxPanel.setName("Toolbox"); |
---|
| 436 | + |
---|
384 | 437 | materialPanel = new cGridBag().setVertical(true); |
---|
385 | 438 | materialPanel.setName("Material"); |
---|
| 439 | + |
---|
386 | 440 | /*JTextPane*/ |
---|
387 | 441 | infoarea = createTextPane(); |
---|
388 | 442 | doc = infoarea.getStyledDocument(); |
---|
.. | .. |
---|
407 | 461 | mainPanel.setDividerSize(9); |
---|
408 | 462 | mainPanel.setDividerLocation(0.5); //1.0); |
---|
409 | 463 | mainPanel.setResizeWeight(0.5); |
---|
410 | | - |
---|
| 464 | + |
---|
| 465 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 466 | +// BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 467 | +// divider.setDividerSize(15); |
---|
| 468 | +// divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 469 | + |
---|
| 470 | + |
---|
411 | 471 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
412 | 472 | //mainPanel.setLayout(new GridBagLayout()); |
---|
413 | 473 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
.. | .. |
---|
475 | 535 | e.printStackTrace(); |
---|
476 | 536 | } |
---|
477 | 537 | |
---|
478 | | - String selection = infoarea.getText(); |
---|
479 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
480 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
481 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 538 | +// String selection = infoarea.getText(); |
---|
| 539 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 540 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 541 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
482 | 542 | //clipboard.setContents(data, data); |
---|
483 | 543 | } |
---|
484 | 544 | |
---|
.. | .. |
---|
501 | 561 | //SendInfo("Name:", "bold"); |
---|
502 | 562 | if (sel.GetTextures() != null || debug) |
---|
503 | 563 | { |
---|
504 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 564 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
505 | 565 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
506 | 566 | if (sel.Size() > 0) |
---|
507 | 567 | { |
---|
508 | 568 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
509 | 569 | } |
---|
510 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 570 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
511 | 571 | if (debug) |
---|
512 | 572 | { |
---|
513 | 573 | try |
---|
.. | .. |
---|
549 | 609 | } |
---|
550 | 610 | if (sel.support != null) |
---|
551 | 611 | { |
---|
552 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 612 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
553 | 613 | } |
---|
554 | 614 | if (sel.scriptnode != null) |
---|
555 | 615 | { |
---|
.. | .. |
---|
638 | 698 | } |
---|
639 | 699 | } |
---|
640 | 700 | |
---|
| 701 | +static GraphicsDevice device = GraphicsEnvironment |
---|
| 702 | + .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 703 | + |
---|
| 704 | + Rectangle keeprect; |
---|
| 705 | + cRadio radio; |
---|
| 706 | + |
---|
| 707 | +cButton keepButton; |
---|
| 708 | + cButton twoButton; // Full 3D |
---|
| 709 | + cButton sixButton; |
---|
| 710 | + cButton threeButton; |
---|
| 711 | + cButton sevenButton; |
---|
| 712 | + cButton fourButton; // full panel |
---|
| 713 | + cButton oneButton; // full XYZ |
---|
| 714 | + //cButton currentLayout; |
---|
| 715 | + |
---|
| 716 | + boolean maximized; |
---|
| 717 | + |
---|
| 718 | + cButton fullscreenLayout; |
---|
| 719 | + |
---|
| 720 | + void Minimize() |
---|
| 721 | + { |
---|
| 722 | + frame.setState(Frame.ICONIFIED); |
---|
| 723 | + } |
---|
| 724 | + |
---|
| 725 | + void Maximize() |
---|
| 726 | + { |
---|
| 727 | + if (maximized) |
---|
| 728 | + { |
---|
| 729 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 730 | + } |
---|
| 731 | + else |
---|
| 732 | + { |
---|
| 733 | + keeprect = frame.getBounds(); |
---|
| 734 | + Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 735 | + Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 736 | + frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 737 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 738 | + } |
---|
| 739 | + |
---|
| 740 | + maximized ^= true; |
---|
| 741 | + } |
---|
| 742 | + |
---|
641 | 743 | void ToggleFullScreen() |
---|
642 | 744 | { |
---|
643 | | - if (CameraPane.FULLSCREEN) |
---|
| 745 | + cameraView.ToggleFullScreen(); |
---|
| 746 | + |
---|
| 747 | + if (!CameraPane.FULLSCREEN) |
---|
644 | 748 | { |
---|
645 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
646 | | - framePanel.add(bigThree); |
---|
647 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 749 | + device.setFullScreenWindow(null); |
---|
| 750 | + //frame.setVisible(false); |
---|
| 751 | +// frame.removeNotify(); |
---|
| 752 | +// frame.setUndecorated(false); |
---|
| 753 | +// frame.addNotify(); |
---|
| 754 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 755 | + |
---|
| 756 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 757 | +// X framePanel.add(bigThree); |
---|
| 758 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 759 | + framePanel.setDividerLocation(1); |
---|
| 760 | + |
---|
| 761 | + //frame.setVisible(true); |
---|
| 762 | + radio.layout = keepButton; |
---|
| 763 | + //theFrame = null; |
---|
| 764 | + keepButton = null; |
---|
| 765 | + radio.layout.doClick(); |
---|
| 766 | + |
---|
648 | 767 | } else |
---|
649 | 768 | { |
---|
650 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
651 | | - framePanel.remove(bigThree); |
---|
652 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 769 | + keepButton = radio.layout; |
---|
| 770 | + //keeprect = frame.getBounds(); |
---|
| 771 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 772 | +// frame.getToolkit().getScreenSize().height); |
---|
| 773 | + //frame.setVisible(false); |
---|
| 774 | + device.setFullScreenWindow(frame); |
---|
| 775 | +// frame.removeNotify(); |
---|
| 776 | +// frame.setUndecorated(true); |
---|
| 777 | +// frame.addNotify(); |
---|
| 778 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 779 | +// X framePanel.remove(bigThree); |
---|
| 780 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 781 | + framePanel.setDividerLocation(0); |
---|
| 782 | + |
---|
| 783 | + radio.layout = fullscreenLayout; |
---|
| 784 | + radio.layout.doClick(); |
---|
| 785 | + //frame.setVisible(true); |
---|
653 | 786 | } |
---|
654 | | - cameraView.ToggleFullScreen(); |
---|
655 | 787 | } |
---|
656 | 788 | |
---|
657 | 789 | private JTextPane createTextPane() |
---|
.. | .. |
---|
784 | 916 | // NumberSlider vDivsField; |
---|
785 | 917 | // JCheckBox endcaps; |
---|
786 | 918 | JCheckBox liveCB; |
---|
| 919 | + JCheckBox selectCB; |
---|
787 | 920 | JCheckBox hideCB; |
---|
788 | 921 | JCheckBox link2masterCB; |
---|
789 | 922 | JCheckBox markCB; |
---|
.. | .. |
---|
791 | 924 | JCheckBox speedupCB; |
---|
792 | 925 | JCheckBox rewindCB; |
---|
793 | 926 | JCheckBox flipVCB; |
---|
| 927 | + |
---|
| 928 | + cCheckBox toggleTextureCB; |
---|
| 929 | + cCheckBox toggleSwitchCB; |
---|
| 930 | + |
---|
794 | 931 | JComboBox texresMenu; |
---|
| 932 | + |
---|
795 | 933 | JButton resetButton; |
---|
796 | 934 | JButton stepButton; |
---|
797 | 935 | JButton stepAllButton; |
---|
.. | .. |
---|
800 | 938 | JButton fasterButton; |
---|
801 | 939 | JButton remarkButton; |
---|
802 | 940 | |
---|
| 941 | + cGridBag editPanel; |
---|
| 942 | + cGridBag editCommandsPanel; |
---|
| 943 | + |
---|
803 | 944 | cGridBag namePanel; |
---|
804 | 945 | cGridBag setupPanel; |
---|
805 | | - cGridBag commandsPanel; |
---|
| 946 | + cGridBag setupPanel2; |
---|
| 947 | + cGridBag objectCommandsPanel; |
---|
806 | 948 | cGridBag pushPanel; |
---|
807 | 949 | cGridBag fillPanel; |
---|
808 | 950 | |
---|
.. | .. |
---|
979 | 1121 | |
---|
980 | 1122 | oe.ctrlPanel.Return(); |
---|
981 | 1123 | |
---|
982 | | - if (!GroupEditor.allparams) |
---|
| 1124 | + if (!allparams) |
---|
983 | 1125 | return; |
---|
984 | 1126 | |
---|
985 | 1127 | setupPanel = new cGridBag().setVertical(false); |
---|
986 | 1128 | |
---|
987 | 1129 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
988 | 1130 | liveCB.setToolTipText("Animate object"); |
---|
| 1131 | + selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1132 | + selectCB.setToolTipText("Make object selectable"); |
---|
| 1133 | +// Return(); |
---|
989 | 1134 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
990 | 1135 | hideCB.setToolTipText("Hide object"); |
---|
991 | | -// Return(); |
---|
992 | 1136 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
993 | | - markCB.setToolTipText("Set the animation target transform"); |
---|
| 1137 | + markCB.setToolTipText("As animation target transform"); |
---|
994 | 1138 | |
---|
995 | | - rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 1139 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1140 | + |
---|
| 1141 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
996 | 1142 | rewindCB.setToolTipText("Rewind animation"); |
---|
997 | 1143 | |
---|
998 | | - randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
999 | | - randomCB.setToolTipText("Option for switch node"); |
---|
| 1144 | + randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
| 1145 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
1000 | 1146 | |
---|
1001 | 1147 | if (Globals.ADVANCED) |
---|
1002 | 1148 | { |
---|
1003 | | - link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
| 1149 | + link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
1004 | 1150 | link2masterCB.setToolTipText("Attach to support"); |
---|
1005 | | - speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 1151 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
1006 | 1152 | speedupCB.setToolTipText("Option motion capture"); |
---|
1007 | 1153 | } |
---|
1008 | 1154 | |
---|
1009 | 1155 | oe.ctrlPanel.add(setupPanel); |
---|
1010 | 1156 | oe.ctrlPanel.Return(); |
---|
| 1157 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1158 | + oe.ctrlPanel.Return(); |
---|
1011 | 1159 | |
---|
1012 | | - commandsPanel = new cGridBag().setVertical(false); |
---|
| 1160 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
1013 | 1161 | |
---|
1014 | | - resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 1162 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
1015 | 1163 | resetButton.setToolTipText("Jump to frame zero"); |
---|
1016 | | - stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1164 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
1017 | 1165 | stepButton.setToolTipText("Step one frame"); |
---|
1018 | 1166 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
1019 | 1167 | // stepAllButton = AddButton(oe, "Step All"); |
---|
1020 | 1168 | // Return(); |
---|
1021 | | - slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 1169 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
1022 | 1170 | slowerButton.setToolTipText("Decrease animation speed"); |
---|
1023 | | - fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 1171 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
1024 | 1172 | fasterButton.setToolTipText("Increase animation speed"); |
---|
1025 | | - remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1173 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
1026 | 1174 | remarkButton.setToolTipText("Set the current transform as the target"); |
---|
1027 | 1175 | |
---|
1028 | | - oe.ctrlPanel.add(commandsPanel); |
---|
| 1176 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
1029 | 1177 | oe.ctrlPanel.Return(); |
---|
1030 | 1178 | |
---|
1031 | | - pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1); |
---|
| 1179 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
1032 | 1180 | normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
1033 | 1181 | //Return(); |
---|
1034 | 1182 | |
---|
.. | .. |
---|
1231 | 1379 | //worldPanel.setName("World"); |
---|
1232 | 1380 | centralPanel = new cGridBag(); |
---|
1233 | 1381 | centralPanel.preferredWidth = 20; |
---|
1234 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1235 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1382 | + |
---|
| 1383 | + if (Globals.ADVANCED) |
---|
| 1384 | + { |
---|
| 1385 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1386 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1236 | 1387 | |
---|
1237 | 1388 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1238 | 1389 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1241 | 1392 | // cameraPanel.setDividerSize(9); |
---|
1242 | 1393 | cameraPanel.setResizeWeight(1.0); |
---|
1243 | 1394 | |
---|
| 1395 | + } |
---|
| 1396 | + |
---|
1244 | 1397 | centralPanel.add(cameraView); |
---|
| 1398 | + centralPanel.setFocusable(true); |
---|
1245 | 1399 | //frame.setJMenuBar(timelineMenubar); |
---|
1246 | 1400 | //centralPanel.add(timelinePanel); |
---|
1247 | 1401 | |
---|
.. | .. |
---|
1308 | 1462 | // north.setName("Edit"); |
---|
1309 | 1463 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1310 | 1464 | // objectPanel.add(north); |
---|
1311 | | - objectPanel.add(ctrlPanel); |
---|
| 1465 | + objectPanel.add(editPanel); |
---|
1312 | 1466 | objectPanel.add(infoPanel); |
---|
| 1467 | + objectPanel.add(toolboxPanel); |
---|
1313 | 1468 | |
---|
1314 | 1469 | /* |
---|
1315 | 1470 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1318 | 1473 | aConstraints.gridy += 1; |
---|
1319 | 1474 | aConstraints.gridwidth = 1; |
---|
1320 | 1475 | mainPanel.add(objectPanel, aConstraints); |
---|
1321 | | - */ |
---|
| 1476 | + */ |
---|
1322 | 1477 | |
---|
1323 | 1478 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1324 | 1479 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1335 | 1490 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1336 | 1491 | tabbedPane.add(scrollpane); |
---|
1337 | 1492 | |
---|
1338 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1339 | | - |
---|
1340 | | - optionsPanel = new cGridBag().setVertical(true); |
---|
| 1493 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1341 | 1494 | |
---|
1342 | 1495 | optionsPanel.setName("Options"); |
---|
1343 | 1496 | |
---|
.. | .. |
---|
1345 | 1498 | |
---|
1346 | 1499 | tabbedPane.add(optionsPanel); |
---|
1347 | 1500 | |
---|
| 1501 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1502 | + |
---|
1348 | 1503 | scenePanel.add(tabbedPane); |
---|
1349 | 1504 | |
---|
1350 | 1505 | /* |
---|
.. | .. |
---|
1437 | 1592 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1438 | 1593 | |
---|
1439 | 1594 | frame.setSize(1280, 860); |
---|
| 1595 | + |
---|
| 1596 | + frame.validate(); |
---|
1440 | 1597 | frame.setVisible(true); |
---|
1441 | 1598 | |
---|
| 1599 | + cameraView.requestFocusInWindow(); |
---|
| 1600 | + |
---|
1442 | 1601 | gridPanel.setDividerLocation(1.0); |
---|
1443 | 1602 | |
---|
1444 | 1603 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
.. | .. |
---|
1988 | 2147 | e2.printStackTrace(); |
---|
1989 | 2148 | } |
---|
1990 | 2149 | } |
---|
| 2150 | + |
---|
1991 | 2151 | LoadJMEThread loadThread; |
---|
1992 | 2152 | |
---|
1993 | 2153 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2045 | 2205 | //LoadFile0(filename, converter); |
---|
2046 | 2206 | } |
---|
2047 | 2207 | } |
---|
| 2208 | + |
---|
2048 | 2209 | LoadOBJThread loadObjThread; |
---|
2049 | 2210 | |
---|
2050 | 2211 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2123 | 2284 | |
---|
2124 | 2285 | void LoadObjFile(String fullname) |
---|
2125 | 2286 | { |
---|
2126 | | - /* |
---|
| 2287 | + System.out.println("Loading " + fullname); |
---|
| 2288 | + /**/ |
---|
2127 | 2289 | //lastFilename = fullname; |
---|
2128 | 2290 | if(loadObjThread == null) |
---|
2129 | 2291 | { |
---|
2130 | | - loadObjThread = new LoadOBJThread(); |
---|
2131 | | - loadObjThread.start(); |
---|
| 2292 | + loadObjThread = new LoadOBJThread(); |
---|
| 2293 | + loadObjThread.start(); |
---|
2132 | 2294 | } |
---|
2133 | 2295 | |
---|
2134 | 2296 | loadObjThread.add(fullname); |
---|
2135 | | - */ |
---|
| 2297 | + /**/ |
---|
2136 | 2298 | |
---|
2137 | | - System.out.println("Loading " + fullname); |
---|
2138 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2299 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2139 | 2300 | } |
---|
2140 | 2301 | |
---|
2141 | 2302 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2752 | 2913 | |
---|
2753 | 2914 | void SetMaterial(Object3D object) |
---|
2754 | 2915 | { |
---|
| 2916 | + latestObject = object; |
---|
| 2917 | + |
---|
2755 | 2918 | cMaterial mat = object.material; |
---|
2756 | 2919 | |
---|
2757 | 2920 | if (mat == null) |
---|
.. | .. |
---|
2863 | 3026 | // } |
---|
2864 | 3027 | |
---|
2865 | 3028 | /**/ |
---|
2866 | | - if (deselect) |
---|
| 3029 | + if (deselect || child == null) |
---|
2867 | 3030 | { |
---|
2868 | 3031 | //group.deselectAll(); |
---|
2869 | 3032 | //freeze = true; |
---|
2870 | 3033 | GetTree().clearSelection(); |
---|
2871 | 3034 | //freeze = false; |
---|
| 3035 | + |
---|
| 3036 | + if (child == null) |
---|
| 3037 | + { |
---|
| 3038 | + return; |
---|
| 3039 | + } |
---|
2872 | 3040 | } |
---|
2873 | 3041 | |
---|
2874 | 3042 | //group.addSelectee(child); |
---|
.. | .. |
---|
2937 | 3105 | cameraView.ToggleDL(); |
---|
2938 | 3106 | cameraView.repaint(); |
---|
2939 | 3107 | return; |
---|
2940 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3108 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2941 | 3109 | { |
---|
2942 | 3110 | cameraView.ToggleTexture(); |
---|
2943 | 3111 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
2976 | 3144 | frame.validate(); |
---|
2977 | 3145 | |
---|
2978 | 3146 | return; |
---|
2979 | | - } else if (event.getSource() == toggleSwitchItem) |
---|
| 3147 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
2980 | 3148 | { |
---|
2981 | | - cameraView.ToggleRandom(); |
---|
| 3149 | + cameraView.ToggleSwitch(); |
---|
2982 | 3150 | cameraView.repaint(); |
---|
2983 | 3151 | return; |
---|
2984 | 3152 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3006 | 3174 | } else if (event.getSource() == liveCB) |
---|
3007 | 3175 | { |
---|
3008 | 3176 | copy.live ^= true; |
---|
| 3177 | + return; |
---|
| 3178 | + } else if (event.getSource() == selectCB) |
---|
| 3179 | + { |
---|
| 3180 | + copy.dontselect ^= true; |
---|
3009 | 3181 | return; |
---|
3010 | 3182 | } else if (event.getSource() == hideCB) |
---|
3011 | 3183 | { |
---|
.. | .. |
---|
3045 | 3217 | |
---|
3046 | 3218 | public void actionPerformed(ActionEvent event) |
---|
3047 | 3219 | { |
---|
| 3220 | + Object source = event.getSource(); |
---|
3048 | 3221 | // SCRIPT DIALOG |
---|
3049 | | - if (event.getSource() == okbutton) |
---|
| 3222 | + if (source == okbutton) |
---|
3050 | 3223 | { |
---|
3051 | 3224 | textpanel.setVisible(false); |
---|
3052 | 3225 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3058 | 3231 | textarea = null; |
---|
3059 | 3232 | textpanel = null; |
---|
3060 | 3233 | } |
---|
3061 | | - if (event.getSource() == cancelbutton) |
---|
| 3234 | + if (source == cancelbutton) |
---|
3062 | 3235 | { |
---|
3063 | 3236 | textpanel.setVisible(false); |
---|
3064 | 3237 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3070 | 3243 | //applySelf(); |
---|
3071 | 3244 | //client.refreshEditWindow(); |
---|
3072 | 3245 | //refreshContents(); |
---|
3073 | | - if (event.getSource() == nameField) |
---|
| 3246 | + if (source == nameField) |
---|
3074 | 3247 | { |
---|
3075 | 3248 | //System.out.println("ObjEditor " + event); |
---|
3076 | 3249 | applySelf0(true); |
---|
3077 | 3250 | //parent.applySelf(); |
---|
3078 | 3251 | objEditor.refreshContents(); |
---|
3079 | | - } else if (event.getSource() == resetButton) |
---|
| 3252 | + } else if (source == resetButton) |
---|
3080 | 3253 | { |
---|
3081 | 3254 | CameraPane.fullreset = true; |
---|
3082 | 3255 | copy.Reset(); // ResetMeshes(); |
---|
3083 | 3256 | copy.Touch(); |
---|
3084 | 3257 | objEditor.refreshContents(); |
---|
3085 | | - } else if (event.getSource() == stepItem) |
---|
| 3258 | + } else if (source == stepItem) |
---|
3086 | 3259 | { |
---|
3087 | 3260 | //cameraView.ONESTEP = true; |
---|
3088 | 3261 | Globals.ONESTEP = true; |
---|
3089 | 3262 | cameraView.repaint(); |
---|
3090 | 3263 | return; |
---|
3091 | | - } else if (event.getSource() == stepButton) |
---|
| 3264 | + } else if (source == stepButton) |
---|
3092 | 3265 | { |
---|
3093 | 3266 | copy.Step(); |
---|
3094 | 3267 | copy.Touch(); |
---|
3095 | 3268 | objEditor.refreshContents(); |
---|
3096 | | - } else if (event.getSource() == slowerButton) |
---|
| 3269 | + } else if (source == slowerButton) |
---|
3097 | 3270 | { |
---|
3098 | 3271 | copy.Slower(); |
---|
3099 | 3272 | copy.Touch(); |
---|
3100 | 3273 | objEditor.refreshContents(); |
---|
3101 | | - } else if (event.getSource() == fasterButton) |
---|
| 3274 | + } else if (source == fasterButton) |
---|
3102 | 3275 | { |
---|
3103 | 3276 | copy.Faster(); |
---|
3104 | 3277 | copy.Touch(); |
---|
3105 | 3278 | objEditor.refreshContents(); |
---|
3106 | | - } else if (event.getSource() == remarkButton) |
---|
| 3279 | + } else if (source == remarkButton) |
---|
3107 | 3280 | { |
---|
3108 | 3281 | copy.Remark(); |
---|
3109 | 3282 | copy.Touch(); |
---|
3110 | 3283 | objEditor.refreshContents(); |
---|
3111 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3284 | + } else if (source == stepAllButton) |
---|
3112 | 3285 | { |
---|
3113 | 3286 | copy.StepAll(); |
---|
3114 | 3287 | copy.Touch(); |
---|
3115 | 3288 | objEditor.refreshContents(); |
---|
3116 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3289 | + } else if (source == resetAllButton) |
---|
3117 | 3290 | { |
---|
3118 | 3291 | //CameraPane.fullreset = true; |
---|
3119 | 3292 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3146 | 3319 | // Close(); |
---|
3147 | 3320 | // } |
---|
3148 | 3321 | // else |
---|
3149 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3322 | + if (source == resetSlidersButton) |
---|
3150 | 3323 | { |
---|
3151 | 3324 | ResetSliders(); |
---|
3152 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3325 | + } else if (source == clearMaterialButton) |
---|
3153 | 3326 | { |
---|
3154 | 3327 | ClearMaterial(); |
---|
3155 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3328 | + } else if (source == createMaterialButton) |
---|
3156 | 3329 | { |
---|
3157 | 3330 | CreateMaterial(); |
---|
3158 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3331 | + } else if (source == clearPanelButton) |
---|
3159 | 3332 | { |
---|
3160 | 3333 | copy.ClearUI(); |
---|
3161 | 3334 | refreshContents(true); |
---|
3162 | | - } /* |
---|
3163 | | - } |
---|
3164 | | - |
---|
3165 | | - public boolean action(Event event, Object arg) |
---|
3166 | | - { |
---|
3167 | | - */ else if (event.getSource() == closeItem) |
---|
| 3335 | + } else if (source == importGFDItem) |
---|
| 3336 | + { |
---|
| 3337 | + ImportGFD(); |
---|
| 3338 | + } else |
---|
| 3339 | + if (source == importVRMLX3DItem) |
---|
| 3340 | + { |
---|
| 3341 | + ImportVRMLX3D(); |
---|
| 3342 | + } else |
---|
| 3343 | + if (source == import3DSItem) |
---|
| 3344 | + { |
---|
| 3345 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3346 | + } else |
---|
| 3347 | + if (source == importOBJItem) |
---|
| 3348 | + { |
---|
| 3349 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3350 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3351 | + browser.setVisible(true); |
---|
| 3352 | + String filename = browser.getFile(); |
---|
| 3353 | + if (filename != null && filename.length() > 0) |
---|
| 3354 | + { |
---|
| 3355 | + String fullname = browser.getDirectory() + filename; |
---|
| 3356 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3357 | + } |
---|
| 3358 | + } else |
---|
| 3359 | + if (source == closeItem) |
---|
3168 | 3360 | { |
---|
3169 | 3361 | Close(); |
---|
3170 | 3362 | //return true; |
---|
3171 | | - } else if (event.getSource() == loadItem) |
---|
| 3363 | + } else if (source == loadItem) |
---|
3172 | 3364 | { |
---|
3173 | 3365 | load(); |
---|
3174 | 3366 | //return true; |
---|
3175 | | - } else if (event.getSource() == saveItem) |
---|
| 3367 | + } else if (source == newItem) |
---|
| 3368 | + { |
---|
| 3369 | + New(); |
---|
| 3370 | + } else if (source == saveItem) |
---|
3176 | 3371 | { |
---|
3177 | 3372 | save(); |
---|
3178 | 3373 | //return true; |
---|
3179 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3374 | + } else if (source == saveAsItem) |
---|
3180 | 3375 | { |
---|
3181 | 3376 | saveAs(); |
---|
3182 | 3377 | //return true; |
---|
3183 | | - } else if (event.getSource() == reexportItem) |
---|
| 3378 | + } else if (source == reexportItem) |
---|
3184 | 3379 | { |
---|
3185 | 3380 | reexport(); |
---|
3186 | 3381 | //return true; |
---|
3187 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3382 | + } else if (source == exportAsItem) |
---|
3188 | 3383 | { |
---|
3189 | 3384 | export(); |
---|
3190 | 3385 | //return true; |
---|
3191 | | - } else if (event.getSource() == povItem) |
---|
| 3386 | + } else if (source == povItem) |
---|
3192 | 3387 | { |
---|
3193 | 3388 | generatePOV(); |
---|
3194 | 3389 | //return true; |
---|
3195 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3390 | + } else if (source == zBufferItem) |
---|
3196 | 3391 | { |
---|
3197 | 3392 | try |
---|
3198 | 3393 | { |
---|
.. | .. |
---|
3214 | 3409 | cameraView.repaint(); |
---|
3215 | 3410 | //return true; |
---|
3216 | 3411 | } |
---|
3217 | | - */ else if (event.getSource() == editCameraItem) |
---|
3218 | | - { |
---|
3219 | | - cameraView.ProtectCamera(); |
---|
3220 | | - cameraView.repaint(); |
---|
3221 | | - return; |
---|
3222 | | - } else if (event.getSource() == revertCameraItem) |
---|
3223 | | - { |
---|
3224 | | - cameraView.RevertCamera(); |
---|
3225 | | - cameraView.repaint(); |
---|
3226 | | - return; |
---|
3227 | | -// } else if (event.getSource() == textureButton) |
---|
3228 | | -// { |
---|
3229 | | -// return; // true; |
---|
3230 | | - } else // combos... |
---|
3231 | | - if (event.getSource() == texresMenu) |
---|
| 3412 | + */ else // combos... |
---|
| 3413 | + if (source == texresMenu) |
---|
3232 | 3414 | { |
---|
3233 | 3415 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3234 | 3416 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3240 | 3422 | } |
---|
3241 | 3423 | } |
---|
3242 | 3424 | |
---|
| 3425 | + void New() |
---|
| 3426 | + { |
---|
| 3427 | + while (copy.Size() > 1) |
---|
| 3428 | + { |
---|
| 3429 | + copy.remove(1); |
---|
| 3430 | + } |
---|
| 3431 | + |
---|
| 3432 | + ResetModel(); |
---|
| 3433 | + objEditor.refreshContents(); |
---|
| 3434 | + } |
---|
| 3435 | + |
---|
| 3436 | + static public byte[] Compress(Object3D o) |
---|
| 3437 | + { |
---|
| 3438 | + try |
---|
| 3439 | + { |
---|
| 3440 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3441 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3442 | + ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 3443 | + |
---|
| 3444 | + Object3D parent = o.parent; |
---|
| 3445 | + o.parent = null; |
---|
| 3446 | + |
---|
| 3447 | + out.writeObject(o); |
---|
| 3448 | + |
---|
| 3449 | + o.parent = parent; |
---|
| 3450 | + |
---|
| 3451 | + out.flush(); |
---|
| 3452 | + |
---|
| 3453 | + zstream.close(); |
---|
| 3454 | + out.close(); |
---|
| 3455 | + |
---|
| 3456 | + return baos.toByteArray(); |
---|
| 3457 | + } catch (Exception e) |
---|
| 3458 | + { |
---|
| 3459 | + System.err.println(e); |
---|
| 3460 | + return null; |
---|
| 3461 | + } |
---|
| 3462 | + } |
---|
| 3463 | + |
---|
| 3464 | + static public Object Uncompress(byte[] bytes) |
---|
| 3465 | + { |
---|
| 3466 | + System.out.println("#bytes = " + bytes.length); |
---|
| 3467 | + try |
---|
| 3468 | + { |
---|
| 3469 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3470 | + java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3471 | + ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 3472 | + Object obj = in.readObject(); |
---|
| 3473 | + in.close(); |
---|
| 3474 | + |
---|
| 3475 | + return obj; |
---|
| 3476 | + } catch (Exception e) |
---|
| 3477 | + { |
---|
| 3478 | + System.err.println(e); |
---|
| 3479 | + return null; |
---|
| 3480 | + } |
---|
| 3481 | + } |
---|
| 3482 | + |
---|
| 3483 | + static public Object clone(Object o) |
---|
| 3484 | + { |
---|
| 3485 | + try |
---|
| 3486 | + { |
---|
| 3487 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3488 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3489 | + |
---|
| 3490 | + out.writeObject(o); |
---|
| 3491 | + |
---|
| 3492 | + out.flush(); |
---|
| 3493 | + out.close(); |
---|
| 3494 | + |
---|
| 3495 | + byte[] bytes = baos.toByteArray(); |
---|
| 3496 | + |
---|
| 3497 | + System.out.println("clone = " + bytes.length); |
---|
| 3498 | + |
---|
| 3499 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3500 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3501 | + Object obj = in.readObject(); |
---|
| 3502 | + in.close(); |
---|
| 3503 | + |
---|
| 3504 | + return obj; |
---|
| 3505 | + } catch (Exception e) |
---|
| 3506 | + { |
---|
| 3507 | + System.err.println(e); |
---|
| 3508 | + return null; |
---|
| 3509 | + } |
---|
| 3510 | + } |
---|
| 3511 | + |
---|
| 3512 | + cRadio GetCurrentTab() |
---|
| 3513 | + { |
---|
| 3514 | + cRadio ab; |
---|
| 3515 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3516 | + { |
---|
| 3517 | + ab = (cRadio)e.nextElement(); |
---|
| 3518 | + if(ab.GetObject() == copy) |
---|
| 3519 | + { |
---|
| 3520 | + return ab; |
---|
| 3521 | + } |
---|
| 3522 | + } |
---|
| 3523 | + |
---|
| 3524 | + return null; |
---|
| 3525 | + } |
---|
| 3526 | + |
---|
| 3527 | + java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3528 | + |
---|
| 3529 | + public void Save() |
---|
| 3530 | + { |
---|
| 3531 | + System.err.println("Save"); |
---|
| 3532 | + |
---|
| 3533 | + cRadio tab = GetCurrentTab(); |
---|
| 3534 | + |
---|
| 3535 | + boolean temp = CameraPane.SWITCH; |
---|
| 3536 | + CameraPane.SWITCH = false; |
---|
| 3537 | + |
---|
| 3538 | + copy.ExtractBigData(hashtable); |
---|
| 3539 | + |
---|
| 3540 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3541 | + tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3542 | + |
---|
| 3543 | + copy.RestoreBigData(hashtable); |
---|
| 3544 | + |
---|
| 3545 | + CameraPane.SWITCH = temp; |
---|
| 3546 | + |
---|
| 3547 | + //assert(hashtable.isEmpty()); |
---|
| 3548 | + |
---|
| 3549 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3550 | + { |
---|
| 3551 | + tab.graphs[i] = null; |
---|
| 3552 | + } |
---|
| 3553 | + |
---|
| 3554 | + SetUndoStates(); |
---|
| 3555 | + |
---|
| 3556 | + // test save |
---|
| 3557 | + if (false) |
---|
| 3558 | + { |
---|
| 3559 | + try |
---|
| 3560 | + { |
---|
| 3561 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3562 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3563 | + |
---|
| 3564 | + p.writeObject(copy); |
---|
| 3565 | + |
---|
| 3566 | + p.flush(); |
---|
| 3567 | + |
---|
| 3568 | + ostream.close(); |
---|
| 3569 | + } catch (Exception e) |
---|
| 3570 | + { |
---|
| 3571 | + e.printStackTrace(); |
---|
| 3572 | + } |
---|
| 3573 | + } |
---|
| 3574 | + } |
---|
| 3575 | + |
---|
| 3576 | + void CopyChanged(Object3D obj) |
---|
| 3577 | + { |
---|
| 3578 | + SetUndoStates(); |
---|
| 3579 | + |
---|
| 3580 | + boolean temp = CameraPane.SWITCH; |
---|
| 3581 | + CameraPane.SWITCH = false; |
---|
| 3582 | + |
---|
| 3583 | + copy.ExtractBigData(hashtable); |
---|
| 3584 | + |
---|
| 3585 | + copy.clear(); |
---|
| 3586 | + |
---|
| 3587 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3588 | + { |
---|
| 3589 | + copy.add(obj.get(i)); |
---|
| 3590 | + } |
---|
| 3591 | + |
---|
| 3592 | + copy.RestoreBigData(hashtable); |
---|
| 3593 | + |
---|
| 3594 | + CameraPane.SWITCH = temp; |
---|
| 3595 | + |
---|
| 3596 | + //assert(hashtable.isEmpty()); |
---|
| 3597 | + |
---|
| 3598 | + copy.Touch(); |
---|
| 3599 | + |
---|
| 3600 | + ResetModel(); |
---|
| 3601 | + copy.HardTouch(); // recompile? |
---|
| 3602 | + |
---|
| 3603 | + cRadio ab; |
---|
| 3604 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3605 | + { |
---|
| 3606 | + ab = (cRadio)e.nextElement(); |
---|
| 3607 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3608 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3609 | + if (test != null) |
---|
| 3610 | + { |
---|
| 3611 | + test.editWindow = ab.object.editWindow; |
---|
| 3612 | + ab.object = test; |
---|
| 3613 | + } |
---|
| 3614 | + } |
---|
| 3615 | + |
---|
| 3616 | + refreshContents(); |
---|
| 3617 | + } |
---|
| 3618 | + |
---|
| 3619 | + cButton undoButton; |
---|
| 3620 | + cButton redoButton; |
---|
| 3621 | + |
---|
| 3622 | + void SetUndoStates() |
---|
| 3623 | + { |
---|
| 3624 | + cRadio tab = GetCurrentTab(); |
---|
| 3625 | + |
---|
| 3626 | + undoButton.setEnabled(tab.undoindex > 0); |
---|
| 3627 | + redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null); |
---|
| 3628 | + } |
---|
| 3629 | + |
---|
| 3630 | + public void Undo() |
---|
| 3631 | + { |
---|
| 3632 | + System.err.println("Undo"); |
---|
| 3633 | + |
---|
| 3634 | + cRadio tab = GetCurrentTab(); |
---|
| 3635 | + |
---|
| 3636 | + if (tab.undoindex == 0) |
---|
| 3637 | + { |
---|
| 3638 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3639 | + return; |
---|
| 3640 | + } |
---|
| 3641 | + |
---|
| 3642 | + if (tab.graphs[tab.undoindex] == null) |
---|
| 3643 | + { |
---|
| 3644 | + Save(); |
---|
| 3645 | + tab.undoindex -= 1; |
---|
| 3646 | + } |
---|
| 3647 | + |
---|
| 3648 | + tab.undoindex -= 1; |
---|
| 3649 | + |
---|
| 3650 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3651 | + } |
---|
| 3652 | + |
---|
| 3653 | + public void Redo() |
---|
| 3654 | + { |
---|
| 3655 | + cRadio tab = GetCurrentTab(); |
---|
| 3656 | + |
---|
| 3657 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3658 | + { |
---|
| 3659 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3660 | + return; |
---|
| 3661 | + } |
---|
| 3662 | + |
---|
| 3663 | + tab.undoindex += 1; |
---|
| 3664 | + |
---|
| 3665 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3666 | + } |
---|
| 3667 | + |
---|
| 3668 | + void ImportGFD() |
---|
| 3669 | + { |
---|
| 3670 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
| 3671 | + browser.show(); |
---|
| 3672 | + String filename = browser.getFile(); |
---|
| 3673 | + if (filename != null && filename.length() > 0) |
---|
| 3674 | + { |
---|
| 3675 | + String fullname = browser.getDirectory() + filename; |
---|
| 3676 | + |
---|
| 3677 | + //Object3D readobj = |
---|
| 3678 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3679 | + //makeSomething(readobj); |
---|
| 3680 | + } |
---|
| 3681 | + } |
---|
| 3682 | + |
---|
| 3683 | + void ImportVRMLX3D() |
---|
| 3684 | + { |
---|
| 3685 | + if (Grafreed.standAlone) |
---|
| 3686 | + { |
---|
| 3687 | + /**/ |
---|
| 3688 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3689 | + browser.show(); |
---|
| 3690 | + String filename = browser.getFile(); |
---|
| 3691 | + if (filename != null && filename.length() > 0) |
---|
| 3692 | + { |
---|
| 3693 | + String fullname = browser.getDirectory() + filename; |
---|
| 3694 | + LoadVRMLX3D(fullname); |
---|
| 3695 | + } |
---|
| 3696 | + /**/ |
---|
| 3697 | + } |
---|
| 3698 | + } |
---|
| 3699 | + |
---|
3243 | 3700 | void ToggleAnimation() |
---|
3244 | 3701 | { |
---|
3245 | 3702 | if (!Globals.ANIMATION) |
---|
.. | .. |
---|
3357 | 3814 | assert false; |
---|
3358 | 3815 | } |
---|
3359 | 3816 | |
---|
3360 | | - void EditSelection() |
---|
| 3817 | + void EditSelection(boolean newWindow) |
---|
3361 | 3818 | { |
---|
3362 | 3819 | } |
---|
3363 | 3820 | |
---|
.. | .. |
---|
3588 | 4045 | } |
---|
3589 | 4046 | |
---|
3590 | 4047 | if (normalpushField != null) |
---|
3591 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 4048 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3592 | 4049 | } |
---|
3593 | 4050 | |
---|
3594 | 4051 | void SnapObject() |
---|
.. | .. |
---|
3852 | 4309 | |
---|
3853 | 4310 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3854 | 4311 | { |
---|
| 4312 | + if (Globals.SAVEONMAKE) // && resetmodel) |
---|
| 4313 | + Save(); |
---|
3855 | 4314 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3856 | 4315 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3857 | 4316 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3938 | 4397 | { |
---|
3939 | 4398 | ResetModel(); |
---|
3940 | 4399 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4400 | + |
---|
| 4401 | + if (thing.Size() == 0) |
---|
| 4402 | + { |
---|
| 4403 | + //EditSelection(false); |
---|
| 4404 | + } |
---|
| 4405 | + |
---|
3941 | 4406 | refreshContents(); |
---|
3942 | 4407 | } |
---|
3943 | 4408 | |
---|
.. | .. |
---|
4055 | 4520 | } |
---|
4056 | 4521 | } |
---|
4057 | 4522 | } |
---|
| 4523 | + |
---|
4058 | 4524 | LoadGFDThread loadGFDThread; |
---|
4059 | 4525 | |
---|
4060 | 4526 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4074 | 4540 | |
---|
4075 | 4541 | try |
---|
4076 | 4542 | { |
---|
| 4543 | + // Try compressed version first. |
---|
4077 | 4544 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4078 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4545 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4546 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4079 | 4547 | |
---|
4080 | 4548 | readobj = (Object3D) p.readObject(); |
---|
4081 | 4549 | istream.close(); |
---|
.. | .. |
---|
4083 | 4551 | readobj.ResetDisplayList(); |
---|
4084 | 4552 | } catch (Exception e) |
---|
4085 | 4553 | { |
---|
4086 | | - e.printStackTrace(); |
---|
| 4554 | + //e.printStackTrace(); |
---|
| 4555 | + try |
---|
| 4556 | + { |
---|
| 4557 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4558 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4559 | + |
---|
| 4560 | + readobj = (Object3D) p.readObject(); |
---|
| 4561 | + istream.close(); |
---|
| 4562 | + |
---|
| 4563 | + readobj.ResetDisplayList(); |
---|
| 4564 | + } catch (Exception e2) |
---|
| 4565 | + { |
---|
| 4566 | + e2.printStackTrace(); |
---|
| 4567 | + } |
---|
4087 | 4568 | } |
---|
4088 | 4569 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4089 | 4570 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4129 | 4610 | |
---|
4130 | 4611 | void LoadIt(Object obj) |
---|
4131 | 4612 | { |
---|
| 4613 | + if (obj == null) |
---|
| 4614 | + { |
---|
| 4615 | + // Invalid file |
---|
| 4616 | + return; |
---|
| 4617 | + } |
---|
| 4618 | + |
---|
4132 | 4619 | System.out.println("Loaded " + obj); |
---|
4133 | 4620 | //new Exception().printStackTrace(); |
---|
4134 | 4621 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4138 | 4625 | |
---|
4139 | 4626 | if (readobj != null) |
---|
4140 | 4627 | { |
---|
| 4628 | + if (Globals.SAVEONMAKE) |
---|
| 4629 | + Save(); |
---|
4141 | 4630 | try |
---|
4142 | 4631 | { |
---|
4143 | 4632 | //readobj.deepCopySelf(copy); |
---|
.. | .. |
---|
4287 | 4776 | try |
---|
4288 | 4777 | { |
---|
4289 | 4778 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4290 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4779 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4780 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4291 | 4781 | |
---|
4292 | 4782 | p.writeObject(copy); |
---|
4293 | 4783 | p.flush(); |
---|
4294 | 4784 | |
---|
| 4785 | + zstream.close(); |
---|
4295 | 4786 | ostream.close(); |
---|
4296 | 4787 | |
---|
4297 | 4788 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4301 | 4792 | { |
---|
4302 | 4793 | } |
---|
4303 | 4794 | } |
---|
| 4795 | + |
---|
4304 | 4796 | String lastname; |
---|
4305 | 4797 | |
---|
4306 | 4798 | void saveAs() |
---|
.. | .. |
---|
4312 | 4804 | String filename = browser.getFile(); |
---|
4313 | 4805 | if (filename != null && filename.length() > 0) |
---|
4314 | 4806 | { |
---|
| 4807 | + if (!filename.endsWith(".gfd")) |
---|
| 4808 | + filename += ".gfd"; |
---|
4315 | 4809 | lastname = browser.getDirectory() + filename; |
---|
4316 | 4810 | save(); |
---|
4317 | 4811 | } |
---|
.. | .. |
---|
4410 | 4904 | try |
---|
4411 | 4905 | { |
---|
4412 | 4906 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4413 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4414 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 4907 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4908 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4415 | 4909 | |
---|
4416 | 4910 | Object3D objectparent = obj.parent; |
---|
4417 | 4911 | obj.parent = null; |
---|
.. | .. |
---|
4428 | 4922 | p.writeObject(object); |
---|
4429 | 4923 | p.flush(); |
---|
4430 | 4924 | |
---|
| 4925 | + zstream.close(); |
---|
4431 | 4926 | ostream.close(); |
---|
4432 | | - // zstream.close(); |
---|
4433 | 4927 | |
---|
4434 | 4928 | // group.selection.get(0).parent = parent; |
---|
4435 | 4929 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4476 | 4970 | Object3D client; |
---|
4477 | 4971 | Object3D copy; |
---|
4478 | 4972 | MenuBar menuBar; |
---|
4479 | | - Menu windowMenu; |
---|
| 4973 | + Menu fileMenu; |
---|
| 4974 | + MenuItem newItem; |
---|
4480 | 4975 | MenuItem loadItem; |
---|
4481 | 4976 | MenuItem saveItem; |
---|
4482 | 4977 | MenuItem saveAsItem; |
---|
.. | .. |
---|
4484 | 4979 | MenuItem reexportItem; |
---|
4485 | 4980 | MenuItem povItem; |
---|
4486 | 4981 | MenuItem closeItem; |
---|
4487 | | - Menu cameraMenu; |
---|
| 4982 | + |
---|
4488 | 4983 | CheckboxMenuItem zBufferItem; |
---|
4489 | 4984 | //MenuItem normalLensItem; |
---|
4490 | | - MenuItem editCameraItem; |
---|
4491 | | - MenuItem revertCameraItem; |
---|
4492 | 4985 | MenuItem stepItem; |
---|
4493 | 4986 | CheckboxMenuItem toggleLiveItem; |
---|
4494 | 4987 | CheckboxMenuItem toggleFullScreenItem; |
---|
.. | .. |
---|
4506 | 4999 | CheckboxMenuItem togglePaintItem; |
---|
4507 | 5000 | JSplitPane mainPanel; |
---|
4508 | 5001 | JScrollPane scrollpane; |
---|
| 5002 | + |
---|
4509 | 5003 | JPanel toolbarPanel; |
---|
| 5004 | + |
---|
4510 | 5005 | cGridBag treePanel; |
---|
| 5006 | + |
---|
4511 | 5007 | JPanel radioPanel; |
---|
4512 | 5008 | ButtonGroup buttonGroup; |
---|
4513 | | - cGridBag ctrlPanel; |
---|
| 5009 | + |
---|
| 5010 | + cGridBag toolboxPanel; |
---|
4514 | 5011 | cGridBag materialPanel; |
---|
| 5012 | + cGridBag ctrlPanel; |
---|
| 5013 | + |
---|
4515 | 5014 | JScrollPane infoPanel; |
---|
| 5015 | + |
---|
4516 | 5016 | cGridBag optionsPanel; |
---|
| 5017 | + |
---|
4517 | 5018 | JTabbedPane objectPanel; |
---|
| 5019 | + boolean materialFlushed; |
---|
| 5020 | + Object3D latestObject; |
---|
| 5021 | + |
---|
4518 | 5022 | cGridBag XYZPanel; |
---|
| 5023 | + |
---|
4519 | 5024 | JSplitPane gridPanel; |
---|
4520 | 5025 | JSplitPane bigPanel; |
---|
| 5026 | + |
---|
4521 | 5027 | cGridBag bigThree; |
---|
4522 | 5028 | cGridBag scenePanel; |
---|
4523 | 5029 | cGridBag centralPanel; |
---|
.. | .. |
---|
4632 | 5138 | cNumberSlider fogField; |
---|
4633 | 5139 | JLabel opacityPowerLabel; |
---|
4634 | 5140 | cNumberSlider opacityPowerField; |
---|
4635 | | - JTree jTree; |
---|
| 5141 | + cTree jTree; |
---|
4636 | 5142 | //ObjectUI parent; |
---|
4637 | 5143 | |
---|
4638 | 5144 | cNumberSlider normalpushField; |
---|
| 5145 | + |
---|
| 5146 | + private MenuItem importGFDItem; |
---|
| 5147 | + private MenuItem importVRMLX3DItem; |
---|
| 5148 | + private MenuItem import3DSItem; |
---|
| 5149 | + private MenuItem importOBJItem; |
---|
4639 | 5150 | } |
---|