.. | .. |
---|
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 | |
---|
.. | .. |
---|
143 | 208 | //nameField.removeActionListener(this); |
---|
144 | 209 | // objEditor.ctrlPanel.remove(nameField); |
---|
145 | 210 | |
---|
146 | | - if (!GroupEditor.allparams) |
---|
| 211 | + objEditor.ctrlPanel.remove(namePanel); |
---|
| 212 | + |
---|
| 213 | + if (!allparams) |
---|
147 | 214 | return; |
---|
148 | 215 | |
---|
149 | 216 | // objEditor.ctrlPanel.remove(liveCB); |
---|
.. | .. |
---|
165 | 232 | // objEditor.ctrlPanel.remove(fasterButton); |
---|
166 | 233 | // objEditor.ctrlPanel.remove(remarkButton); |
---|
167 | 234 | |
---|
168 | | - objEditor.ctrlPanel.remove(namePanel); |
---|
169 | 235 | objEditor.ctrlPanel.remove(setupPanel); |
---|
170 | | - objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 236 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 237 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
171 | 238 | objEditor.ctrlPanel.remove(pushPanel); |
---|
172 | 239 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
173 | 240 | |
---|
.. | .. |
---|
242 | 309 | //localCopy.parent = null; |
---|
243 | 310 | |
---|
244 | 311 | frame = new JFrame(); |
---|
| 312 | + frame.setUndecorated(true); |
---|
245 | 313 | objEditor = this; |
---|
246 | 314 | this.callee = callee; |
---|
247 | 315 | |
---|
.. | .. |
---|
272 | 340 | return frame.action(event, obj); |
---|
273 | 341 | } |
---|
274 | 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 | + |
---|
275 | 348 | void SetupMenu() |
---|
276 | 349 | { |
---|
277 | 350 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
278 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
279 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
280 | | - windowMenu.add("-"); |
---|
281 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
282 | | - 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...")); |
---|
283 | 371 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
284 | | - windowMenu.add("-"); |
---|
285 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
286 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
287 | | - windowMenu.add("-"); |
---|
| 372 | + fileMenu.add("-"); |
---|
| 373 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 374 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 375 | + fileMenu.add("-"); |
---|
288 | 376 | if (client.parent != null) |
---|
289 | 377 | { |
---|
290 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 378 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
291 | 379 | } else |
---|
292 | 380 | { |
---|
293 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 381 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
294 | 382 | } |
---|
295 | 383 | |
---|
| 384 | + newItem.addActionListener(this); |
---|
296 | 385 | loadItem.addActionListener(this); |
---|
297 | 386 | saveItem.addActionListener(this); |
---|
298 | 387 | saveAsItem.addActionListener(this); |
---|
.. | .. |
---|
301 | 390 | //povItem.addActionListener(this); |
---|
302 | 391 | closeItem.addActionListener(this); |
---|
303 | 392 | |
---|
304 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
305 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
306 | | - //zBufferItem.addActionListener(this); |
---|
307 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
308 | | - //normalLensItem.addActionListener(this); |
---|
309 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
310 | | - revertCameraItem.addActionListener(this); |
---|
311 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
312 | | - toggleTimelineItem.addItemListener(this); |
---|
313 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
314 | | - toggleFullScreenItem.addItemListener(this); |
---|
315 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
316 | | - cameraMenu.add("-"); |
---|
317 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
318 | | - toggleTextureItem.addItemListener(this); |
---|
319 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
320 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
321 | | - toggleLiveItem.addItemListener(this); |
---|
322 | | - toggleLiveItem.setState(Globals.isLIVE()); |
---|
323 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
324 | | - stepItem.addActionListener(this); |
---|
325 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
326 | | -// toggleDLItem.addItemListener(this); |
---|
327 | | -// toggleDLItem.setState(false); |
---|
328 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
329 | | - toggleRenderItem.addItemListener(this); |
---|
330 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
331 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
332 | | - toggleDebugItem.addItemListener(this); |
---|
333 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
334 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
335 | | - toggleFrustumItem.addItemListener(this); |
---|
336 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
337 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
338 | | - toggleFootContactItem.addItemListener(this); |
---|
339 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
340 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
341 | | - toggleRandomItem.addItemListener(this); |
---|
342 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
343 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
344 | | - toggleHandleItem.addItemListener(this); |
---|
345 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
346 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
347 | | - togglePaintItem.addItemListener(this); |
---|
348 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
349 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
350 | | -// toggleRootItem.addItemListener(this); |
---|
351 | | -// toggleRootItem.setState(false); |
---|
352 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
353 | | -// animationItem.addItemListener(this); |
---|
354 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
355 | | - cameraMenu.add("-"); |
---|
356 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
357 | | - editCameraItem.addActionListener(this); |
---|
358 | | - |
---|
359 | 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 | + |
---|
360 | 420 | toolbarPanel = new JPanel(); |
---|
361 | 421 | toolbarPanel.setName("Toolbar"); |
---|
362 | 422 | treePanel = new cGridBag(); |
---|
363 | 423 | treePanel.setName("Tree"); |
---|
| 424 | + |
---|
| 425 | + editPanel = new cGridBag().setVertical(true); |
---|
| 426 | + editPanel.setName("Edit"); |
---|
| 427 | + |
---|
364 | 428 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
365 | | - 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 | + |
---|
366 | 437 | materialPanel = new cGridBag().setVertical(true); |
---|
367 | 438 | materialPanel.setName("Material"); |
---|
| 439 | + |
---|
368 | 440 | /*JTextPane*/ |
---|
369 | 441 | infoarea = createTextPane(); |
---|
370 | 442 | doc = infoarea.getStyledDocument(); |
---|
.. | .. |
---|
377 | 449 | // TEXTAREA infoarea.setLineWrap(true); |
---|
378 | 450 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
379 | 451 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
380 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
| 452 | + //infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
381 | 453 | infoPanel.setName("Info"); |
---|
382 | 454 | //infoPanel.setLayout(new BorderLayout()); |
---|
383 | 455 | //infoPanel.add(createTextPane()); |
---|
.. | .. |
---|
389 | 461 | mainPanel.setDividerSize(9); |
---|
390 | 462 | mainPanel.setDividerLocation(0.5); //1.0); |
---|
391 | 463 | mainPanel.setResizeWeight(0.5); |
---|
392 | | - |
---|
| 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 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 471 | + |
---|
393 | 472 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
394 | 473 | //mainPanel.setLayout(new GridBagLayout()); |
---|
395 | 474 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
.. | .. |
---|
457 | 536 | e.printStackTrace(); |
---|
458 | 537 | } |
---|
459 | 538 | |
---|
460 | | - String selection = infoarea.getText(); |
---|
461 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
462 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
463 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 539 | +// String selection = infoarea.getText(); |
---|
| 540 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 541 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 542 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
464 | 543 | //clipboard.setContents(data, data); |
---|
465 | 544 | } |
---|
466 | 545 | |
---|
.. | .. |
---|
483 | 562 | //SendInfo("Name:", "bold"); |
---|
484 | 563 | if (sel.GetTextures() != null || debug) |
---|
485 | 564 | { |
---|
486 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 565 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
487 | 566 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
488 | 567 | if (sel.Size() > 0) |
---|
489 | 568 | { |
---|
490 | 569 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
491 | 570 | } |
---|
492 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 571 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
493 | 572 | if (debug) |
---|
494 | 573 | { |
---|
495 | 574 | try |
---|
.. | .. |
---|
531 | 610 | } |
---|
532 | 611 | if (sel.support != null) |
---|
533 | 612 | { |
---|
534 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 613 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
535 | 614 | } |
---|
536 | 615 | if (sel.scriptnode != null) |
---|
537 | 616 | { |
---|
.. | .. |
---|
620 | 699 | } |
---|
621 | 700 | } |
---|
622 | 701 | |
---|
| 702 | +static GraphicsDevice device = GraphicsEnvironment |
---|
| 703 | + .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 704 | + |
---|
| 705 | + Rectangle keeprect; |
---|
| 706 | + cRadio radio; |
---|
| 707 | + |
---|
| 708 | +cButton keepButton; |
---|
| 709 | + cButton twoButton; // Full 3D |
---|
| 710 | + cButton sixButton; |
---|
| 711 | + cButton threeButton; |
---|
| 712 | + cButton sevenButton; |
---|
| 713 | + cButton fourButton; // full panel |
---|
| 714 | + cButton oneButton; // full XYZ |
---|
| 715 | + //cButton currentLayout; |
---|
| 716 | + |
---|
| 717 | + boolean maximized; |
---|
| 718 | + |
---|
| 719 | + cButton fullscreenLayout; |
---|
| 720 | + |
---|
| 721 | + void Minimize() |
---|
| 722 | + { |
---|
| 723 | + frame.setState(Frame.ICONIFIED); |
---|
| 724 | + frame.validate(); |
---|
| 725 | + } |
---|
| 726 | + |
---|
| 727 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 728 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 729 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
| 730 | + void Maximize() |
---|
| 731 | + { |
---|
| 732 | + if (CameraPane.FULLSCREEN) |
---|
| 733 | + { |
---|
| 734 | + ToggleFullScreen(); |
---|
| 735 | + } |
---|
| 736 | + |
---|
| 737 | + if (maximized) |
---|
| 738 | + { |
---|
| 739 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 740 | + } |
---|
| 741 | + else |
---|
| 742 | + { |
---|
| 743 | + keeprect = frame.getBounds(); |
---|
| 744 | + Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 745 | + Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 746 | + frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 747 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 748 | + } |
---|
| 749 | + |
---|
| 750 | + maximized ^= true; |
---|
| 751 | + |
---|
| 752 | + frame.validate(); |
---|
| 753 | + } |
---|
| 754 | + |
---|
| 755 | + cButton minButton; |
---|
| 756 | + cButton maxButton; |
---|
| 757 | + cButton fullButton; |
---|
| 758 | + |
---|
623 | 759 | void ToggleFullScreen() |
---|
624 | 760 | { |
---|
625 | | - if (CameraPane.FULLSCREEN) |
---|
| 761 | + cameraView.ToggleFullScreen(); |
---|
| 762 | + |
---|
| 763 | + if (!CameraPane.FULLSCREEN) |
---|
626 | 764 | { |
---|
627 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
628 | | - framePanel.add(bigThree); |
---|
629 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 765 | + device.setFullScreenWindow(null); |
---|
| 766 | + frame.validate(); |
---|
| 767 | + |
---|
| 768 | + //frame.setVisible(false); |
---|
| 769 | +// frame.removeNotify(); |
---|
| 770 | +// frame.setUndecorated(false); |
---|
| 771 | +// frame.addNotify(); |
---|
| 772 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 773 | + |
---|
| 774 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 775 | +// X framePanel.add(bigThree); |
---|
| 776 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 777 | + framePanel.setDividerLocation(1); |
---|
| 778 | + |
---|
| 779 | + //frame.setVisible(true); |
---|
| 780 | + radio.layout = keepButton; |
---|
| 781 | + //theFrame = null; |
---|
| 782 | + keepButton = null; |
---|
| 783 | + radio.layout.doClick(); |
---|
| 784 | + |
---|
630 | 785 | } else |
---|
631 | 786 | { |
---|
632 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
633 | | - framePanel.remove(bigThree); |
---|
634 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 787 | + keepButton = radio.layout; |
---|
| 788 | + //keeprect = frame.getBounds(); |
---|
| 789 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 790 | +// frame.getToolkit().getScreenSize().height); |
---|
| 791 | + //frame.setVisible(false); |
---|
| 792 | + device.setFullScreenWindow(frame); |
---|
| 793 | + frame.validate(); |
---|
| 794 | +// frame.removeNotify(); |
---|
| 795 | +// frame.setUndecorated(true); |
---|
| 796 | +// frame.addNotify(); |
---|
| 797 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 798 | +// X framePanel.remove(bigThree); |
---|
| 799 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 800 | + framePanel.setDividerLocation(0); |
---|
| 801 | + |
---|
| 802 | + radio.layout = fullscreenLayout; |
---|
| 803 | + radio.layout.doClick(); |
---|
| 804 | + //frame.setVisible(true); |
---|
635 | 805 | } |
---|
636 | | - cameraView.ToggleFullScreen(); |
---|
| 806 | + frame.validate(); |
---|
637 | 807 | } |
---|
638 | 808 | |
---|
639 | 809 | private JTextPane createTextPane() |
---|
.. | .. |
---|
734 | 904 | protected static ImageIcon createImageIcon(String path, |
---|
735 | 905 | String description) |
---|
736 | 906 | { |
---|
737 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 907 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
738 | 908 | if (imgURL != null) |
---|
739 | 909 | { |
---|
740 | 910 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
766 | 936 | // NumberSlider vDivsField; |
---|
767 | 937 | // JCheckBox endcaps; |
---|
768 | 938 | JCheckBox liveCB; |
---|
| 939 | + JCheckBox selectCB; |
---|
769 | 940 | JCheckBox hideCB; |
---|
770 | 941 | JCheckBox link2masterCB; |
---|
771 | 942 | JCheckBox markCB; |
---|
.. | .. |
---|
773 | 944 | JCheckBox speedupCB; |
---|
774 | 945 | JCheckBox rewindCB; |
---|
775 | 946 | JCheckBox flipVCB; |
---|
| 947 | + |
---|
| 948 | + cCheckBox toggleTextureCB; |
---|
| 949 | + cCheckBox toggleSwitchCB; |
---|
| 950 | + |
---|
776 | 951 | JComboBox texresMenu; |
---|
| 952 | + |
---|
777 | 953 | JButton resetButton; |
---|
778 | 954 | JButton stepButton; |
---|
779 | 955 | JButton stepAllButton; |
---|
.. | .. |
---|
782 | 958 | JButton fasterButton; |
---|
783 | 959 | JButton remarkButton; |
---|
784 | 960 | |
---|
| 961 | + cGridBag editPanel; |
---|
| 962 | + cGridBag editCommandsPanel; |
---|
| 963 | + |
---|
785 | 964 | cGridBag namePanel; |
---|
786 | 965 | cGridBag setupPanel; |
---|
787 | | - cGridBag commandsPanel; |
---|
| 966 | + cGridBag setupPanel2; |
---|
| 967 | + cGridBag objectCommandsPanel; |
---|
788 | 968 | cGridBag pushPanel; |
---|
789 | 969 | cGridBag fillPanel; |
---|
790 | 970 | |
---|
.. | .. |
---|
951 | 1131 | |
---|
952 | 1132 | void SetupUI2(ObjEditor oe) |
---|
953 | 1133 | { |
---|
954 | | -// oe.aConstraints.weightx = 0; |
---|
955 | | -// oe.aConstraints.weighty = 0; |
---|
956 | | -// oe.aConstraints.gridx = 0; |
---|
957 | | -// oe.aConstraints.gridy = 0; |
---|
958 | 1134 | //SetupName(oe); |
---|
959 | 1135 | |
---|
960 | 1136 | namePanel = new cGridBag(); |
---|
961 | 1137 | |
---|
962 | 1138 | nameField = AddText(namePanel, copy.GetName()); |
---|
963 | | - namePanel.add(nameField); |
---|
| 1139 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
964 | 1140 | oe.ctrlPanel.add(namePanel); |
---|
965 | 1141 | |
---|
966 | 1142 | oe.ctrlPanel.Return(); |
---|
967 | 1143 | |
---|
968 | | - if (!GroupEditor.allparams) |
---|
| 1144 | + if (!allparams) |
---|
969 | 1145 | return; |
---|
970 | 1146 | |
---|
971 | 1147 | setupPanel = new cGridBag().setVertical(false); |
---|
972 | 1148 | |
---|
973 | 1149 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
974 | | - link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master); |
---|
975 | | - hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1150 | + liveCB.setToolTipText("Animate object"); |
---|
| 1151 | + selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1152 | + selectCB.setToolTipText("Make object selectable"); |
---|
976 | 1153 | // Return(); |
---|
| 1154 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1155 | + hideCB.setToolTipText("Hide object"); |
---|
977 | 1156 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
978 | | - rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind); |
---|
979 | | - randomCB = AddCheckBox(setupPanel, "Rand", copy.random); |
---|
| 1157 | + markCB.setToolTipText("As animation target transform"); |
---|
| 1158 | + |
---|
| 1159 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1160 | + |
---|
| 1161 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1162 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1163 | + |
---|
| 1164 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1165 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
980 | 1166 | |
---|
| 1167 | + if (Globals.ADVANCED) |
---|
| 1168 | + { |
---|
| 1169 | + link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
| 1170 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1171 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1172 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1173 | + } |
---|
| 1174 | + |
---|
981 | 1175 | oe.ctrlPanel.add(setupPanel); |
---|
982 | 1176 | oe.ctrlPanel.Return(); |
---|
| 1177 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1178 | + oe.ctrlPanel.Return(); |
---|
983 | 1179 | |
---|
984 | | - commandsPanel = new cGridBag().setVertical(false); |
---|
| 1180 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
985 | 1181 | |
---|
986 | | - resetButton = AddButton(commandsPanel, "Reset"); |
---|
987 | | - stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1182 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1183 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1184 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1185 | + stepButton.setToolTipText("Step one frame"); |
---|
988 | 1186 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
989 | 1187 | // stepAllButton = AddButton(oe, "Step All"); |
---|
990 | | - speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup); |
---|
991 | 1188 | // Return(); |
---|
992 | | - slowerButton = AddButton(commandsPanel, "Slow"); |
---|
993 | | - fasterButton = AddButton(commandsPanel, "Fast"); |
---|
994 | | - remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1189 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1190 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1191 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1192 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1193 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1194 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
995 | 1195 | |
---|
996 | | - oe.ctrlPanel.add(commandsPanel); |
---|
| 1196 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
997 | 1197 | oe.ctrlPanel.Return(); |
---|
998 | 1198 | |
---|
999 | | - pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1); |
---|
| 1199 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
1000 | 1200 | normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
1001 | 1201 | //Return(); |
---|
1002 | 1202 | |
---|
.. | .. |
---|
1199 | 1399 | //worldPanel.setName("World"); |
---|
1200 | 1400 | centralPanel = new cGridBag(); |
---|
1201 | 1401 | centralPanel.preferredWidth = 20; |
---|
1202 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1203 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1402 | + |
---|
| 1403 | + if (Globals.ADVANCED) |
---|
| 1404 | + { |
---|
| 1405 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1406 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1204 | 1407 | |
---|
1205 | 1408 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1206 | 1409 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1209 | 1412 | // cameraPanel.setDividerSize(9); |
---|
1210 | 1413 | cameraPanel.setResizeWeight(1.0); |
---|
1211 | 1414 | |
---|
| 1415 | + } |
---|
| 1416 | + |
---|
1212 | 1417 | centralPanel.add(cameraView); |
---|
| 1418 | + centralPanel.setFocusable(true); |
---|
1213 | 1419 | //frame.setJMenuBar(timelineMenubar); |
---|
1214 | 1420 | //centralPanel.add(timelinePanel); |
---|
1215 | 1421 | |
---|
.. | .. |
---|
1276 | 1482 | // north.setName("Edit"); |
---|
1277 | 1483 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1278 | 1484 | // objectPanel.add(north); |
---|
1279 | | - objectPanel.add(ctrlPanel); |
---|
| 1485 | + objectPanel.add(editPanel); |
---|
1280 | 1486 | objectPanel.add(infoPanel); |
---|
| 1487 | + objectPanel.add(toolboxPanel); |
---|
1281 | 1488 | |
---|
1282 | 1489 | /* |
---|
1283 | 1490 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1286 | 1493 | aConstraints.gridy += 1; |
---|
1287 | 1494 | aConstraints.gridwidth = 1; |
---|
1288 | 1495 | mainPanel.add(objectPanel, aConstraints); |
---|
1289 | | - */ |
---|
| 1496 | + */ |
---|
1290 | 1497 | |
---|
1291 | 1498 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1292 | 1499 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1298 | 1505 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1299 | 1506 | |
---|
1300 | 1507 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1301 | | - scenePanel.preferredWidth = 7; |
---|
| 1508 | + scenePanel.preferredWidth = 6; |
---|
1302 | 1509 | |
---|
1303 | 1510 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1304 | 1511 | tabbedPane.add(scrollpane); |
---|
1305 | 1512 | |
---|
1306 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1307 | | - |
---|
1308 | | - optionsPanel = new cGridBag().setVertical(true); |
---|
| 1513 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1309 | 1514 | |
---|
1310 | 1515 | optionsPanel.setName("Options"); |
---|
1311 | 1516 | |
---|
.. | .. |
---|
1313 | 1518 | |
---|
1314 | 1519 | tabbedPane.add(optionsPanel); |
---|
1315 | 1520 | |
---|
| 1521 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1522 | + |
---|
1316 | 1523 | scenePanel.add(tabbedPane); |
---|
1317 | 1524 | |
---|
1318 | 1525 | /* |
---|
.. | .. |
---|
1404 | 1611 | |
---|
1405 | 1612 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1406 | 1613 | |
---|
1407 | | - frame.setSize(1024, 768); |
---|
1408 | | - frame.show(); |
---|
| 1614 | + frame.setSize(1280, 860); |
---|
| 1615 | + |
---|
| 1616 | + frame.validate(); |
---|
| 1617 | + frame.setVisible(true); |
---|
1409 | 1618 | |
---|
| 1619 | + cameraView.requestFocusInWindow(); |
---|
| 1620 | + |
---|
1410 | 1621 | gridPanel.setDividerLocation(1.0); |
---|
1411 | 1622 | |
---|
1412 | 1623 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
.. | .. |
---|
1444 | 1655 | |
---|
1445 | 1656 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1446 | 1657 | |
---|
1447 | | - editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1658 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
1448 | 1659 | createMaterialButton.setToolTipText("Create material"); |
---|
1449 | 1660 | |
---|
1450 | 1661 | /* |
---|
1451 | 1662 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1452 | 1663 | */ |
---|
1453 | 1664 | |
---|
1454 | | - editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1665 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
1455 | 1666 | clearMaterialButton.setToolTipText("Clear material"); |
---|
1456 | 1667 | |
---|
1457 | | - editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
1458 | | - editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
1459 | | - editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1668 | + if (Globals.ADVANCED) |
---|
| 1669 | + { |
---|
| 1670 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1671 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1672 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1673 | + } |
---|
1460 | 1674 | |
---|
1461 | 1675 | editBar.preferredHeight = 15; |
---|
1462 | 1676 | |
---|
.. | .. |
---|
1490 | 1704 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1491 | 1705 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1492 | 1706 | colorSection.add(texture); |
---|
1493 | | - |
---|
1494 | | - cGridBag anisoU = new cGridBag(); |
---|
1495 | | - anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
1496 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1497 | | - anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1498 | | - colorSection.add(anisoU); |
---|
1499 | | - |
---|
1500 | | - cGridBag anisoV = new cGridBag(); |
---|
1501 | | - anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
1502 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1503 | | - anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1504 | | - colorSection.add(anisoV); |
---|
1505 | | - |
---|
1506 | | - cGridBag shadowbias = new cGridBag(); |
---|
1507 | | - shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
1508 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1509 | | - shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1510 | | - colorSection.add(shadowbias); |
---|
1511 | 1707 | |
---|
1512 | 1708 | panel.add(new JSeparator()); |
---|
1513 | 1709 | |
---|
.. | .. |
---|
1559 | 1755 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1560 | 1756 | diffuseSection.add(fakedepth); |
---|
1561 | 1757 | |
---|
| 1758 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1759 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1760 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1761 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1762 | + diffuseSection.add(shadowbias); |
---|
| 1763 | + |
---|
1562 | 1764 | panel.add(new JSeparator()); |
---|
1563 | 1765 | |
---|
1564 | 1766 | panel.add(diffuseSection); |
---|
.. | .. |
---|
1609 | 1811 | // aConstraints.gridy += 1; |
---|
1610 | 1812 | // aConstraints.gridwidth = 1; |
---|
1611 | 1813 | |
---|
| 1814 | + cGridBag anisoU = new cGridBag(); |
---|
| 1815 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1816 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1817 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1818 | + specularSection.add(anisoU); |
---|
| 1819 | + |
---|
| 1820 | + cGridBag anisoV = new cGridBag(); |
---|
| 1821 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1822 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1823 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1824 | + specularSection.add(anisoV); |
---|
| 1825 | + |
---|
1612 | 1826 | |
---|
1613 | 1827 | panel.add(new JSeparator()); |
---|
1614 | 1828 | |
---|
.. | .. |
---|
1616 | 1830 | |
---|
1617 | 1831 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1618 | 1832 | |
---|
1619 | | - cGridBag globalSection = new cGridBag().setVertical(true); |
---|
| 1833 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1620 | 1834 | |
---|
1621 | 1835 | cGridBag camera = new cGridBag(); |
---|
1622 | 1836 | camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
1623 | 1837 | cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1624 | 1838 | camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1625 | | - globalSection.add(camera); |
---|
| 1839 | + colorSection.add(camera); |
---|
1626 | 1840 | |
---|
1627 | 1841 | cGridBag ambient = new cGridBag(); |
---|
1628 | 1842 | ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
1629 | 1843 | ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1630 | 1844 | ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1631 | | - globalSection.add(ambient); |
---|
| 1845 | + colorSection.add(ambient); |
---|
1632 | 1846 | |
---|
1633 | 1847 | cGridBag backlit = new cGridBag(); |
---|
1634 | 1848 | backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
1635 | 1849 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1636 | 1850 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1637 | | - globalSection.add(backlit); |
---|
| 1851 | + colorSection.add(backlit); |
---|
1638 | 1852 | |
---|
1639 | 1853 | cGridBag opacity = new cGridBag(); |
---|
1640 | 1854 | opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1641 | 1855 | opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1642 | 1856 | opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1643 | | - globalSection.add(opacity); |
---|
| 1857 | + colorSection.add(opacity); |
---|
1644 | 1858 | |
---|
1645 | | - panel.add(new JSeparator()); |
---|
| 1859 | + //panel.add(new JSeparator()); |
---|
1646 | 1860 | |
---|
1647 | | - panel.add(globalSection); |
---|
| 1861 | + //panel.add(globalSection); |
---|
1648 | 1862 | |
---|
1649 | 1863 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1650 | 1864 | |
---|
.. | .. |
---|
1725 | 1939 | opacityPowerField.addChangeListener(this); |
---|
1726 | 1940 | /**/ |
---|
1727 | 1941 | |
---|
1728 | | - resetSlidersButton.addActionListener(this); |
---|
1729 | 1942 | clearMaterialButton.addActionListener(this); |
---|
1730 | 1943 | createMaterialButton.addActionListener(this); |
---|
1731 | | - |
---|
1732 | | - propagateToggle.addItemListener(this); |
---|
1733 | | - multiplyToggle.addItemListener(this); |
---|
| 1944 | + |
---|
| 1945 | + if (Globals.ADVANCED) |
---|
| 1946 | + { |
---|
| 1947 | + resetSlidersButton.addActionListener(this); |
---|
| 1948 | + propagateToggle.addItemListener(this); |
---|
| 1949 | + multiplyToggle.addItemListener(this); |
---|
| 1950 | + } |
---|
1734 | 1951 | } |
---|
1735 | 1952 | |
---|
1736 | 1953 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1901 | 2118 | |
---|
1902 | 2119 | //? flashIt = false; |
---|
1903 | 2120 | CameraPane pane = (CameraPane) cameraView; |
---|
1904 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2121 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1905 | 2122 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1906 | 2123 | |
---|
1907 | 2124 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1950 | 2167 | e2.printStackTrace(); |
---|
1951 | 2168 | } |
---|
1952 | 2169 | } |
---|
| 2170 | + |
---|
1953 | 2171 | LoadJMEThread loadThread; |
---|
1954 | 2172 | |
---|
1955 | 2173 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2007 | 2225 | //LoadFile0(filename, converter); |
---|
2008 | 2226 | } |
---|
2009 | 2227 | } |
---|
| 2228 | + |
---|
2010 | 2229 | LoadOBJThread loadObjThread; |
---|
2011 | 2230 | |
---|
2012 | 2231 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2085 | 2304 | |
---|
2086 | 2305 | void LoadObjFile(String fullname) |
---|
2087 | 2306 | { |
---|
2088 | | - /* |
---|
| 2307 | + System.out.println("Loading " + fullname); |
---|
| 2308 | + /**/ |
---|
2089 | 2309 | //lastFilename = fullname; |
---|
2090 | 2310 | if(loadObjThread == null) |
---|
2091 | 2311 | { |
---|
2092 | | - loadObjThread = new LoadOBJThread(); |
---|
2093 | | - loadObjThread.start(); |
---|
| 2312 | + loadObjThread = new LoadOBJThread(); |
---|
| 2313 | + loadObjThread.start(); |
---|
2094 | 2314 | } |
---|
2095 | 2315 | |
---|
2096 | 2316 | loadObjThread.add(fullname); |
---|
2097 | | - */ |
---|
| 2317 | + /**/ |
---|
2098 | 2318 | |
---|
2099 | | - System.out.println("Loading " + fullname); |
---|
2100 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2319 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2101 | 2320 | } |
---|
2102 | 2321 | |
---|
2103 | 2322 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2358 | 2577 | |
---|
2359 | 2578 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2360 | 2579 | { |
---|
2361 | | - if (GrafreeD.standAlone) |
---|
| 2580 | + if (Grafreed.standAlone) |
---|
2362 | 2581 | { |
---|
2363 | 2582 | /**/ |
---|
2364 | 2583 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2365 | | - browser.show(); |
---|
| 2584 | + browser.setVisible(true); |
---|
2366 | 2585 | String filename = browser.getFile(); |
---|
2367 | 2586 | if (filename != null && filename.length() > 0) |
---|
2368 | 2587 | { |
---|
.. | .. |
---|
2714 | 2933 | |
---|
2715 | 2934 | void SetMaterial(Object3D object) |
---|
2716 | 2935 | { |
---|
| 2936 | + latestObject = object; |
---|
| 2937 | + |
---|
2717 | 2938 | cMaterial mat = object.material; |
---|
2718 | 2939 | |
---|
2719 | 2940 | if (mat == null) |
---|
.. | .. |
---|
2722 | 2943 | return; |
---|
2723 | 2944 | } |
---|
2724 | 2945 | |
---|
2725 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2946 | + if (multiplyToggle != null) |
---|
| 2947 | + multiplyToggle.setSelected(mat.multiply); |
---|
2726 | 2948 | |
---|
2727 | 2949 | assert (object.projectedVertices != null); |
---|
2728 | 2950 | |
---|
.. | .. |
---|
2824 | 3046 | // } |
---|
2825 | 3047 | |
---|
2826 | 3048 | /**/ |
---|
2827 | | - if (deselect) |
---|
| 3049 | + if (deselect || child == null) |
---|
2828 | 3050 | { |
---|
2829 | 3051 | //group.deselectAll(); |
---|
2830 | 3052 | //freeze = true; |
---|
2831 | 3053 | GetTree().clearSelection(); |
---|
2832 | 3054 | //freeze = false; |
---|
| 3055 | + |
---|
| 3056 | + if (child == null) |
---|
| 3057 | + { |
---|
| 3058 | + return; |
---|
| 3059 | + } |
---|
2833 | 3060 | } |
---|
2834 | 3061 | |
---|
2835 | 3062 | //group.addSelectee(child); |
---|
.. | .. |
---|
2898 | 3125 | cameraView.ToggleDL(); |
---|
2899 | 3126 | cameraView.repaint(); |
---|
2900 | 3127 | return; |
---|
2901 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3128 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2902 | 3129 | { |
---|
2903 | 3130 | cameraView.ToggleTexture(); |
---|
2904 | 3131 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
2937 | 3164 | frame.validate(); |
---|
2938 | 3165 | |
---|
2939 | 3166 | return; |
---|
2940 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3167 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
2941 | 3168 | { |
---|
2942 | | - cameraView.ToggleRandom(); |
---|
| 3169 | + cameraView.ToggleSwitch(); |
---|
2943 | 3170 | cameraView.repaint(); |
---|
2944 | 3171 | return; |
---|
2945 | 3172 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
2968 | 3195 | { |
---|
2969 | 3196 | copy.live ^= true; |
---|
2970 | 3197 | return; |
---|
| 3198 | + } else if (event.getSource() == selectCB) |
---|
| 3199 | + { |
---|
| 3200 | + copy.dontselect ^= true; |
---|
| 3201 | + return; |
---|
2971 | 3202 | } else if (event.getSource() == hideCB) |
---|
2972 | 3203 | { |
---|
2973 | 3204 | copy.hide ^= true; |
---|
.. | .. |
---|
2982 | 3213 | if (event.getSource() == randomCB) |
---|
2983 | 3214 | { |
---|
2984 | 3215 | copy.random ^= true; |
---|
| 3216 | + objEditor.refreshContents(); |
---|
2985 | 3217 | return; |
---|
2986 | 3218 | } |
---|
2987 | 3219 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3005 | 3237 | |
---|
3006 | 3238 | public void actionPerformed(ActionEvent event) |
---|
3007 | 3239 | { |
---|
| 3240 | + Object source = event.getSource(); |
---|
3008 | 3241 | // SCRIPT DIALOG |
---|
3009 | | - if (event.getSource() == okbutton) |
---|
| 3242 | + if (source == okbutton) |
---|
3010 | 3243 | { |
---|
3011 | 3244 | textpanel.setVisible(false); |
---|
3012 | 3245 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3018 | 3251 | textarea = null; |
---|
3019 | 3252 | textpanel = null; |
---|
3020 | 3253 | } |
---|
3021 | | - if (event.getSource() == cancelbutton) |
---|
| 3254 | + if (source == cancelbutton) |
---|
3022 | 3255 | { |
---|
3023 | 3256 | textpanel.setVisible(false); |
---|
3024 | 3257 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3030 | 3263 | //applySelf(); |
---|
3031 | 3264 | //client.refreshEditWindow(); |
---|
3032 | 3265 | //refreshContents(); |
---|
3033 | | - if (event.getSource() == nameField) |
---|
| 3266 | + if (source == nameField) |
---|
3034 | 3267 | { |
---|
3035 | 3268 | //System.out.println("ObjEditor " + event); |
---|
3036 | 3269 | applySelf0(true); |
---|
3037 | 3270 | //parent.applySelf(); |
---|
3038 | 3271 | objEditor.refreshContents(); |
---|
3039 | | - } else if (event.getSource() == resetButton) |
---|
| 3272 | + } else if (source == resetButton) |
---|
3040 | 3273 | { |
---|
3041 | 3274 | CameraPane.fullreset = true; |
---|
3042 | 3275 | copy.Reset(); // ResetMeshes(); |
---|
3043 | 3276 | copy.Touch(); |
---|
3044 | 3277 | objEditor.refreshContents(); |
---|
3045 | | - } else if (event.getSource() == stepItem) |
---|
| 3278 | + } else if (source == stepItem) |
---|
3046 | 3279 | { |
---|
3047 | 3280 | //cameraView.ONESTEP = true; |
---|
3048 | 3281 | Globals.ONESTEP = true; |
---|
3049 | 3282 | cameraView.repaint(); |
---|
3050 | 3283 | return; |
---|
3051 | | - } else if (event.getSource() == stepButton) |
---|
| 3284 | + } else if (source == stepButton) |
---|
3052 | 3285 | { |
---|
3053 | 3286 | copy.Step(); |
---|
3054 | 3287 | copy.Touch(); |
---|
3055 | 3288 | objEditor.refreshContents(); |
---|
3056 | | - } else if (event.getSource() == slowerButton) |
---|
| 3289 | + } else if (source == slowerButton) |
---|
3057 | 3290 | { |
---|
3058 | 3291 | copy.Slower(); |
---|
3059 | 3292 | copy.Touch(); |
---|
3060 | 3293 | objEditor.refreshContents(); |
---|
3061 | | - } else if (event.getSource() == fasterButton) |
---|
| 3294 | + } else if (source == fasterButton) |
---|
3062 | 3295 | { |
---|
3063 | 3296 | copy.Faster(); |
---|
3064 | 3297 | copy.Touch(); |
---|
3065 | 3298 | objEditor.refreshContents(); |
---|
3066 | | - } else if (event.getSource() == remarkButton) |
---|
| 3299 | + } else if (source == remarkButton) |
---|
3067 | 3300 | { |
---|
3068 | 3301 | copy.Remark(); |
---|
3069 | 3302 | copy.Touch(); |
---|
3070 | 3303 | objEditor.refreshContents(); |
---|
3071 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3304 | + } else if (source == stepAllButton) |
---|
3072 | 3305 | { |
---|
3073 | 3306 | copy.StepAll(); |
---|
3074 | 3307 | copy.Touch(); |
---|
3075 | 3308 | objEditor.refreshContents(); |
---|
3076 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3309 | + } else if (source == resetAllButton) |
---|
3077 | 3310 | { |
---|
3078 | 3311 | //CameraPane.fullreset = true; |
---|
3079 | 3312 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3106 | 3339 | // Close(); |
---|
3107 | 3340 | // } |
---|
3108 | 3341 | // else |
---|
3109 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3342 | + if (source == resetSlidersButton) |
---|
3110 | 3343 | { |
---|
3111 | 3344 | ResetSliders(); |
---|
3112 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3345 | + } else if (source == clearMaterialButton) |
---|
3113 | 3346 | { |
---|
3114 | 3347 | ClearMaterial(); |
---|
3115 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3348 | + } else if (source == createMaterialButton) |
---|
3116 | 3349 | { |
---|
3117 | 3350 | CreateMaterial(); |
---|
3118 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3351 | + } else if (source == clearPanelButton) |
---|
3119 | 3352 | { |
---|
3120 | 3353 | copy.ClearUI(); |
---|
3121 | 3354 | refreshContents(true); |
---|
3122 | | - } /* |
---|
3123 | | - } |
---|
3124 | | - |
---|
3125 | | - public boolean action(Event event, Object arg) |
---|
3126 | | - { |
---|
3127 | | - */ else if (event.getSource() == closeItem) |
---|
| 3355 | + } else if (source == importGFDItem) |
---|
| 3356 | + { |
---|
| 3357 | + ImportGFD(); |
---|
| 3358 | + } else |
---|
| 3359 | + if (source == importVRMLX3DItem) |
---|
| 3360 | + { |
---|
| 3361 | + ImportVRMLX3D(); |
---|
| 3362 | + } else |
---|
| 3363 | + if (source == import3DSItem) |
---|
| 3364 | + { |
---|
| 3365 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3366 | + } else |
---|
| 3367 | + if (source == importOBJItem) |
---|
| 3368 | + { |
---|
| 3369 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3370 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3371 | + browser.setVisible(true); |
---|
| 3372 | + String filename = browser.getFile(); |
---|
| 3373 | + if (filename != null && filename.length() > 0) |
---|
| 3374 | + { |
---|
| 3375 | + String fullname = browser.getDirectory() + filename; |
---|
| 3376 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3377 | + } |
---|
| 3378 | + } else |
---|
| 3379 | + if (source == closeItem) |
---|
3128 | 3380 | { |
---|
3129 | 3381 | Close(); |
---|
3130 | 3382 | //return true; |
---|
3131 | | - } else if (event.getSource() == loadItem) |
---|
| 3383 | + } else if (source == loadItem) |
---|
3132 | 3384 | { |
---|
3133 | 3385 | load(); |
---|
3134 | 3386 | //return true; |
---|
3135 | | - } else if (event.getSource() == saveItem) |
---|
| 3387 | + } else if (source == newItem) |
---|
| 3388 | + { |
---|
| 3389 | + New(); |
---|
| 3390 | + } else if (source == saveItem) |
---|
3136 | 3391 | { |
---|
3137 | 3392 | save(); |
---|
3138 | 3393 | //return true; |
---|
3139 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3394 | + } else if (source == saveAsItem) |
---|
3140 | 3395 | { |
---|
3141 | 3396 | saveAs(); |
---|
3142 | 3397 | //return true; |
---|
3143 | | - } else if (event.getSource() == reexportItem) |
---|
| 3398 | + } else if (source == reexportItem) |
---|
3144 | 3399 | { |
---|
3145 | 3400 | reexport(); |
---|
3146 | 3401 | //return true; |
---|
3147 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3402 | + } else if (source == exportAsItem) |
---|
3148 | 3403 | { |
---|
3149 | 3404 | export(); |
---|
3150 | 3405 | //return true; |
---|
3151 | | - } else if (event.getSource() == povItem) |
---|
| 3406 | + } else if (source == povItem) |
---|
3152 | 3407 | { |
---|
3153 | 3408 | generatePOV(); |
---|
3154 | 3409 | //return true; |
---|
3155 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3410 | + } else if (source == zBufferItem) |
---|
3156 | 3411 | { |
---|
3157 | 3412 | try |
---|
3158 | 3413 | { |
---|
.. | .. |
---|
3174 | 3429 | cameraView.repaint(); |
---|
3175 | 3430 | //return true; |
---|
3176 | 3431 | } |
---|
3177 | | - */ else if (event.getSource() == editCameraItem) |
---|
3178 | | - { |
---|
3179 | | - cameraView.ProtectCamera(); |
---|
3180 | | - cameraView.repaint(); |
---|
3181 | | - return; |
---|
3182 | | - } else if (event.getSource() == revertCameraItem) |
---|
3183 | | - { |
---|
3184 | | - cameraView.RevertCamera(); |
---|
3185 | | - cameraView.repaint(); |
---|
3186 | | - return; |
---|
3187 | | -// } else if (event.getSource() == textureButton) |
---|
3188 | | -// { |
---|
3189 | | -// return; // true; |
---|
3190 | | - } else // combos... |
---|
3191 | | - if (event.getSource() == texresMenu) |
---|
| 3432 | + */ else // combos... |
---|
| 3433 | + if (source == texresMenu) |
---|
3192 | 3434 | { |
---|
3193 | 3435 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3194 | 3436 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3200 | 3442 | } |
---|
3201 | 3443 | } |
---|
3202 | 3444 | |
---|
| 3445 | + void New() |
---|
| 3446 | + { |
---|
| 3447 | + while (copy.Size() > 1) |
---|
| 3448 | + { |
---|
| 3449 | + copy.remove(1); |
---|
| 3450 | + } |
---|
| 3451 | + |
---|
| 3452 | + ResetModel(); |
---|
| 3453 | + objEditor.refreshContents(); |
---|
| 3454 | + } |
---|
| 3455 | + |
---|
| 3456 | + static public byte[] Compress(Object3D o) |
---|
| 3457 | + { |
---|
| 3458 | + try |
---|
| 3459 | + { |
---|
| 3460 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3461 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3462 | + ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 3463 | + |
---|
| 3464 | + Object3D parent = o.parent; |
---|
| 3465 | + o.parent = null; |
---|
| 3466 | + |
---|
| 3467 | + out.writeObject(o); |
---|
| 3468 | + |
---|
| 3469 | + o.parent = parent; |
---|
| 3470 | + |
---|
| 3471 | + out.flush(); |
---|
| 3472 | + |
---|
| 3473 | + zstream.close(); |
---|
| 3474 | + out.close(); |
---|
| 3475 | + |
---|
| 3476 | + return baos.toByteArray(); |
---|
| 3477 | + } catch (Exception e) |
---|
| 3478 | + { |
---|
| 3479 | + System.err.println(e); |
---|
| 3480 | + return null; |
---|
| 3481 | + } |
---|
| 3482 | + } |
---|
| 3483 | + |
---|
| 3484 | + static public Object Uncompress(byte[] bytes) |
---|
| 3485 | + { |
---|
| 3486 | + System.out.println("#bytes = " + bytes.length); |
---|
| 3487 | + try |
---|
| 3488 | + { |
---|
| 3489 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3490 | + java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3491 | + ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 3492 | + Object obj = in.readObject(); |
---|
| 3493 | + in.close(); |
---|
| 3494 | + |
---|
| 3495 | + return obj; |
---|
| 3496 | + } catch (Exception e) |
---|
| 3497 | + { |
---|
| 3498 | + System.err.println(e); |
---|
| 3499 | + return null; |
---|
| 3500 | + } |
---|
| 3501 | + } |
---|
| 3502 | + |
---|
| 3503 | + static public Object clone(Object o) |
---|
| 3504 | + { |
---|
| 3505 | + try |
---|
| 3506 | + { |
---|
| 3507 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3508 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3509 | + |
---|
| 3510 | + out.writeObject(o); |
---|
| 3511 | + |
---|
| 3512 | + out.flush(); |
---|
| 3513 | + out.close(); |
---|
| 3514 | + |
---|
| 3515 | + byte[] bytes = baos.toByteArray(); |
---|
| 3516 | + |
---|
| 3517 | + System.out.println("clone = " + bytes.length); |
---|
| 3518 | + |
---|
| 3519 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3520 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3521 | + Object obj = in.readObject(); |
---|
| 3522 | + in.close(); |
---|
| 3523 | + |
---|
| 3524 | + return obj; |
---|
| 3525 | + } catch (Exception e) |
---|
| 3526 | + { |
---|
| 3527 | + System.err.println(e); |
---|
| 3528 | + return null; |
---|
| 3529 | + } |
---|
| 3530 | + } |
---|
| 3531 | + |
---|
| 3532 | + cRadio GetCurrentTab() |
---|
| 3533 | + { |
---|
| 3534 | + cRadio ab; |
---|
| 3535 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3536 | + { |
---|
| 3537 | + ab = (cRadio)e.nextElement(); |
---|
| 3538 | + if(ab.GetObject() == copy) |
---|
| 3539 | + { |
---|
| 3540 | + return ab; |
---|
| 3541 | + } |
---|
| 3542 | + } |
---|
| 3543 | + |
---|
| 3544 | + return null; |
---|
| 3545 | + } |
---|
| 3546 | + |
---|
| 3547 | + java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3548 | + |
---|
| 3549 | + public void Save() |
---|
| 3550 | + { |
---|
| 3551 | + System.err.println("Save"); |
---|
| 3552 | + |
---|
| 3553 | + cRadio tab = GetCurrentTab(); |
---|
| 3554 | + |
---|
| 3555 | + boolean temp = CameraPane.SWITCH; |
---|
| 3556 | + CameraPane.SWITCH = false; |
---|
| 3557 | + |
---|
| 3558 | + copy.ExtractBigData(hashtable); |
---|
| 3559 | + |
---|
| 3560 | + byte[] compress = Compress(copy); |
---|
| 3561 | + |
---|
| 3562 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3563 | + tab.graphs[tab.undoindex++] = compress; |
---|
| 3564 | + |
---|
| 3565 | + copy.RestoreBigData(hashtable); |
---|
| 3566 | + |
---|
| 3567 | + CameraPane.SWITCH = temp; |
---|
| 3568 | + |
---|
| 3569 | + //assert(hashtable.isEmpty()); |
---|
| 3570 | + |
---|
| 3571 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3572 | + { |
---|
| 3573 | + tab.graphs[i] = null; |
---|
| 3574 | + } |
---|
| 3575 | + |
---|
| 3576 | + SetUndoStates(); |
---|
| 3577 | + |
---|
| 3578 | + // test save |
---|
| 3579 | + if (false) |
---|
| 3580 | + { |
---|
| 3581 | + try |
---|
| 3582 | + { |
---|
| 3583 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3584 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3585 | + |
---|
| 3586 | + p.writeObject(copy); |
---|
| 3587 | + |
---|
| 3588 | + p.flush(); |
---|
| 3589 | + |
---|
| 3590 | + ostream.close(); |
---|
| 3591 | + } catch (Exception e) |
---|
| 3592 | + { |
---|
| 3593 | + e.printStackTrace(); |
---|
| 3594 | + } |
---|
| 3595 | + } |
---|
| 3596 | + } |
---|
| 3597 | + |
---|
| 3598 | + void CopyChanged(Object3D obj) |
---|
| 3599 | + { |
---|
| 3600 | + SetUndoStates(); |
---|
| 3601 | + |
---|
| 3602 | + boolean temp = CameraPane.SWITCH; |
---|
| 3603 | + CameraPane.SWITCH = false; |
---|
| 3604 | + |
---|
| 3605 | + copy.ExtractBigData(hashtable); |
---|
| 3606 | + |
---|
| 3607 | + copy.clear(); |
---|
| 3608 | + |
---|
| 3609 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3610 | + { |
---|
| 3611 | + copy.add(obj.get(i)); |
---|
| 3612 | + } |
---|
| 3613 | + |
---|
| 3614 | + copy.RestoreBigData(hashtable); |
---|
| 3615 | + |
---|
| 3616 | + CameraPane.SWITCH = temp; |
---|
| 3617 | + |
---|
| 3618 | + //assert(hashtable.isEmpty()); |
---|
| 3619 | + |
---|
| 3620 | + copy.Touch(); |
---|
| 3621 | + |
---|
| 3622 | + ResetModel(); |
---|
| 3623 | + copy.HardTouch(); // recompile? |
---|
| 3624 | + |
---|
| 3625 | + cRadio ab; |
---|
| 3626 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3627 | + { |
---|
| 3628 | + ab = (cRadio)e.nextElement(); |
---|
| 3629 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3630 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3631 | + if (test != null) |
---|
| 3632 | + { |
---|
| 3633 | + test.editWindow = ab.object.editWindow; |
---|
| 3634 | + ab.object = test; |
---|
| 3635 | + } |
---|
| 3636 | + } |
---|
| 3637 | + |
---|
| 3638 | + refreshContents(); |
---|
| 3639 | + } |
---|
| 3640 | + |
---|
| 3641 | + cButton undoButton; |
---|
| 3642 | + cButton redoButton; |
---|
| 3643 | + |
---|
| 3644 | + void SetUndoStates() |
---|
| 3645 | + { |
---|
| 3646 | + cRadio tab = GetCurrentTab(); |
---|
| 3647 | + |
---|
| 3648 | + undoButton.setEnabled(tab.undoindex > 0); |
---|
| 3649 | + redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null); |
---|
| 3650 | + } |
---|
| 3651 | + |
---|
| 3652 | + public void Undo() |
---|
| 3653 | + { |
---|
| 3654 | + System.err.println("Undo"); |
---|
| 3655 | + |
---|
| 3656 | + cRadio tab = GetCurrentTab(); |
---|
| 3657 | + |
---|
| 3658 | + if (tab.undoindex == 0) |
---|
| 3659 | + { |
---|
| 3660 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3661 | + return; |
---|
| 3662 | + } |
---|
| 3663 | + |
---|
| 3664 | + if (tab.graphs[tab.undoindex] == null) |
---|
| 3665 | + { |
---|
| 3666 | + Save(); |
---|
| 3667 | + tab.undoindex -= 1; |
---|
| 3668 | + } |
---|
| 3669 | + |
---|
| 3670 | + tab.undoindex -= 1; |
---|
| 3671 | + |
---|
| 3672 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3673 | + } |
---|
| 3674 | + |
---|
| 3675 | + public void Redo() |
---|
| 3676 | + { |
---|
| 3677 | + cRadio tab = GetCurrentTab(); |
---|
| 3678 | + |
---|
| 3679 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3680 | + { |
---|
| 3681 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3682 | + return; |
---|
| 3683 | + } |
---|
| 3684 | + |
---|
| 3685 | + tab.undoindex += 1; |
---|
| 3686 | + |
---|
| 3687 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3688 | + } |
---|
| 3689 | + |
---|
| 3690 | + void ImportGFD() |
---|
| 3691 | + { |
---|
| 3692 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
| 3693 | + browser.show(); |
---|
| 3694 | + String filename = browser.getFile(); |
---|
| 3695 | + if (filename != null && filename.length() > 0) |
---|
| 3696 | + { |
---|
| 3697 | + String fullname = browser.getDirectory() + filename; |
---|
| 3698 | + |
---|
| 3699 | + //Object3D readobj = |
---|
| 3700 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3701 | + //makeSomething(readobj); |
---|
| 3702 | + } |
---|
| 3703 | + } |
---|
| 3704 | + |
---|
| 3705 | + void ImportVRMLX3D() |
---|
| 3706 | + { |
---|
| 3707 | + if (Grafreed.standAlone) |
---|
| 3708 | + { |
---|
| 3709 | + /**/ |
---|
| 3710 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3711 | + browser.show(); |
---|
| 3712 | + String filename = browser.getFile(); |
---|
| 3713 | + if (filename != null && filename.length() > 0) |
---|
| 3714 | + { |
---|
| 3715 | + String fullname = browser.getDirectory() + filename; |
---|
| 3716 | + LoadVRMLX3D(fullname); |
---|
| 3717 | + } |
---|
| 3718 | + /**/ |
---|
| 3719 | + } |
---|
| 3720 | + } |
---|
| 3721 | + |
---|
3203 | 3722 | void ToggleAnimation() |
---|
3204 | 3723 | { |
---|
3205 | 3724 | if (!Globals.ANIMATION) |
---|
3206 | 3725 | { |
---|
3207 | 3726 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3208 | | - browser.show(); |
---|
| 3727 | + browser.setVisible(true); |
---|
3209 | 3728 | String filename = browser.getFile(); |
---|
3210 | 3729 | if (filename != null && filename.length() > 0) |
---|
3211 | 3730 | { |
---|
.. | .. |
---|
3215 | 3734 | |
---|
3216 | 3735 | Globals.ANIMATION ^= true; |
---|
3217 | 3736 | |
---|
3218 | | - GrafreeD.wav.cursor = 0; |
---|
3219 | | - GrafreeD.wav.loop = 0; |
---|
| 3737 | + Grafreed.wav.cursor = 0; |
---|
| 3738 | + Grafreed.wav.loop = 0; |
---|
3220 | 3739 | } |
---|
3221 | 3740 | } else |
---|
3222 | 3741 | { |
---|
.. | .. |
---|
3237 | 3756 | callee.refreshContents(); |
---|
3238 | 3757 | } else |
---|
3239 | 3758 | { |
---|
3240 | | - new Exception().printStackTrace(); |
---|
3241 | 3759 | System.exit(0); |
---|
3242 | 3760 | } |
---|
3243 | 3761 | } |
---|
.. | .. |
---|
3267 | 3785 | void CreateMaterial() |
---|
3268 | 3786 | { |
---|
3269 | 3787 | //copy.ClearMaterial(); // PATCH |
---|
3270 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3788 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3271 | 3789 | if (copy.selection.size() > 0) |
---|
3272 | 3790 | //SetMaterial(copy); |
---|
3273 | 3791 | { |
---|
.. | .. |
---|
3318 | 3836 | assert false; |
---|
3319 | 3837 | } |
---|
3320 | 3838 | |
---|
3321 | | - void EditSelection() |
---|
| 3839 | + void EditSelection(boolean newWindow) |
---|
3322 | 3840 | { |
---|
3323 | 3841 | } |
---|
3324 | 3842 | |
---|
.. | .. |
---|
3326 | 3844 | { |
---|
3327 | 3845 | copy.ResetBlockLoop(); // temporary problem |
---|
3328 | 3846 | |
---|
3329 | | - boolean random = CameraPane.RANDOM; |
---|
3330 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3847 | + boolean random = CameraPane.SWITCH; |
---|
| 3848 | + CameraPane.SWITCH = false; // parse everything |
---|
3331 | 3849 | copy.ResetDisplayList(); |
---|
3332 | 3850 | copy.HardTouch(); |
---|
3333 | | - CameraPane.RANDOM = random; |
---|
| 3851 | + CameraPane.SWITCH = random; |
---|
3334 | 3852 | } |
---|
3335 | 3853 | |
---|
3336 | 3854 | // public void applySelf() |
---|
.. | .. |
---|
3404 | 3922 | { |
---|
3405 | 3923 | //System.out.println("Propagate = " + propagate); |
---|
3406 | 3924 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 3925 | + |
---|
| 3926 | + if (copy.material != null) |
---|
| 3927 | + { |
---|
| 3928 | + cMaterial mat = copy.material; |
---|
| 3929 | + |
---|
| 3930 | + colorField.SetToolTipValue((mat.color)); |
---|
| 3931 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 3932 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 3933 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 3934 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 3935 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 3936 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 3937 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 3938 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 3939 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 3940 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 3941 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 3942 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 3943 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 3944 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 3945 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 3946 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 3947 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 3948 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 3949 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 3950 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 3951 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 3952 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 3953 | + } |
---|
| 3954 | + |
---|
3407 | 3955 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3408 | 3956 | { |
---|
3409 | 3957 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3519 | 4067 | } |
---|
3520 | 4068 | |
---|
3521 | 4069 | if (normalpushField != null) |
---|
3522 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 4070 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3523 | 4071 | } |
---|
3524 | 4072 | |
---|
3525 | 4073 | void SnapObject() |
---|
.. | .. |
---|
3783 | 4331 | |
---|
3784 | 4332 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3785 | 4333 | { |
---|
| 4334 | + if (Globals.SAVEONMAKE) // && resetmodel) |
---|
| 4335 | + Save(); |
---|
3786 | 4336 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3787 | 4337 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3788 | 4338 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3869 | 4419 | { |
---|
3870 | 4420 | ResetModel(); |
---|
3871 | 4421 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4422 | + |
---|
| 4423 | + if (thing.Size() == 0) |
---|
| 4424 | + { |
---|
| 4425 | + //EditSelection(false); |
---|
| 4426 | + } |
---|
| 4427 | + |
---|
3872 | 4428 | refreshContents(); |
---|
3873 | 4429 | } |
---|
3874 | 4430 | |
---|
.. | .. |
---|
3986 | 4542 | } |
---|
3987 | 4543 | } |
---|
3988 | 4544 | } |
---|
| 4545 | + |
---|
3989 | 4546 | LoadGFDThread loadGFDThread; |
---|
3990 | 4547 | |
---|
3991 | 4548 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4005 | 4562 | |
---|
4006 | 4563 | try |
---|
4007 | 4564 | { |
---|
| 4565 | + // Try compressed version first. |
---|
4008 | 4566 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4009 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4567 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4568 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4010 | 4569 | |
---|
4011 | 4570 | readobj = (Object3D) p.readObject(); |
---|
4012 | 4571 | istream.close(); |
---|
.. | .. |
---|
4014 | 4573 | readobj.ResetDisplayList(); |
---|
4015 | 4574 | } catch (Exception e) |
---|
4016 | 4575 | { |
---|
4017 | | - e.printStackTrace(); |
---|
| 4576 | + //e.printStackTrace(); |
---|
| 4577 | + try |
---|
| 4578 | + { |
---|
| 4579 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4580 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4581 | + |
---|
| 4582 | + readobj = (Object3D) p.readObject(); |
---|
| 4583 | + istream.close(); |
---|
| 4584 | + |
---|
| 4585 | + readobj.ResetDisplayList(); |
---|
| 4586 | + } catch (Exception e2) |
---|
| 4587 | + { |
---|
| 4588 | + e2.printStackTrace(); |
---|
| 4589 | + } |
---|
4018 | 4590 | } |
---|
4019 | 4591 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4020 | 4592 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4060 | 4632 | |
---|
4061 | 4633 | void LoadIt(Object obj) |
---|
4062 | 4634 | { |
---|
| 4635 | + if (obj == null) |
---|
| 4636 | + { |
---|
| 4637 | + // Invalid file |
---|
| 4638 | + return; |
---|
| 4639 | + } |
---|
| 4640 | + |
---|
4063 | 4641 | System.out.println("Loaded " + obj); |
---|
4064 | 4642 | //new Exception().printStackTrace(); |
---|
4065 | 4643 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4069 | 4647 | |
---|
4070 | 4648 | if (readobj != null) |
---|
4071 | 4649 | { |
---|
| 4650 | + if (Globals.SAVEONMAKE) |
---|
| 4651 | + Save(); |
---|
4072 | 4652 | try |
---|
4073 | 4653 | { |
---|
4074 | 4654 | //readobj.deepCopySelf(copy); |
---|
.. | .. |
---|
4131 | 4711 | |
---|
4132 | 4712 | void load() // throws ClassNotFoundException |
---|
4133 | 4713 | { |
---|
4134 | | - if (GrafreeD.standAlone) |
---|
| 4714 | + if (Grafreed.standAlone) |
---|
4135 | 4715 | { |
---|
4136 | 4716 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4137 | 4717 | browser.show(); |
---|
.. | .. |
---|
4218 | 4798 | try |
---|
4219 | 4799 | { |
---|
4220 | 4800 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4221 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4801 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4802 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4222 | 4803 | |
---|
4223 | 4804 | p.writeObject(copy); |
---|
4224 | 4805 | p.flush(); |
---|
4225 | 4806 | |
---|
| 4807 | + zstream.close(); |
---|
4226 | 4808 | ostream.close(); |
---|
4227 | 4809 | |
---|
4228 | 4810 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4232 | 4814 | { |
---|
4233 | 4815 | } |
---|
4234 | 4816 | } |
---|
| 4817 | + |
---|
4235 | 4818 | String lastname; |
---|
4236 | 4819 | |
---|
4237 | 4820 | void saveAs() |
---|
4238 | 4821 | { |
---|
4239 | | - if (GrafreeD.standAlone) |
---|
| 4822 | + if (Grafreed.standAlone) |
---|
4240 | 4823 | { |
---|
4241 | 4824 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4242 | 4825 | browser.setVisible(true); |
---|
4243 | 4826 | String filename = browser.getFile(); |
---|
4244 | 4827 | if (filename != null && filename.length() > 0) |
---|
4245 | 4828 | { |
---|
| 4829 | + if (!filename.endsWith(".gfd")) |
---|
| 4830 | + filename += ".gfd"; |
---|
4246 | 4831 | lastname = browser.getDirectory() + filename; |
---|
4247 | 4832 | save(); |
---|
4248 | 4833 | } |
---|
.. | .. |
---|
4341 | 4926 | try |
---|
4342 | 4927 | { |
---|
4343 | 4928 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4344 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4345 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 4929 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4930 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4346 | 4931 | |
---|
4347 | 4932 | Object3D objectparent = obj.parent; |
---|
4348 | 4933 | obj.parent = null; |
---|
4349 | 4934 | |
---|
4350 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 4935 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4351 | 4936 | |
---|
4352 | 4937 | obj.parent = objectparent; |
---|
4353 | 4938 | |
---|
.. | .. |
---|
4359 | 4944 | p.writeObject(object); |
---|
4360 | 4945 | p.flush(); |
---|
4361 | 4946 | |
---|
| 4947 | + zstream.close(); |
---|
4362 | 4948 | ostream.close(); |
---|
4363 | | - // zstream.close(); |
---|
4364 | 4949 | |
---|
4365 | 4950 | // group.selection.get(0).parent = parent; |
---|
4366 | 4951 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4381 | 4966 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4382 | 4967 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4383 | 4968 | copy.generatePOV(buffer); |
---|
4384 | | - if (GrafreeD.standAlone) |
---|
| 4969 | + if (Grafreed.standAlone) |
---|
4385 | 4970 | { |
---|
4386 | 4971 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4387 | 4972 | browser.show(); |
---|
.. | .. |
---|
4407 | 4992 | Object3D client; |
---|
4408 | 4993 | Object3D copy; |
---|
4409 | 4994 | MenuBar menuBar; |
---|
4410 | | - Menu windowMenu; |
---|
| 4995 | + Menu fileMenu; |
---|
| 4996 | + MenuItem newItem; |
---|
4411 | 4997 | MenuItem loadItem; |
---|
4412 | 4998 | MenuItem saveItem; |
---|
4413 | 4999 | MenuItem saveAsItem; |
---|
.. | .. |
---|
4415 | 5001 | MenuItem reexportItem; |
---|
4416 | 5002 | MenuItem povItem; |
---|
4417 | 5003 | MenuItem closeItem; |
---|
4418 | | - Menu cameraMenu; |
---|
| 5004 | + |
---|
4419 | 5005 | CheckboxMenuItem zBufferItem; |
---|
4420 | 5006 | //MenuItem normalLensItem; |
---|
4421 | | - MenuItem editCameraItem; |
---|
4422 | | - MenuItem revertCameraItem; |
---|
4423 | 5007 | MenuItem stepItem; |
---|
4424 | 5008 | CheckboxMenuItem toggleLiveItem; |
---|
4425 | 5009 | CheckboxMenuItem toggleFullScreenItem; |
---|
.. | .. |
---|
4430 | 5014 | CheckboxMenuItem toggleFootContactItem; |
---|
4431 | 5015 | CheckboxMenuItem toggleDLItem; |
---|
4432 | 5016 | CheckboxMenuItem toggleTextureItem; |
---|
4433 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 5017 | + CheckboxMenuItem toggleSwitchItem; |
---|
4434 | 5018 | CheckboxMenuItem toggleRootItem; |
---|
4435 | 5019 | CheckboxMenuItem animationItem; |
---|
4436 | 5020 | CheckboxMenuItem toggleHandleItem; |
---|
4437 | 5021 | CheckboxMenuItem togglePaintItem; |
---|
4438 | 5022 | JSplitPane mainPanel; |
---|
4439 | 5023 | JScrollPane scrollpane; |
---|
| 5024 | + |
---|
4440 | 5025 | JPanel toolbarPanel; |
---|
| 5026 | + |
---|
4441 | 5027 | cGridBag treePanel; |
---|
| 5028 | + |
---|
4442 | 5029 | JPanel radioPanel; |
---|
4443 | 5030 | ButtonGroup buttonGroup; |
---|
4444 | | - cGridBag ctrlPanel; |
---|
| 5031 | + |
---|
| 5032 | + cGridBag toolboxPanel; |
---|
4445 | 5033 | cGridBag materialPanel; |
---|
| 5034 | + cGridBag ctrlPanel; |
---|
| 5035 | + |
---|
4446 | 5036 | JScrollPane infoPanel; |
---|
| 5037 | + |
---|
4447 | 5038 | cGridBag optionsPanel; |
---|
| 5039 | + |
---|
4448 | 5040 | JTabbedPane objectPanel; |
---|
| 5041 | + boolean materialFlushed; |
---|
| 5042 | + Object3D latestObject; |
---|
| 5043 | + |
---|
4449 | 5044 | cGridBag XYZPanel; |
---|
| 5045 | + |
---|
4450 | 5046 | JSplitPane gridPanel; |
---|
4451 | 5047 | JSplitPane bigPanel; |
---|
| 5048 | + |
---|
4452 | 5049 | cGridBag bigThree; |
---|
4453 | 5050 | cGridBag scenePanel; |
---|
4454 | 5051 | cGridBag centralPanel; |
---|
.. | .. |
---|
4563 | 5160 | cNumberSlider fogField; |
---|
4564 | 5161 | JLabel opacityPowerLabel; |
---|
4565 | 5162 | cNumberSlider opacityPowerField; |
---|
4566 | | - JTree jTree; |
---|
| 5163 | + cTree jTree; |
---|
4567 | 5164 | //ObjectUI parent; |
---|
4568 | 5165 | |
---|
4569 | 5166 | cNumberSlider normalpushField; |
---|
| 5167 | + |
---|
| 5168 | + private MenuItem importGFDItem; |
---|
| 5169 | + private MenuItem importVRMLX3DItem; |
---|
| 5170 | + private MenuItem import3DSItem; |
---|
| 5171 | + private MenuItem importOBJItem; |
---|
4570 | 5172 | } |
---|