.. | .. |
---|
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 | + public cGridBag GetSeparator() |
---|
| 46 | + { |
---|
| 47 | + cGridBag separator = new cGridBag(); |
---|
| 48 | + separator.add(new JSeparator()); |
---|
| 49 | + separator.preferredHeight = 5; |
---|
| 50 | + return separator; |
---|
| 51 | + } |
---|
| 52 | + |
---|
| 53 | + cButton GetButton(String name, boolean border) |
---|
| 54 | + { |
---|
| 55 | + ImageIcon icon = GetIcon(name); |
---|
| 56 | + return new cButton(icon, border); |
---|
| 57 | + } |
---|
| 58 | + |
---|
| 59 | + cLabel GetLabel(String name, boolean border) |
---|
| 60 | + { |
---|
| 61 | + //ImageIcon icon = GetIcon(name); |
---|
| 62 | + return new cLabel(GetImage(name), border); |
---|
| 63 | + } |
---|
| 64 | + |
---|
| 65 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 66 | + { |
---|
| 67 | + ImageIcon icon = GetIcon(name); |
---|
| 68 | + return new cToggleButton(icon, border); |
---|
| 69 | + } |
---|
| 70 | + |
---|
| 71 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 72 | + { |
---|
| 73 | + ImageIcon icon = GetIcon(name); |
---|
| 74 | + return new cCheckBox(icon, border); |
---|
| 75 | + } |
---|
| 76 | + |
---|
| 77 | + ImageIcon GetIcon(String name) |
---|
| 78 | + { |
---|
| 79 | + try |
---|
| 80 | + { |
---|
| 81 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 82 | + |
---|
| 83 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 84 | +// { |
---|
| 85 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 86 | +// Graphics2D g = resized.createGraphics(); |
---|
| 87 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 88 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 89 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 90 | +// g.dispose(); |
---|
| 91 | +// |
---|
| 92 | +// image = resized; |
---|
| 93 | +// } |
---|
| 94 | + |
---|
| 95 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 96 | + return icon; |
---|
| 97 | + } |
---|
| 98 | + catch (Exception e) |
---|
| 99 | + { |
---|
| 100 | + return null; |
---|
| 101 | + } |
---|
| 102 | + } |
---|
| 103 | + |
---|
| 104 | + BufferedImage GetImage(String name) |
---|
| 105 | + { |
---|
| 106 | + try |
---|
| 107 | + { |
---|
| 108 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 109 | + |
---|
| 110 | + return image; |
---|
| 111 | + } |
---|
| 112 | + catch (Exception e) |
---|
| 113 | + { |
---|
| 114 | + return null; |
---|
| 115 | + } |
---|
| 116 | + } |
---|
38 | 117 | |
---|
39 | 118 | // SCRIPT |
---|
40 | 119 | |
---|
.. | .. |
---|
143 | 222 | //nameField.removeActionListener(this); |
---|
144 | 223 | // objEditor.ctrlPanel.remove(nameField); |
---|
145 | 224 | |
---|
146 | | - if (!GroupEditor.allparams) |
---|
| 225 | + objEditor.ctrlPanel.remove(namePanel); |
---|
| 226 | + |
---|
| 227 | + if (!allparams) |
---|
147 | 228 | return; |
---|
148 | 229 | |
---|
149 | 230 | // objEditor.ctrlPanel.remove(liveCB); |
---|
.. | .. |
---|
165 | 246 | // objEditor.ctrlPanel.remove(fasterButton); |
---|
166 | 247 | // objEditor.ctrlPanel.remove(remarkButton); |
---|
167 | 248 | |
---|
168 | | - objEditor.ctrlPanel.remove(namePanel); |
---|
169 | 249 | objEditor.ctrlPanel.remove(setupPanel); |
---|
170 | | - objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 250 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 251 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
171 | 252 | objEditor.ctrlPanel.remove(pushPanel); |
---|
172 | 253 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
173 | 254 | |
---|
.. | .. |
---|
215 | 296 | client = inClient; |
---|
216 | 297 | copy = client; |
---|
217 | 298 | |
---|
| 299 | + if (copy.versions == null) |
---|
| 300 | + { |
---|
| 301 | + copy.versions = new byte[100][]; |
---|
| 302 | + copy.versionindex = -1; |
---|
| 303 | + } |
---|
| 304 | + |
---|
218 | 305 | // "this" is not called: SetupUI2(objEditor); |
---|
219 | 306 | } |
---|
220 | 307 | |
---|
.. | .. |
---|
228 | 315 | client = inClient; |
---|
229 | 316 | copy = client; |
---|
230 | 317 | |
---|
| 318 | + if (copy.versions == null) |
---|
| 319 | + { |
---|
| 320 | + copy.versions = new byte[100][]; |
---|
| 321 | + copy.versionindex = -1; |
---|
| 322 | + } |
---|
| 323 | + |
---|
231 | 324 | SetupUI2(callee.GetEditor()); |
---|
232 | 325 | } |
---|
233 | 326 | |
---|
.. | .. |
---|
242 | 335 | //localCopy.parent = null; |
---|
243 | 336 | |
---|
244 | 337 | frame = new JFrame(); |
---|
| 338 | + frame.setUndecorated(false); |
---|
245 | 339 | objEditor = this; |
---|
246 | 340 | this.callee = callee; |
---|
247 | 341 | |
---|
.. | .. |
---|
259 | 353 | copy = localCopy; |
---|
260 | 354 | copy.editWindow = this; |
---|
261 | 355 | |
---|
| 356 | + if (copy.versions == null) |
---|
| 357 | + { |
---|
| 358 | +// copy.versions = new byte[100][]; |
---|
| 359 | +// copy.versionindex = -1; |
---|
| 360 | + } |
---|
| 361 | + |
---|
262 | 362 | SetupMenu(); |
---|
263 | 363 | |
---|
264 | 364 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
272 | 372 | return frame.action(event, obj); |
---|
273 | 373 | } |
---|
274 | 374 | |
---|
| 375 | + // Cannot work without static |
---|
| 376 | + static boolean allparams = true; |
---|
| 377 | + |
---|
| 378 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 379 | + |
---|
275 | 380 | void SetupMenu() |
---|
276 | 381 | { |
---|
277 | 382 | 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...")); |
---|
| 383 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 384 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 385 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
| 386 | + |
---|
| 387 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 388 | + Menu menu = new Menu("Import"); |
---|
| 389 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 390 | + importOBJItem.addActionListener(this); |
---|
| 391 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 392 | + import3DSItem.addActionListener(this); |
---|
| 393 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 394 | + importVRMLX3DItem.addActionListener(this); |
---|
| 395 | + menu.add("-"); |
---|
| 396 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 397 | + importGFDItem.addActionListener(this); |
---|
| 398 | + fileMenu.add(menu); |
---|
| 399 | + fileMenu.add("-"); |
---|
| 400 | + |
---|
| 401 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 402 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
283 | 403 | //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("-"); |
---|
| 404 | + fileMenu.add("-"); |
---|
| 405 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 406 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 407 | + fileMenu.add("-"); |
---|
288 | 408 | if (client.parent != null) |
---|
289 | 409 | { |
---|
290 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 410 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
291 | 411 | } else |
---|
292 | 412 | { |
---|
293 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 413 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
294 | 414 | } |
---|
295 | 415 | |
---|
296 | | - loadItem.addActionListener(this); |
---|
| 416 | + newItem.addActionListener(this); |
---|
| 417 | + openItem.addActionListener(this); |
---|
297 | 418 | saveItem.addActionListener(this); |
---|
298 | 419 | saveAsItem.addActionListener(this); |
---|
299 | 420 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
301 | 422 | //povItem.addActionListener(this); |
---|
302 | 423 | closeItem.addActionListener(this); |
---|
303 | 424 | |
---|
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 | 425 | objectPanel = new JTabbedPane(); |
---|
| 426 | + |
---|
| 427 | + ChangeListener changeListener = new ChangeListener() |
---|
| 428 | + { |
---|
| 429 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 430 | + { |
---|
| 431 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 432 | +// { |
---|
| 433 | +// if (latestObject != null) |
---|
| 434 | +// { |
---|
| 435 | +// refreshContents(true); |
---|
| 436 | +// SetMaterial(latestObject); |
---|
| 437 | +// } |
---|
| 438 | +// |
---|
| 439 | +// materialFlushed = true; |
---|
| 440 | +// } |
---|
| 441 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 442 | +// { |
---|
| 443 | +// if (listUI.size() == 0) |
---|
| 444 | +// EditSelection(false); |
---|
| 445 | +// } |
---|
| 446 | + |
---|
| 447 | + refreshContents(false); // To refresh Info tab |
---|
| 448 | + } |
---|
| 449 | + }; |
---|
| 450 | + objectPanel.addChangeListener(changeListener); |
---|
| 451 | + |
---|
360 | 452 | toolbarPanel = new JPanel(); |
---|
361 | 453 | toolbarPanel.setName("Toolbar"); |
---|
| 454 | + |
---|
362 | 455 | treePanel = new cGridBag(); |
---|
363 | 456 | treePanel.setName("Tree"); |
---|
| 457 | + |
---|
| 458 | + editPanel = new cGridBag().setVertical(true); |
---|
| 459 | + //editPanel.setName("Edit"); |
---|
| 460 | + |
---|
364 | 461 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
365 | | - ctrlPanel.setName("Edit"); |
---|
| 462 | + |
---|
| 463 | + editCommandsPanel = new cGridBag(); |
---|
| 464 | + editPanel.add(editCommandsPanel); |
---|
| 465 | + editPanel.add(ctrlPanel); |
---|
| 466 | + |
---|
| 467 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 468 | + //toolboxPanel.setName("Toolbox"); |
---|
| 469 | + |
---|
366 | 470 | materialPanel = new cGridBag().setVertical(true); |
---|
367 | | - materialPanel.setName("Material"); |
---|
| 471 | + //materialPanel.setName("Material"); |
---|
| 472 | + |
---|
368 | 473 | /*JTextPane*/ |
---|
369 | 474 | infoarea = createTextPane(); |
---|
370 | 475 | doc = infoarea.getStyledDocument(); |
---|
371 | 476 | |
---|
372 | 477 | infoarea.setEditable(true); |
---|
373 | 478 | SetText(); |
---|
| 479 | + |
---|
374 | 480 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
375 | 481 | // infoarea.setOpaque(false); |
---|
376 | 482 | // //infoarea.setForeground(textcolor); |
---|
377 | 483 | // TEXTAREA infoarea.setLineWrap(true); |
---|
378 | 484 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
379 | 485 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
380 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
381 | | - infoPanel.setName("Info"); |
---|
| 486 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
| 487 | + //infoPanel.setName("Info"); |
---|
382 | 488 | //infoPanel.setLayout(new BorderLayout()); |
---|
383 | 489 | //infoPanel.add(createTextPane()); |
---|
384 | 490 | |
---|
.. | .. |
---|
389 | 495 | mainPanel.setDividerSize(9); |
---|
390 | 496 | mainPanel.setDividerLocation(0.5); //1.0); |
---|
391 | 497 | mainPanel.setResizeWeight(0.5); |
---|
392 | | - |
---|
| 498 | + |
---|
| 499 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 500 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 501 | + divider.setDividerSize(15); |
---|
| 502 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 503 | + |
---|
| 504 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 505 | + |
---|
393 | 506 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
394 | 507 | //mainPanel.setLayout(new GridBagLayout()); |
---|
395 | 508 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
.. | .. |
---|
457 | 570 | e.printStackTrace(); |
---|
458 | 571 | } |
---|
459 | 572 | |
---|
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(); |
---|
| 573 | +// String selection = infoarea.getText(); |
---|
| 574 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 575 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 576 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
464 | 577 | //clipboard.setContents(data, data); |
---|
465 | 578 | } |
---|
466 | 579 | |
---|
.. | .. |
---|
483 | 596 | //SendInfo("Name:", "bold"); |
---|
484 | 597 | if (sel.GetTextures() != null || debug) |
---|
485 | 598 | { |
---|
486 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 599 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
487 | 600 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
488 | 601 | if (sel.Size() > 0) |
---|
489 | 602 | { |
---|
490 | 603 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
491 | 604 | } |
---|
492 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 605 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
493 | 606 | if (debug) |
---|
494 | 607 | { |
---|
495 | 608 | try |
---|
.. | .. |
---|
531 | 644 | } |
---|
532 | 645 | if (sel.support != null) |
---|
533 | 646 | { |
---|
534 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 647 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
535 | 648 | } |
---|
536 | 649 | if (sel.scriptnode != null) |
---|
537 | 650 | { |
---|
.. | .. |
---|
620 | 733 | } |
---|
621 | 734 | } |
---|
622 | 735 | |
---|
| 736 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 737 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 738 | + |
---|
| 739 | + Rectangle keeprect; |
---|
| 740 | + cRadio radio; |
---|
| 741 | + |
---|
| 742 | +cButton keepButton; |
---|
| 743 | + cButton twoButton; // Full 3D |
---|
| 744 | + cButton sixButton; |
---|
| 745 | + cButton threeButton; |
---|
| 746 | + cButton sevenButton; |
---|
| 747 | + cButton fourButton; // full panel |
---|
| 748 | + cButton oneButton; // full XYZ |
---|
| 749 | + //cButton currentLayout; |
---|
| 750 | + |
---|
| 751 | + boolean maximized; |
---|
| 752 | + |
---|
| 753 | + cButton fullscreenLayout; |
---|
| 754 | + |
---|
| 755 | + void Minimize() |
---|
| 756 | + { |
---|
| 757 | + frame.setState(Frame.ICONIFIED); |
---|
| 758 | + frame.validate(); |
---|
| 759 | + } |
---|
| 760 | + |
---|
| 761 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 762 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 763 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
| 764 | + void Maximize() |
---|
| 765 | + { |
---|
| 766 | + if (CameraPane.FULLSCREEN) |
---|
| 767 | + { |
---|
| 768 | + ToggleFullScreen(); |
---|
| 769 | + } |
---|
| 770 | + |
---|
| 771 | + if (maximized) |
---|
| 772 | + { |
---|
| 773 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 774 | + } |
---|
| 775 | + else |
---|
| 776 | + { |
---|
| 777 | + keeprect = frame.getBounds(); |
---|
| 778 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 779 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 780 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 781 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 782 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
| 783 | + } |
---|
| 784 | + |
---|
| 785 | + maximized ^= true; |
---|
| 786 | + |
---|
| 787 | + frame.validate(); |
---|
| 788 | + } |
---|
| 789 | + |
---|
| 790 | + cButton minButton; |
---|
| 791 | + cButton maxButton; |
---|
| 792 | + cButton fullButton; |
---|
| 793 | + |
---|
623 | 794 | void ToggleFullScreen() |
---|
624 | 795 | { |
---|
625 | | - if (CameraPane.FULLSCREEN) |
---|
| 796 | +GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 797 | + |
---|
| 798 | + cameraView.ToggleFullScreen(); |
---|
| 799 | + |
---|
| 800 | + if (!CameraPane.FULLSCREEN) |
---|
626 | 801 | { |
---|
627 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
628 | | - framePanel.add(bigThree); |
---|
629 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 802 | + device.setFullScreenWindow(null); |
---|
| 803 | + frame.dispose(); |
---|
| 804 | + frame.setUndecorated(false); |
---|
| 805 | + frame.validate(); |
---|
| 806 | + frame.setVisible(true); |
---|
| 807 | + |
---|
| 808 | + //frame.setVisible(false); |
---|
| 809 | +// frame.removeNotify(); |
---|
| 810 | +// frame.setUndecorated(false); |
---|
| 811 | +// frame.addNotify(); |
---|
| 812 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 813 | + |
---|
| 814 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 815 | +// X framePanel.add(bigThree); |
---|
| 816 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 817 | + framePanel.setDividerLocation(46); |
---|
| 818 | + |
---|
| 819 | + //frame.setVisible(true); |
---|
| 820 | + radio.layout = keepButton; |
---|
| 821 | + //theFrame = null; |
---|
| 822 | + keepButton = null; |
---|
| 823 | + radio.layout.doClick(); |
---|
| 824 | + |
---|
630 | 825 | } else |
---|
631 | 826 | { |
---|
632 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
633 | | - framePanel.remove(bigThree); |
---|
634 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 827 | + keepButton = radio.layout; |
---|
| 828 | + //keeprect = frame.getBounds(); |
---|
| 829 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 830 | +// frame.getToolkit().getScreenSize().height); |
---|
| 831 | + //frame.setVisible(false); |
---|
| 832 | + |
---|
| 833 | + frame.dispose(); |
---|
| 834 | + frame.setUndecorated(true); |
---|
| 835 | + device.setFullScreenWindow(frame); |
---|
| 836 | + frame.validate(); |
---|
| 837 | + frame.setVisible(true); |
---|
| 838 | +// frame.removeNotify(); |
---|
| 839 | +// frame.setUndecorated(true); |
---|
| 840 | +// frame.addNotify(); |
---|
| 841 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 842 | +// X framePanel.remove(bigThree); |
---|
| 843 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 844 | + framePanel.setDividerLocation(0); |
---|
| 845 | + |
---|
| 846 | + radio.layout = fullscreenLayout; |
---|
| 847 | + radio.layout.doClick(); |
---|
| 848 | + //frame.setVisible(true); |
---|
635 | 849 | } |
---|
636 | | - cameraView.ToggleFullScreen(); |
---|
| 850 | + frame.validate(); |
---|
637 | 851 | } |
---|
| 852 | + |
---|
| 853 | + private byte[] CompressCopy() |
---|
| 854 | + { |
---|
| 855 | + boolean temp = CameraPane.SWITCH; |
---|
| 856 | + CameraPane.SWITCH = false; |
---|
| 857 | + |
---|
| 858 | + copy.ExtractBigData(versiontable); |
---|
| 859 | + // if (copy == client) |
---|
| 860 | + |
---|
| 861 | + byte[] versions[] = copy.versions; |
---|
| 862 | + copy.versions = null; |
---|
| 863 | + |
---|
| 864 | + byte[] compress = Compress(copy); |
---|
| 865 | + |
---|
| 866 | + copy.versions = versions; |
---|
| 867 | + |
---|
| 868 | + copy.RestoreBigData(versiontable); |
---|
| 869 | + |
---|
| 870 | + CameraPane.SWITCH = temp; |
---|
| 871 | + |
---|
| 872 | + return compress; |
---|
| 873 | + } |
---|
638 | 874 | |
---|
639 | 875 | private JTextPane createTextPane() |
---|
640 | 876 | { |
---|
.. | .. |
---|
734 | 970 | protected static ImageIcon createImageIcon(String path, |
---|
735 | 971 | String description) |
---|
736 | 972 | { |
---|
737 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 973 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
738 | 974 | if (imgURL != null) |
---|
739 | 975 | { |
---|
740 | 976 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
766 | 1002 | // NumberSlider vDivsField; |
---|
767 | 1003 | // JCheckBox endcaps; |
---|
768 | 1004 | JCheckBox liveCB; |
---|
| 1005 | + JCheckBox selectableCB; |
---|
769 | 1006 | JCheckBox hideCB; |
---|
770 | 1007 | JCheckBox link2masterCB; |
---|
771 | 1008 | JCheckBox markCB; |
---|
.. | .. |
---|
773 | 1010 | JCheckBox speedupCB; |
---|
774 | 1011 | JCheckBox rewindCB; |
---|
775 | 1012 | JCheckBox flipVCB; |
---|
| 1013 | + |
---|
| 1014 | + cCheckBox toggleTextureCB; |
---|
| 1015 | + cCheckBox toggleSwitchCB; |
---|
| 1016 | + |
---|
776 | 1017 | JComboBox texresMenu; |
---|
| 1018 | + |
---|
777 | 1019 | JButton resetButton; |
---|
778 | 1020 | JButton stepButton; |
---|
779 | 1021 | JButton stepAllButton; |
---|
.. | .. |
---|
782 | 1024 | JButton fasterButton; |
---|
783 | 1025 | JButton remarkButton; |
---|
784 | 1026 | |
---|
| 1027 | + cGridBag editPanel; |
---|
| 1028 | + cGridBag editCommandsPanel; |
---|
| 1029 | + |
---|
785 | 1030 | cGridBag namePanel; |
---|
786 | 1031 | cGridBag setupPanel; |
---|
787 | | - cGridBag commandsPanel; |
---|
| 1032 | + cGridBag setupPanel2; |
---|
| 1033 | + cGridBag objectCommandsPanel; |
---|
788 | 1034 | cGridBag pushPanel; |
---|
789 | 1035 | cGridBag fillPanel; |
---|
790 | 1036 | |
---|
.. | .. |
---|
956 | 1202 | namePanel = new cGridBag(); |
---|
957 | 1203 | |
---|
958 | 1204 | nameField = AddText(namePanel, copy.GetName()); |
---|
959 | | - namePanel.add(nameField); |
---|
| 1205 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
960 | 1206 | oe.ctrlPanel.add(namePanel); |
---|
961 | 1207 | |
---|
962 | 1208 | oe.ctrlPanel.Return(); |
---|
963 | 1209 | |
---|
964 | | - if (!GroupEditor.allparams) |
---|
| 1210 | + if (!allparams) |
---|
965 | 1211 | return; |
---|
966 | 1212 | |
---|
967 | 1213 | setupPanel = new cGridBag().setVertical(false); |
---|
968 | 1214 | |
---|
969 | 1215 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
970 | | - if (Globals.ADVANCED) |
---|
971 | | - link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master); |
---|
972 | | - hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1216 | + liveCB.setToolTipText("Animate object"); |
---|
| 1217 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1218 | + selectableCB.setToolTipText("Make object selectable"); |
---|
973 | 1219 | // Return(); |
---|
| 1220 | + |
---|
| 1221 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1222 | + hideCB.setToolTipText("Hide object"); |
---|
974 | 1223 | markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
975 | | - rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind); |
---|
976 | | - randomCB = AddCheckBox(setupPanel, "Rand", copy.random); |
---|
| 1224 | + markCB.setToolTipText("As animation target transform"); |
---|
| 1225 | + |
---|
| 1226 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
| 1227 | + |
---|
| 1228 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1229 | + |
---|
| 1230 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1231 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1232 | + |
---|
| 1233 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1234 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
977 | 1235 | |
---|
| 1236 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1237 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1238 | + |
---|
| 1239 | + if (Globals.ADVANCED) |
---|
| 1240 | + { |
---|
| 1241 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1242 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1243 | + } |
---|
| 1244 | + |
---|
978 | 1245 | oe.ctrlPanel.add(setupPanel); |
---|
979 | 1246 | oe.ctrlPanel.Return(); |
---|
| 1247 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1248 | + oe.ctrlPanel.Return(); |
---|
980 | 1249 | |
---|
981 | | - commandsPanel = new cGridBag().setVertical(false); |
---|
| 1250 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
982 | 1251 | |
---|
983 | | - resetButton = AddButton(commandsPanel, "Reset"); |
---|
984 | | - stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1252 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1253 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1254 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1255 | + stepButton.setToolTipText("Step one frame"); |
---|
985 | 1256 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
986 | 1257 | // stepAllButton = AddButton(oe, "Step All"); |
---|
987 | | - speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup); |
---|
988 | 1258 | // Return(); |
---|
989 | | - slowerButton = AddButton(commandsPanel, "Slow"); |
---|
990 | | - fasterButton = AddButton(commandsPanel, "Fast"); |
---|
991 | | - remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1259 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1260 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1261 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1262 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1263 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1264 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
992 | 1265 | |
---|
993 | | - oe.ctrlPanel.add(commandsPanel); |
---|
| 1266 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
994 | 1267 | oe.ctrlPanel.Return(); |
---|
995 | 1268 | |
---|
996 | | - pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1); |
---|
| 1269 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
997 | 1270 | normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
998 | 1271 | //Return(); |
---|
999 | 1272 | |
---|
.. | .. |
---|
1196 | 1469 | //worldPanel.setName("World"); |
---|
1197 | 1470 | centralPanel = new cGridBag(); |
---|
1198 | 1471 | centralPanel.preferredWidth = 20; |
---|
1199 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1200 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1472 | + |
---|
| 1473 | + if (Globals.ADVANCED) |
---|
| 1474 | + { |
---|
| 1475 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1476 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1201 | 1477 | |
---|
1202 | 1478 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1203 | 1479 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1206 | 1482 | // cameraPanel.setDividerSize(9); |
---|
1207 | 1483 | cameraPanel.setResizeWeight(1.0); |
---|
1208 | 1484 | |
---|
| 1485 | + } |
---|
| 1486 | + |
---|
1209 | 1487 | centralPanel.add(cameraView); |
---|
| 1488 | + centralPanel.setFocusable(true); |
---|
1210 | 1489 | //frame.setJMenuBar(timelineMenubar); |
---|
1211 | 1490 | //centralPanel.add(timelinePanel); |
---|
1212 | 1491 | |
---|
.. | .. |
---|
1232 | 1511 | XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1233 | 1512 | XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1234 | 1513 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1514 | + //XYZPanel.setName("XYZ"); |
---|
1235 | 1515 | |
---|
1236 | 1516 | /* |
---|
1237 | 1517 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1269 | 1549 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1270 | 1550 | //tmp.setName("Edit"); |
---|
1271 | 1551 | objectPanel.add(materialPanel); |
---|
| 1552 | + objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1553 | + objectPanel.setToolTipTextAt(0, "Material panel"); |
---|
| 1554 | + |
---|
1272 | 1555 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1273 | 1556 | // north.setName("Edit"); |
---|
1274 | 1557 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1275 | 1558 | // objectPanel.add(north); |
---|
1276 | | - objectPanel.add(ctrlPanel); |
---|
1277 | | - objectPanel.add(infoPanel); |
---|
| 1559 | + objectPanel.add(editPanel); |
---|
| 1560 | + objectPanel.setIconAt(1, GetIcon("icons/write.png")); |
---|
| 1561 | + objectPanel.setToolTipTextAt(1, "Edit panel"); |
---|
| 1562 | + |
---|
| 1563 | + //if (Globals.ADVANCED) |
---|
| 1564 | + objectPanel.add(infoPanel); |
---|
| 1565 | + objectPanel.setIconAt(2, GetIcon("icons/info.png")); |
---|
| 1566 | + objectPanel.setToolTipTextAt(2, "Info panel"); |
---|
| 1567 | + |
---|
| 1568 | + objectPanel.add(XYZPanel); |
---|
| 1569 | + objectPanel.setIconAt(3, GetIcon("icons/XYZ.png")); |
---|
| 1570 | + objectPanel.setToolTipTextAt(3, "XYZ/RGB panel"); |
---|
| 1571 | + |
---|
| 1572 | + objectPanel.add(toolboxPanel); |
---|
| 1573 | + objectPanel.setIconAt(4, GetIcon("icons/primitives.png")); |
---|
| 1574 | + objectPanel.setToolTipTextAt(4, "Objects/backgrounds panel"); |
---|
1278 | 1575 | |
---|
1279 | 1576 | /* |
---|
1280 | 1577 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1283 | 1580 | aConstraints.gridy += 1; |
---|
1284 | 1581 | aConstraints.gridwidth = 1; |
---|
1285 | 1582 | mainPanel.add(objectPanel, aConstraints); |
---|
1286 | | - */ |
---|
| 1583 | + */ |
---|
1287 | 1584 | |
---|
1288 | 1585 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1289 | 1586 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1295 | 1592 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1296 | 1593 | |
---|
1297 | 1594 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1298 | | - scenePanel.preferredWidth = 7; |
---|
| 1595 | + scenePanel.preferredWidth = 5; |
---|
1299 | 1596 | |
---|
1300 | 1597 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1301 | 1598 | tabbedPane.add(scrollpane); |
---|
1302 | 1599 | |
---|
1303 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1304 | | - |
---|
1305 | | - optionsPanel = new cGridBag().setVertical(true); |
---|
| 1600 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1306 | 1601 | |
---|
1307 | 1602 | optionsPanel.setName("Options"); |
---|
1308 | 1603 | |
---|
.. | .. |
---|
1310 | 1605 | |
---|
1311 | 1606 | tabbedPane.add(optionsPanel); |
---|
1312 | 1607 | |
---|
| 1608 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1609 | + |
---|
1313 | 1610 | scenePanel.add(tabbedPane); |
---|
1314 | 1611 | |
---|
1315 | 1612 | /* |
---|
.. | .. |
---|
1373 | 1670 | bigThree = new cGridBag(); |
---|
1374 | 1671 | bigThree.addComponent(scenePanel); |
---|
1375 | 1672 | bigThree.addComponent(centralPanel); |
---|
1376 | | - bigThree.addComponent(XYZPanel); |
---|
| 1673 | + //bigThree.addComponent(XYZPanel); |
---|
1377 | 1674 | |
---|
1378 | 1675 | // // SIDE EFFECT!!! |
---|
1379 | 1676 | // aConstraints.gridx = 0; |
---|
.. | .. |
---|
1382 | 1679 | // aConstraints.gridheight = 1; |
---|
1383 | 1680 | |
---|
1384 | 1681 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1385 | | - framePanel.setContinuousLayout(true); |
---|
1386 | | - framePanel.setOneTouchExpandable(true); |
---|
1387 | | - framePanel.setDividerLocation(0.8); |
---|
| 1682 | + framePanel.setContinuousLayout(false); |
---|
| 1683 | + framePanel.setOneTouchExpandable(false); |
---|
| 1684 | + //.setDividerLocation(0.8); |
---|
1388 | 1685 | //framePanel.setDividerSize(15); |
---|
1389 | 1686 | //framePanel.setResizeWeight(0.15); |
---|
1390 | 1687 | framePanel.setName("Frame"); |
---|
.. | .. |
---|
1401 | 1698 | |
---|
1402 | 1699 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1403 | 1700 | |
---|
1404 | | - frame.setSize(1024, 768); |
---|
1405 | | - frame.show(); |
---|
1406 | | - |
---|
| 1701 | + frame.setSize(1280, 860); |
---|
| 1702 | + |
---|
| 1703 | + cameraView.requestFocusInWindow(); |
---|
| 1704 | + |
---|
1407 | 1705 | gridPanel.setDividerLocation(1.0); |
---|
| 1706 | + |
---|
| 1707 | + frame.validate(); |
---|
| 1708 | + |
---|
| 1709 | + frame.setVisible(true); |
---|
1408 | 1710 | |
---|
1409 | 1711 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1410 | 1712 | frame.addWindowListener(new WindowAdapter() |
---|
1411 | 1713 | { |
---|
1412 | | - |
---|
1413 | 1714 | public void windowClosing(WindowEvent e) |
---|
1414 | 1715 | { |
---|
1415 | 1716 | Close(); |
---|
.. | .. |
---|
1441 | 1742 | |
---|
1442 | 1743 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1443 | 1744 | |
---|
1444 | | - editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1745 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
1445 | 1746 | createMaterialButton.setToolTipText("Create material"); |
---|
1446 | 1747 | |
---|
1447 | 1748 | /* |
---|
1448 | 1749 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1449 | 1750 | */ |
---|
1450 | 1751 | |
---|
1451 | | - editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1752 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
1452 | 1753 | clearMaterialButton.setToolTipText("Clear material"); |
---|
1453 | 1754 | |
---|
1454 | | - editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
1455 | | - editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
1456 | | - editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1755 | + if (Globals.ADVANCED) |
---|
| 1756 | + { |
---|
| 1757 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1758 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1759 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1760 | + } |
---|
1457 | 1761 | |
---|
1458 | 1762 | editBar.preferredHeight = 15; |
---|
1459 | 1763 | |
---|
.. | .. |
---|
1468 | 1772 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1469 | 1773 | |
---|
1470 | 1774 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1775 | + |
---|
| 1776 | + cGridBag huepanel = new cGridBag(); |
---|
| 1777 | + cGridBag huelabel = new cGridBag(); |
---|
| 1778 | + huelabel.add(GetLabel("icons/hue.png", false)); |
---|
| 1779 | + huelabel.preferredWidth = 20; |
---|
| 1780 | + huepanel.add(new cGridBag()); // Label |
---|
| 1781 | + huepanel.add(huelabel); // Field/slider |
---|
| 1782 | + |
---|
| 1783 | + huepanel.preferredHeight = 7; |
---|
| 1784 | + |
---|
| 1785 | + colorSection.add(huepanel); |
---|
1471 | 1786 | |
---|
1472 | 1787 | cGridBag color = new cGridBag(); |
---|
1473 | | - color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
1474 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1475 | | - color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1788 | + |
---|
| 1789 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1790 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1791 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1792 | + |
---|
1476 | 1793 | //colorField.preferredWidth = 200; |
---|
1477 | 1794 | colorSection.add(color); |
---|
1478 | 1795 | |
---|
1479 | 1796 | cGridBag modulation = new cGridBag(); |
---|
1480 | 1797 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1481 | 1798 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1482 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1799 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1483 | 1800 | colorSection.add(modulation); |
---|
1484 | 1801 | |
---|
| 1802 | + cGridBag opacity = new cGridBag(); |
---|
| 1803 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1804 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1805 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 1806 | + colorSection.add(opacity); |
---|
| 1807 | + |
---|
| 1808 | + colorSection.add(GetSeparator()); |
---|
| 1809 | + |
---|
1485 | 1810 | cGridBag texture = new cGridBag(); |
---|
1486 | 1811 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1487 | 1812 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1488 | 1813 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1489 | 1814 | colorSection.add(texture); |
---|
1490 | 1815 | |
---|
1491 | | - cGridBag anisoU = new cGridBag(); |
---|
1492 | | - anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
1493 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1494 | | - anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1495 | | - colorSection.add(anisoU); |
---|
1496 | | - |
---|
1497 | | - cGridBag anisoV = new cGridBag(); |
---|
1498 | | - anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
1499 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1500 | | - anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1501 | | - colorSection.add(anisoV); |
---|
1502 | | - |
---|
1503 | | - cGridBag shadowbias = new cGridBag(); |
---|
1504 | | - shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
1505 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1506 | | - shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1507 | | - colorSection.add(shadowbias); |
---|
1508 | | - |
---|
1509 | | - panel.add(new JSeparator()); |
---|
| 1816 | + panel.add(GetSeparator()); |
---|
1510 | 1817 | |
---|
1511 | 1818 | panel.add(colorSection); |
---|
1512 | 1819 | |
---|
.. | .. |
---|
1556 | 1863 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1557 | 1864 | diffuseSection.add(fakedepth); |
---|
1558 | 1865 | |
---|
1559 | | - panel.add(new JSeparator()); |
---|
| 1866 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1867 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1868 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1869 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1870 | + diffuseSection.add(shadowbias); |
---|
| 1871 | + |
---|
| 1872 | + panel.add(GetSeparator()); |
---|
1560 | 1873 | |
---|
1561 | 1874 | panel.add(diffuseSection); |
---|
1562 | 1875 | |
---|
.. | .. |
---|
1606 | 1919 | // aConstraints.gridy += 1; |
---|
1607 | 1920 | // aConstraints.gridwidth = 1; |
---|
1608 | 1921 | |
---|
| 1922 | + cGridBag anisoU = new cGridBag(); |
---|
| 1923 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1924 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1925 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1926 | + specularSection.add(anisoU); |
---|
1609 | 1927 | |
---|
1610 | | - panel.add(new JSeparator()); |
---|
| 1928 | + cGridBag anisoV = new cGridBag(); |
---|
| 1929 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1930 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1931 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1932 | + specularSection.add(anisoV); |
---|
| 1933 | + |
---|
| 1934 | + |
---|
| 1935 | + panel.add(GetSeparator()); |
---|
1611 | 1936 | |
---|
1612 | 1937 | panel.add(specularSection); |
---|
1613 | 1938 | |
---|
1614 | 1939 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1615 | 1940 | |
---|
1616 | | - cGridBag globalSection = new cGridBag().setVertical(true); |
---|
| 1941 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1617 | 1942 | |
---|
1618 | 1943 | cGridBag camera = new cGridBag(); |
---|
1619 | 1944 | camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
1620 | 1945 | cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1621 | 1946 | camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1622 | | - globalSection.add(camera); |
---|
| 1947 | + colorSection.add(camera); |
---|
1623 | 1948 | |
---|
1624 | 1949 | cGridBag ambient = new cGridBag(); |
---|
1625 | 1950 | ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
1626 | 1951 | ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1627 | 1952 | ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1628 | | - globalSection.add(ambient); |
---|
| 1953 | + colorSection.add(ambient); |
---|
1629 | 1954 | |
---|
1630 | 1955 | cGridBag backlit = new cGridBag(); |
---|
1631 | 1956 | backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
1632 | 1957 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1633 | 1958 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1634 | | - globalSection.add(backlit); |
---|
| 1959 | + colorSection.add(backlit); |
---|
1635 | 1960 | |
---|
1636 | | - cGridBag opacity = new cGridBag(); |
---|
1637 | | - opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1638 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1639 | | - opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1640 | | - globalSection.add(opacity); |
---|
1641 | | - |
---|
1642 | | - panel.add(new JSeparator()); |
---|
| 1961 | + //panel.add(new JSeparator()); |
---|
1643 | 1962 | |
---|
1644 | | - panel.add(globalSection); |
---|
| 1963 | + //panel.add(globalSection); |
---|
1645 | 1964 | |
---|
1646 | 1965 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1647 | 1966 | |
---|
.. | .. |
---|
1683 | 2002 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1684 | 2003 | textureSection.add(opacityPower); |
---|
1685 | 2004 | |
---|
1686 | | - panel.add(new JSeparator()); |
---|
| 2005 | + panel.add(GetSeparator()); |
---|
1687 | 2006 | |
---|
1688 | 2007 | panel.add(textureSection); |
---|
1689 | 2008 | |
---|
.. | .. |
---|
1722 | 2041 | opacityPowerField.addChangeListener(this); |
---|
1723 | 2042 | /**/ |
---|
1724 | 2043 | |
---|
1725 | | - resetSlidersButton.addActionListener(this); |
---|
1726 | 2044 | clearMaterialButton.addActionListener(this); |
---|
1727 | 2045 | createMaterialButton.addActionListener(this); |
---|
1728 | | - |
---|
1729 | | - propagateToggle.addItemListener(this); |
---|
1730 | | - multiplyToggle.addItemListener(this); |
---|
| 2046 | + |
---|
| 2047 | + if (Globals.ADVANCED) |
---|
| 2048 | + { |
---|
| 2049 | + resetSlidersButton.addActionListener(this); |
---|
| 2050 | + propagateToggle.addItemListener(this); |
---|
| 2051 | + multiplyToggle.addItemListener(this); |
---|
| 2052 | + } |
---|
1731 | 2053 | } |
---|
1732 | 2054 | |
---|
1733 | 2055 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1745 | 2067 | // 3D models |
---|
1746 | 2068 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1747 | 2069 | { |
---|
1748 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1749 | | - LoadFile(filename, lastConverter); |
---|
| 2070 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2071 | + //LoadFile(filename, lastConverter); |
---|
| 2072 | + LoadObjFile(filename); // New 3ds loader |
---|
1750 | 2073 | continue; |
---|
1751 | 2074 | } |
---|
1752 | 2075 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
1898 | 2221 | |
---|
1899 | 2222 | //? flashIt = false; |
---|
1900 | 2223 | CameraPane pane = (CameraPane) cameraView; |
---|
1901 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2224 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1902 | 2225 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1903 | 2226 | |
---|
1904 | 2227 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1947 | 2270 | e2.printStackTrace(); |
---|
1948 | 2271 | } |
---|
1949 | 2272 | } |
---|
| 2273 | + |
---|
1950 | 2274 | LoadJMEThread loadThread; |
---|
1951 | 2275 | |
---|
1952 | 2276 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2004 | 2328 | //LoadFile0(filename, converter); |
---|
2005 | 2329 | } |
---|
2006 | 2330 | } |
---|
| 2331 | + |
---|
2007 | 2332 | LoadOBJThread loadObjThread; |
---|
2008 | 2333 | |
---|
2009 | 2334 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2082 | 2407 | |
---|
2083 | 2408 | void LoadObjFile(String fullname) |
---|
2084 | 2409 | { |
---|
2085 | | - /* |
---|
| 2410 | + System.out.println("Loading " + fullname); |
---|
| 2411 | + /**/ |
---|
2086 | 2412 | //lastFilename = fullname; |
---|
2087 | 2413 | if(loadObjThread == null) |
---|
2088 | 2414 | { |
---|
2089 | | - loadObjThread = new LoadOBJThread(); |
---|
2090 | | - loadObjThread.start(); |
---|
| 2415 | + loadObjThread = new LoadOBJThread(); |
---|
| 2416 | + loadObjThread.start(); |
---|
2091 | 2417 | } |
---|
2092 | 2418 | |
---|
2093 | 2419 | loadObjThread.add(fullname); |
---|
2094 | | - */ |
---|
| 2420 | + /**/ |
---|
2095 | 2421 | |
---|
2096 | | - System.out.println("Loading " + fullname); |
---|
2097 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2422 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2098 | 2423 | } |
---|
2099 | 2424 | |
---|
2100 | 2425 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2355 | 2680 | |
---|
2356 | 2681 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2357 | 2682 | { |
---|
2358 | | - if (GrafreeD.standAlone) |
---|
| 2683 | + if (Grafreed.standAlone) |
---|
2359 | 2684 | { |
---|
2360 | 2685 | /**/ |
---|
2361 | 2686 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2362 | | - browser.show(); |
---|
| 2687 | + browser.setVisible(true); |
---|
2363 | 2688 | String filename = browser.getFile(); |
---|
2364 | 2689 | if (filename != null && filename.length() > 0) |
---|
2365 | 2690 | { |
---|
.. | .. |
---|
2470 | 2795 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2471 | 2796 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2472 | 2797 | } |
---|
| 2798 | + |
---|
2473 | 2799 | //cJME.count++; |
---|
2474 | 2800 | //cJME.count %= 12; |
---|
2475 | 2801 | if (gc) |
---|
.. | .. |
---|
2653 | 2979 | } |
---|
2654 | 2980 | } |
---|
2655 | 2981 | } |
---|
| 2982 | + |
---|
2656 | 2983 | cFileSystemPane FSPane; |
---|
2657 | 2984 | |
---|
2658 | 2985 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2706 | 3033 | } |
---|
2707 | 3034 | } |
---|
2708 | 3035 | } |
---|
| 3036 | + |
---|
2709 | 3037 | freezematerial = false; |
---|
2710 | 3038 | } |
---|
2711 | 3039 | |
---|
2712 | 3040 | void SetMaterial(Object3D object) |
---|
2713 | 3041 | { |
---|
| 3042 | + latestObject = object; |
---|
| 3043 | + |
---|
2714 | 3044 | cMaterial mat = object.material; |
---|
2715 | 3045 | |
---|
2716 | 3046 | if (mat == null) |
---|
.. | .. |
---|
2719 | 3049 | return; |
---|
2720 | 3050 | } |
---|
2721 | 3051 | |
---|
2722 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 3052 | + if (multiplyToggle != null) |
---|
| 3053 | + multiplyToggle.setSelected(mat.multiply); |
---|
2723 | 3054 | |
---|
2724 | 3055 | assert (object.projectedVertices != null); |
---|
2725 | 3056 | |
---|
.. | .. |
---|
2821 | 3152 | // } |
---|
2822 | 3153 | |
---|
2823 | 3154 | /**/ |
---|
2824 | | - if (deselect) |
---|
| 3155 | + if (deselect || child == null) |
---|
2825 | 3156 | { |
---|
2826 | 3157 | //group.deselectAll(); |
---|
2827 | 3158 | //freeze = true; |
---|
2828 | 3159 | GetTree().clearSelection(); |
---|
2829 | 3160 | //freeze = false; |
---|
| 3161 | + |
---|
| 3162 | + if (child == null) |
---|
| 3163 | + { |
---|
| 3164 | + return; |
---|
| 3165 | + } |
---|
2830 | 3166 | } |
---|
2831 | 3167 | |
---|
2832 | 3168 | //group.addSelectee(child); |
---|
.. | .. |
---|
2895 | 3231 | cameraView.ToggleDL(); |
---|
2896 | 3232 | cameraView.repaint(); |
---|
2897 | 3233 | return; |
---|
2898 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3234 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2899 | 3235 | { |
---|
2900 | 3236 | cameraView.ToggleTexture(); |
---|
2901 | 3237 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
2934 | 3270 | frame.validate(); |
---|
2935 | 3271 | |
---|
2936 | 3272 | return; |
---|
2937 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3273 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
2938 | 3274 | { |
---|
2939 | | - cameraView.ToggleRandom(); |
---|
| 3275 | + cameraView.ToggleSwitch(); |
---|
2940 | 3276 | cameraView.repaint(); |
---|
2941 | 3277 | return; |
---|
2942 | 3278 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
2965 | 3301 | { |
---|
2966 | 3302 | copy.live ^= true; |
---|
2967 | 3303 | return; |
---|
| 3304 | + } else if (event.getSource() == selectableCB) |
---|
| 3305 | + { |
---|
| 3306 | + copy.dontselect ^= true; |
---|
| 3307 | + return; |
---|
2968 | 3308 | } else if (event.getSource() == hideCB) |
---|
2969 | 3309 | { |
---|
2970 | 3310 | copy.hide ^= true; |
---|
.. | .. |
---|
2979 | 3319 | if (event.getSource() == randomCB) |
---|
2980 | 3320 | { |
---|
2981 | 3321 | copy.random ^= true; |
---|
| 3322 | + objEditor.refreshContents(); |
---|
2982 | 3323 | return; |
---|
2983 | 3324 | } |
---|
2984 | 3325 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3002 | 3343 | |
---|
3003 | 3344 | public void actionPerformed(ActionEvent event) |
---|
3004 | 3345 | { |
---|
| 3346 | + Object source = event.getSource(); |
---|
3005 | 3347 | // SCRIPT DIALOG |
---|
3006 | | - if (event.getSource() == okbutton) |
---|
| 3348 | + if (source == okbutton) |
---|
3007 | 3349 | { |
---|
3008 | 3350 | textpanel.setVisible(false); |
---|
3009 | 3351 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3015 | 3357 | textarea = null; |
---|
3016 | 3358 | textpanel = null; |
---|
3017 | 3359 | } |
---|
3018 | | - if (event.getSource() == cancelbutton) |
---|
| 3360 | + if (source == cancelbutton) |
---|
3019 | 3361 | { |
---|
3020 | 3362 | textpanel.setVisible(false); |
---|
3021 | 3363 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3027 | 3369 | //applySelf(); |
---|
3028 | 3370 | //client.refreshEditWindow(); |
---|
3029 | 3371 | //refreshContents(); |
---|
3030 | | - if (event.getSource() == nameField) |
---|
| 3372 | + if (source == nameField) |
---|
3031 | 3373 | { |
---|
3032 | 3374 | //System.out.println("ObjEditor " + event); |
---|
3033 | 3375 | applySelf0(true); |
---|
3034 | 3376 | //parent.applySelf(); |
---|
3035 | 3377 | objEditor.refreshContents(); |
---|
3036 | | - } else if (event.getSource() == resetButton) |
---|
| 3378 | + } else if (source == resetButton) |
---|
3037 | 3379 | { |
---|
3038 | 3380 | CameraPane.fullreset = true; |
---|
3039 | 3381 | copy.Reset(); // ResetMeshes(); |
---|
3040 | 3382 | copy.Touch(); |
---|
3041 | 3383 | objEditor.refreshContents(); |
---|
3042 | | - } else if (event.getSource() == stepItem) |
---|
| 3384 | + } else if (source == stepItem) |
---|
3043 | 3385 | { |
---|
3044 | 3386 | //cameraView.ONESTEP = true; |
---|
3045 | 3387 | Globals.ONESTEP = true; |
---|
3046 | 3388 | cameraView.repaint(); |
---|
3047 | 3389 | return; |
---|
3048 | | - } else if (event.getSource() == stepButton) |
---|
| 3390 | + } else if (source == stepButton) |
---|
3049 | 3391 | { |
---|
3050 | 3392 | copy.Step(); |
---|
3051 | 3393 | copy.Touch(); |
---|
3052 | 3394 | objEditor.refreshContents(); |
---|
3053 | | - } else if (event.getSource() == slowerButton) |
---|
| 3395 | + } else if (source == slowerButton) |
---|
3054 | 3396 | { |
---|
3055 | 3397 | copy.Slower(); |
---|
3056 | 3398 | copy.Touch(); |
---|
3057 | 3399 | objEditor.refreshContents(); |
---|
3058 | | - } else if (event.getSource() == fasterButton) |
---|
| 3400 | + } else if (source == fasterButton) |
---|
3059 | 3401 | { |
---|
3060 | 3402 | copy.Faster(); |
---|
3061 | 3403 | copy.Touch(); |
---|
3062 | 3404 | objEditor.refreshContents(); |
---|
3063 | | - } else if (event.getSource() == remarkButton) |
---|
| 3405 | + } else if (source == remarkButton) |
---|
3064 | 3406 | { |
---|
3065 | 3407 | copy.Remark(); |
---|
3066 | 3408 | copy.Touch(); |
---|
3067 | 3409 | objEditor.refreshContents(); |
---|
3068 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3410 | + } else if (source == stepAllButton) |
---|
3069 | 3411 | { |
---|
3070 | 3412 | copy.StepAll(); |
---|
3071 | 3413 | copy.Touch(); |
---|
3072 | 3414 | objEditor.refreshContents(); |
---|
3073 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3415 | + } else if (source == resetAllButton) |
---|
3074 | 3416 | { |
---|
3075 | 3417 | //CameraPane.fullreset = true; |
---|
3076 | 3418 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3103 | 3445 | // Close(); |
---|
3104 | 3446 | // } |
---|
3105 | 3447 | // else |
---|
3106 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3448 | + if (source == resetSlidersButton) |
---|
3107 | 3449 | { |
---|
3108 | 3450 | ResetSliders(); |
---|
3109 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3451 | + } else if (source == clearMaterialButton) |
---|
3110 | 3452 | { |
---|
3111 | 3453 | ClearMaterial(); |
---|
3112 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3454 | + } else if (source == createMaterialButton) |
---|
3113 | 3455 | { |
---|
3114 | 3456 | CreateMaterial(); |
---|
3115 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3457 | + } else if (source == clearPanelButton) |
---|
3116 | 3458 | { |
---|
3117 | 3459 | copy.ClearUI(); |
---|
3118 | 3460 | refreshContents(true); |
---|
3119 | | - } /* |
---|
3120 | | - } |
---|
3121 | | - |
---|
3122 | | - public boolean action(Event event, Object arg) |
---|
3123 | | - { |
---|
3124 | | - */ else if (event.getSource() == closeItem) |
---|
| 3461 | + } else if (source == importGFDItem) |
---|
| 3462 | + { |
---|
| 3463 | + ImportGFD(); |
---|
| 3464 | + } else |
---|
| 3465 | + if (source == importVRMLX3DItem) |
---|
| 3466 | + { |
---|
| 3467 | + ImportVRMLX3D(); |
---|
| 3468 | + } else |
---|
| 3469 | + if (source == import3DSItem) |
---|
| 3470 | + { |
---|
| 3471 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3472 | + } else |
---|
| 3473 | + if (source == importOBJItem) |
---|
| 3474 | + { |
---|
| 3475 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3476 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3477 | + browser.setVisible(true); |
---|
| 3478 | + String filename = browser.getFile(); |
---|
| 3479 | + if (filename != null && filename.length() > 0) |
---|
| 3480 | + { |
---|
| 3481 | + String fullname = browser.getDirectory() + filename; |
---|
| 3482 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3483 | + } |
---|
| 3484 | + } else |
---|
| 3485 | + if (source == closeItem) |
---|
3125 | 3486 | { |
---|
3126 | 3487 | Close(); |
---|
3127 | 3488 | //return true; |
---|
3128 | | - } else if (event.getSource() == loadItem) |
---|
| 3489 | + } else if (source == openItem) |
---|
3129 | 3490 | { |
---|
3130 | | - load(); |
---|
| 3491 | + Open(); |
---|
3131 | 3492 | //return true; |
---|
3132 | | - } else if (event.getSource() == saveItem) |
---|
| 3493 | + } else if (source == newItem) |
---|
| 3494 | + { |
---|
| 3495 | + New(); |
---|
| 3496 | + } else if (source == saveItem) |
---|
3133 | 3497 | { |
---|
3134 | 3498 | save(); |
---|
3135 | 3499 | //return true; |
---|
3136 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3500 | + } else if (source == saveAsItem) |
---|
3137 | 3501 | { |
---|
3138 | 3502 | saveAs(); |
---|
3139 | 3503 | //return true; |
---|
3140 | | - } else if (event.getSource() == reexportItem) |
---|
| 3504 | + } else if (source == reexportItem) |
---|
3141 | 3505 | { |
---|
3142 | 3506 | reexport(); |
---|
3143 | 3507 | //return true; |
---|
3144 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3508 | + } else if (source == exportAsItem) |
---|
3145 | 3509 | { |
---|
3146 | 3510 | export(); |
---|
3147 | 3511 | //return true; |
---|
3148 | | - } else if (event.getSource() == povItem) |
---|
| 3512 | + } else if (source == povItem) |
---|
3149 | 3513 | { |
---|
3150 | 3514 | generatePOV(); |
---|
3151 | 3515 | //return true; |
---|
3152 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3516 | + } else if (event.getSource() == archiveItem) |
---|
| 3517 | + { |
---|
| 3518 | + cTools.Archive(frame); |
---|
| 3519 | + return; |
---|
| 3520 | + } else if (source == zBufferItem) |
---|
3153 | 3521 | { |
---|
3154 | 3522 | try |
---|
3155 | 3523 | { |
---|
.. | .. |
---|
3171 | 3539 | cameraView.repaint(); |
---|
3172 | 3540 | //return true; |
---|
3173 | 3541 | } |
---|
3174 | | - */ else if (event.getSource() == editCameraItem) |
---|
3175 | | - { |
---|
3176 | | - cameraView.ProtectCamera(); |
---|
3177 | | - cameraView.repaint(); |
---|
3178 | | - return; |
---|
3179 | | - } else if (event.getSource() == revertCameraItem) |
---|
3180 | | - { |
---|
3181 | | - cameraView.RevertCamera(); |
---|
3182 | | - cameraView.repaint(); |
---|
3183 | | - return; |
---|
3184 | | -// } else if (event.getSource() == textureButton) |
---|
3185 | | -// { |
---|
3186 | | -// return; // true; |
---|
3187 | | - } else // combos... |
---|
3188 | | - if (event.getSource() == texresMenu) |
---|
| 3542 | + */ else // combos... |
---|
| 3543 | + if (source == texresMenu) |
---|
3189 | 3544 | { |
---|
3190 | 3545 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3191 | 3546 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3197 | 3552 | } |
---|
3198 | 3553 | } |
---|
3199 | 3554 | |
---|
| 3555 | + void New() |
---|
| 3556 | + { |
---|
| 3557 | + while (copy.Size() > 1) |
---|
| 3558 | + { |
---|
| 3559 | + copy.remove(1); |
---|
| 3560 | + } |
---|
| 3561 | + |
---|
| 3562 | + ResetModel(); |
---|
| 3563 | + objEditor.refreshContents(); |
---|
| 3564 | + } |
---|
| 3565 | + |
---|
| 3566 | + static public byte[] Compress(Object3D o) |
---|
| 3567 | + { |
---|
| 3568 | + try |
---|
| 3569 | + { |
---|
| 3570 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3571 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3572 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
| 3573 | + |
---|
| 3574 | + Object3D parent = o.parent; |
---|
| 3575 | + o.parent = null; |
---|
| 3576 | + |
---|
| 3577 | + out.writeObject(o); |
---|
| 3578 | + |
---|
| 3579 | + o.parent = parent; |
---|
| 3580 | + |
---|
| 3581 | + out.flush(); |
---|
| 3582 | + |
---|
| 3583 | + baos //zstream |
---|
| 3584 | + .close(); |
---|
| 3585 | + out.close(); |
---|
| 3586 | + |
---|
| 3587 | + byte[] bytes = baos.toByteArray(); |
---|
| 3588 | + |
---|
| 3589 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 3590 | + return bytes; |
---|
| 3591 | + } catch (Exception e) |
---|
| 3592 | + { |
---|
| 3593 | + System.err.println(e); |
---|
| 3594 | + return null; |
---|
| 3595 | + } |
---|
| 3596 | + } |
---|
| 3597 | + |
---|
| 3598 | + static public Object Uncompress(byte[] bytes) |
---|
| 3599 | + { |
---|
| 3600 | + System.out.println("restore #bytes = " + bytes.length); |
---|
| 3601 | + try |
---|
| 3602 | + { |
---|
| 3603 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3604 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3605 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
| 3606 | + Object obj = in.readObject(); |
---|
| 3607 | + |
---|
| 3608 | + bais //istream |
---|
| 3609 | + .close(); |
---|
| 3610 | + in.close(); |
---|
| 3611 | + |
---|
| 3612 | + return obj; |
---|
| 3613 | + } catch (Exception e) |
---|
| 3614 | + { |
---|
| 3615 | + System.err.println(e); |
---|
| 3616 | + return null; |
---|
| 3617 | + } |
---|
| 3618 | + } |
---|
| 3619 | + |
---|
| 3620 | + static public Object clone(Object o) |
---|
| 3621 | + { |
---|
| 3622 | + try |
---|
| 3623 | + { |
---|
| 3624 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3625 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3626 | + |
---|
| 3627 | + out.writeObject(o); |
---|
| 3628 | + |
---|
| 3629 | + out.flush(); |
---|
| 3630 | + out.close(); |
---|
| 3631 | + |
---|
| 3632 | + byte[] bytes = baos.toByteArray(); |
---|
| 3633 | + |
---|
| 3634 | + System.out.println("clone = " + bytes.length); |
---|
| 3635 | + |
---|
| 3636 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3637 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3638 | + Object obj = in.readObject(); |
---|
| 3639 | + in.close(); |
---|
| 3640 | + |
---|
| 3641 | + return obj; |
---|
| 3642 | + } catch (Exception e) |
---|
| 3643 | + { |
---|
| 3644 | + System.err.println(e); |
---|
| 3645 | + return null; |
---|
| 3646 | + } |
---|
| 3647 | + } |
---|
| 3648 | + |
---|
| 3649 | + cRadio GetCurrentTab() |
---|
| 3650 | + { |
---|
| 3651 | + cRadio ab; |
---|
| 3652 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3653 | + { |
---|
| 3654 | + ab = (cRadio)e.nextElement(); |
---|
| 3655 | + if(ab.GetObject() == copy) |
---|
| 3656 | + { |
---|
| 3657 | + return ab; |
---|
| 3658 | + } |
---|
| 3659 | + } |
---|
| 3660 | + |
---|
| 3661 | + return null; |
---|
| 3662 | + } |
---|
| 3663 | + |
---|
| 3664 | + |
---|
| 3665 | + public void Save() |
---|
| 3666 | + { |
---|
| 3667 | + //Save(true); |
---|
| 3668 | + Replace(); |
---|
| 3669 | + } |
---|
| 3670 | + |
---|
| 3671 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 3672 | + { |
---|
| 3673 | + if (compress.length != name.length) |
---|
| 3674 | + { |
---|
| 3675 | + return false; |
---|
| 3676 | + } |
---|
| 3677 | + |
---|
| 3678 | + for (int i=compress.length; --i>=0;) |
---|
| 3679 | + { |
---|
| 3680 | + if (compress[i] != name[i]) |
---|
| 3681 | + return false; |
---|
| 3682 | + } |
---|
| 3683 | + |
---|
| 3684 | + return true; |
---|
| 3685 | + } |
---|
| 3686 | + |
---|
| 3687 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3688 | + |
---|
| 3689 | + public boolean Save(boolean user) |
---|
| 3690 | + { |
---|
| 3691 | + System.err.println("Save"); |
---|
| 3692 | + |
---|
| 3693 | + cRadio tab = GetCurrentTab(); |
---|
| 3694 | + |
---|
| 3695 | + byte[] compress = CompressCopy(); // Saved version. No need for "Replace". |
---|
| 3696 | + |
---|
| 3697 | + boolean thesame = false; |
---|
| 3698 | + |
---|
| 3699 | + // Quick heuristic using length. Works only when stream is compressed. |
---|
| 3700 | + if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 3701 | + { |
---|
| 3702 | + thesame = true; |
---|
| 3703 | + } |
---|
| 3704 | + |
---|
| 3705 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3706 | + if (!thesame) |
---|
| 3707 | + { |
---|
| 3708 | + //tab.user[tab.versionindex] = user; |
---|
| 3709 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 3710 | + |
---|
| 3711 | + copy.versions[++copy.versionindex] = compress; |
---|
| 3712 | + |
---|
| 3713 | + // if (increment) |
---|
| 3714 | + // tab.versionindex++; |
---|
| 3715 | + } |
---|
| 3716 | + |
---|
| 3717 | + //copy.RestoreBigData(versiontable); |
---|
| 3718 | + |
---|
| 3719 | + //assert(hashtable.isEmpty()); |
---|
| 3720 | + |
---|
| 3721 | + for (int i = copy.versionindex+1; i < copy.versions.length; i++) |
---|
| 3722 | + { |
---|
| 3723 | + //tab.user[i] = false; |
---|
| 3724 | + copy.versions[i] = null; |
---|
| 3725 | + } |
---|
| 3726 | + |
---|
| 3727 | + SetUndoStates(); |
---|
| 3728 | + |
---|
| 3729 | + // test save |
---|
| 3730 | + if (false) |
---|
| 3731 | + { |
---|
| 3732 | + try |
---|
| 3733 | + { |
---|
| 3734 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
| 3735 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3736 | + |
---|
| 3737 | + p.writeObject(copy); |
---|
| 3738 | + |
---|
| 3739 | + p.flush(); |
---|
| 3740 | + |
---|
| 3741 | + ostream.close(); |
---|
| 3742 | + } catch (Exception e) |
---|
| 3743 | + { |
---|
| 3744 | + e.printStackTrace(); |
---|
| 3745 | + } |
---|
| 3746 | + } |
---|
| 3747 | + |
---|
| 3748 | + return !thesame; |
---|
| 3749 | + } |
---|
| 3750 | + |
---|
| 3751 | + void CopyChanged(Object3D obj) |
---|
| 3752 | + { |
---|
| 3753 | + SetUndoStates(); |
---|
| 3754 | + |
---|
| 3755 | + boolean temp = CameraPane.SWITCH; |
---|
| 3756 | + CameraPane.SWITCH = false; |
---|
| 3757 | + |
---|
| 3758 | + copy.ExtractBigData(versiontable); |
---|
| 3759 | + |
---|
| 3760 | + copy.clear(); |
---|
| 3761 | + |
---|
| 3762 | + copy.skyboxname = obj.skyboxname; |
---|
| 3763 | + copy.skyboxext = obj.skyboxext; |
---|
| 3764 | + |
---|
| 3765 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3766 | + { |
---|
| 3767 | + copy.add(obj.get(i)); |
---|
| 3768 | + } |
---|
| 3769 | + |
---|
| 3770 | + copy.RestoreBigData(versiontable); |
---|
| 3771 | + |
---|
| 3772 | + CameraPane.SWITCH = temp; |
---|
| 3773 | + |
---|
| 3774 | + //assert(hashtable.isEmpty()); |
---|
| 3775 | + |
---|
| 3776 | + copy.Touch(); |
---|
| 3777 | + |
---|
| 3778 | + ResetModel(); |
---|
| 3779 | + copy.HardTouch(); // recompile? |
---|
| 3780 | + |
---|
| 3781 | + cRadio ab; |
---|
| 3782 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3783 | + { |
---|
| 3784 | + ab = (cRadio)e.nextElement(); |
---|
| 3785 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3786 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3787 | + if (test != null) |
---|
| 3788 | + { |
---|
| 3789 | + test.editWindow = ab.object.editWindow; |
---|
| 3790 | + ab.object = test; |
---|
| 3791 | + } |
---|
| 3792 | + } |
---|
| 3793 | + |
---|
| 3794 | + refreshContents(); |
---|
| 3795 | + } |
---|
| 3796 | + |
---|
| 3797 | + cButton undoButton; |
---|
| 3798 | + cButton restoreButton; |
---|
| 3799 | + cButton replaceButton; |
---|
| 3800 | + cButton redoButton; |
---|
| 3801 | + |
---|
| 3802 | + boolean muteSlider; |
---|
| 3803 | + |
---|
| 3804 | + int VersionCount() |
---|
| 3805 | + { |
---|
| 3806 | + int count = 0; |
---|
| 3807 | + |
---|
| 3808 | + for (int i = copy.versions.length; --i >= 0;) |
---|
| 3809 | + { |
---|
| 3810 | + if (copy.versions[i] != null) |
---|
| 3811 | + count++; |
---|
| 3812 | + } |
---|
| 3813 | + |
---|
| 3814 | + return count; |
---|
| 3815 | + } |
---|
| 3816 | + |
---|
| 3817 | + void SetUndoStates() |
---|
| 3818 | + { |
---|
| 3819 | + cRadio tab = GetCurrentTab(); |
---|
| 3820 | + |
---|
| 3821 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 3822 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 3823 | + |
---|
| 3824 | + undoButton.setEnabled(copy.versionindex > 0); |
---|
| 3825 | + redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null); |
---|
| 3826 | + |
---|
| 3827 | + muteSlider = true; |
---|
| 3828 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 3829 | + versionSlider.setInteger(copy.versionindex); |
---|
| 3830 | + muteSlider = false; |
---|
| 3831 | + } |
---|
| 3832 | + |
---|
| 3833 | + public boolean Undo() |
---|
| 3834 | + { |
---|
| 3835 | + // Option? |
---|
| 3836 | + Replace(); |
---|
| 3837 | + |
---|
| 3838 | + System.err.println("Undo"); |
---|
| 3839 | + |
---|
| 3840 | + cRadio tab = GetCurrentTab(); |
---|
| 3841 | + |
---|
| 3842 | + if (copy.versionindex == 0) |
---|
| 3843 | + { |
---|
| 3844 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3845 | + return false; |
---|
| 3846 | + } |
---|
| 3847 | + |
---|
| 3848 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 3849 | +// { |
---|
| 3850 | +// if (Save(false)) |
---|
| 3851 | +// tab.versionindex -= 1; |
---|
| 3852 | +// else |
---|
| 3853 | +// { |
---|
| 3854 | +// if (tab.versionindex <= 0) |
---|
| 3855 | +// return false; |
---|
| 3856 | +// else |
---|
| 3857 | +// tab.versionindex -= 1; |
---|
| 3858 | +// } |
---|
| 3859 | +// } |
---|
| 3860 | + |
---|
| 3861 | + copy.versionindex -= 1; |
---|
| 3862 | + |
---|
| 3863 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3864 | + |
---|
| 3865 | + return true; |
---|
| 3866 | + } |
---|
| 3867 | + |
---|
| 3868 | + public boolean Restore() |
---|
| 3869 | + { |
---|
| 3870 | + System.err.println("Restore"); |
---|
| 3871 | + |
---|
| 3872 | + cRadio tab = GetCurrentTab(); |
---|
| 3873 | + |
---|
| 3874 | + if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 3875 | + { |
---|
| 3876 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3877 | + return false; |
---|
| 3878 | + } |
---|
| 3879 | + |
---|
| 3880 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3881 | + |
---|
| 3882 | + return true; |
---|
| 3883 | + } |
---|
| 3884 | + |
---|
| 3885 | + public boolean Replace() |
---|
| 3886 | + { |
---|
| 3887 | + System.err.println("Replace"); |
---|
| 3888 | + |
---|
| 3889 | + cRadio tab = GetCurrentTab(); |
---|
| 3890 | + |
---|
| 3891 | + if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 3892 | + { |
---|
| 3893 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3894 | + return false; |
---|
| 3895 | + } |
---|
| 3896 | + |
---|
| 3897 | + copy.versions[copy.versionindex] = CompressCopy(); |
---|
| 3898 | + |
---|
| 3899 | + return true; |
---|
| 3900 | + } |
---|
| 3901 | + |
---|
| 3902 | + public void Redo() |
---|
| 3903 | + { |
---|
| 3904 | + // Option? |
---|
| 3905 | + Replace(); |
---|
| 3906 | + |
---|
| 3907 | + cRadio tab = GetCurrentTab(); |
---|
| 3908 | + |
---|
| 3909 | + if (copy.versions[copy.versionindex + 1] == null) |
---|
| 3910 | + { |
---|
| 3911 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3912 | + return; |
---|
| 3913 | + } |
---|
| 3914 | + |
---|
| 3915 | + copy.versionindex += 1; |
---|
| 3916 | + |
---|
| 3917 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3918 | + |
---|
| 3919 | + //if (!tab.user[tab.versionindex]) |
---|
| 3920 | + // tab.graphs[tab.versionindex] = null; |
---|
| 3921 | + } |
---|
| 3922 | + |
---|
| 3923 | + void ImportGFD() |
---|
| 3924 | + { |
---|
| 3925 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
| 3926 | + browser.show(); |
---|
| 3927 | + String filename = browser.getFile(); |
---|
| 3928 | + if (filename != null && filename.length() > 0) |
---|
| 3929 | + { |
---|
| 3930 | + String fullname = browser.getDirectory() + filename; |
---|
| 3931 | + |
---|
| 3932 | + //Object3D readobj = |
---|
| 3933 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3934 | + //makeSomething(readobj); |
---|
| 3935 | + } |
---|
| 3936 | + } |
---|
| 3937 | + |
---|
| 3938 | + void ImportVRMLX3D() |
---|
| 3939 | + { |
---|
| 3940 | + if (Grafreed.standAlone) |
---|
| 3941 | + { |
---|
| 3942 | + /**/ |
---|
| 3943 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3944 | + browser.show(); |
---|
| 3945 | + String filename = browser.getFile(); |
---|
| 3946 | + if (filename != null && filename.length() > 0) |
---|
| 3947 | + { |
---|
| 3948 | + String fullname = browser.getDirectory() + filename; |
---|
| 3949 | + LoadVRMLX3D(fullname); |
---|
| 3950 | + } |
---|
| 3951 | + /**/ |
---|
| 3952 | + } |
---|
| 3953 | + } |
---|
| 3954 | + |
---|
3200 | 3955 | void ToggleAnimation() |
---|
3201 | 3956 | { |
---|
3202 | 3957 | if (!Globals.ANIMATION) |
---|
.. | .. |
---|
3212 | 3967 | |
---|
3213 | 3968 | Globals.ANIMATION ^= true; |
---|
3214 | 3969 | |
---|
3215 | | - GrafreeD.wav.cursor = 0; |
---|
3216 | | - GrafreeD.wav.loop = 0; |
---|
| 3970 | + Grafreed.wav.cursor = 0; |
---|
| 3971 | + Grafreed.wav.loop = 0; |
---|
3217 | 3972 | } |
---|
3218 | 3973 | } else |
---|
3219 | 3974 | { |
---|
.. | .. |
---|
3234 | 3989 | callee.refreshContents(); |
---|
3235 | 3990 | } else |
---|
3236 | 3991 | { |
---|
3237 | | - new Exception().printStackTrace(); |
---|
3238 | 3992 | System.exit(0); |
---|
3239 | 3993 | } |
---|
3240 | 3994 | } |
---|
.. | .. |
---|
3264 | 4018 | void CreateMaterial() |
---|
3265 | 4019 | { |
---|
3266 | 4020 | //copy.ClearMaterial(); // PATCH |
---|
3267 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 4021 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3268 | 4022 | if (copy.selection.size() > 0) |
---|
3269 | 4023 | //SetMaterial(copy); |
---|
3270 | 4024 | { |
---|
.. | .. |
---|
3315 | 4069 | assert false; |
---|
3316 | 4070 | } |
---|
3317 | 4071 | |
---|
3318 | | - void EditSelection() |
---|
| 4072 | + void EditSelection(boolean newWindow) |
---|
3319 | 4073 | { |
---|
3320 | 4074 | } |
---|
3321 | 4075 | |
---|
.. | .. |
---|
3323 | 4077 | { |
---|
3324 | 4078 | copy.ResetBlockLoop(); // temporary problem |
---|
3325 | 4079 | |
---|
3326 | | - boolean random = CameraPane.RANDOM; |
---|
3327 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 4080 | + boolean random = CameraPane.SWITCH; |
---|
| 4081 | + CameraPane.SWITCH = false; // parse everything |
---|
3328 | 4082 | copy.ResetDisplayList(); |
---|
3329 | 4083 | copy.HardTouch(); |
---|
3330 | | - CameraPane.RANDOM = random; |
---|
| 4084 | + CameraPane.SWITCH = random; |
---|
3331 | 4085 | } |
---|
3332 | 4086 | |
---|
3333 | 4087 | // public void applySelf() |
---|
.. | .. |
---|
3401 | 4155 | { |
---|
3402 | 4156 | //System.out.println("Propagate = " + propagate); |
---|
3403 | 4157 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 4158 | + |
---|
| 4159 | + if (copy.material != null) |
---|
| 4160 | + { |
---|
| 4161 | + cMaterial mat = copy.material; |
---|
| 4162 | + |
---|
| 4163 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4164 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 4165 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4166 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4167 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4168 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4169 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4170 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4171 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4172 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4173 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4174 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4175 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4176 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4177 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4178 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4179 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4180 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4181 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4182 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4183 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4184 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4185 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4186 | + } |
---|
| 4187 | + |
---|
3404 | 4188 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3405 | 4189 | { |
---|
3406 | 4190 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3429 | 4213 | //copy.Touch(); |
---|
3430 | 4214 | } |
---|
3431 | 4215 | |
---|
| 4216 | + cNumberSlider versionSlider; |
---|
| 4217 | + |
---|
3432 | 4218 | public void stateChanged(ChangeEvent e) |
---|
3433 | 4219 | { |
---|
3434 | 4220 | // assert(false); |
---|
| 4221 | + if (e.getSource() == versionSlider) |
---|
| 4222 | + { |
---|
| 4223 | + if (muteSlider) |
---|
| 4224 | + return; |
---|
| 4225 | + |
---|
| 4226 | + int version = versionSlider.getInteger(); |
---|
| 4227 | + |
---|
| 4228 | + if (copy.versions[version] != null) |
---|
| 4229 | + { |
---|
| 4230 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version])); |
---|
| 4231 | + } |
---|
| 4232 | + |
---|
| 4233 | + return; |
---|
| 4234 | + } |
---|
3435 | 4235 | |
---|
3436 | 4236 | if (freezematerial) |
---|
3437 | 4237 | { |
---|
.. | .. |
---|
3516 | 4316 | } |
---|
3517 | 4317 | |
---|
3518 | 4318 | if (normalpushField != null) |
---|
3519 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 4319 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3520 | 4320 | } |
---|
3521 | 4321 | |
---|
3522 | 4322 | void SnapObject() |
---|
.. | .. |
---|
3780 | 4580 | |
---|
3781 | 4581 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3782 | 4582 | { |
---|
| 4583 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
| 4584 | + Save(); |
---|
3783 | 4585 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3784 | 4586 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3785 | 4587 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3866 | 4668 | { |
---|
3867 | 4669 | ResetModel(); |
---|
3868 | 4670 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4671 | + |
---|
| 4672 | + if (thing.Size() == 0) |
---|
| 4673 | + { |
---|
| 4674 | + //EditSelection(false); |
---|
| 4675 | + } |
---|
| 4676 | + |
---|
3869 | 4677 | refreshContents(); |
---|
3870 | 4678 | } |
---|
3871 | 4679 | |
---|
.. | .. |
---|
3983 | 4791 | } |
---|
3984 | 4792 | } |
---|
3985 | 4793 | } |
---|
| 4794 | + |
---|
3986 | 4795 | LoadGFDThread loadGFDThread; |
---|
3987 | 4796 | |
---|
3988 | 4797 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4002 | 4811 | |
---|
4003 | 4812 | try |
---|
4004 | 4813 | { |
---|
| 4814 | + // Try compressed version first. |
---|
4005 | 4815 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4006 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4816 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4817 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4007 | 4818 | |
---|
4008 | 4819 | readobj = (Object3D) p.readObject(); |
---|
4009 | 4820 | istream.close(); |
---|
.. | .. |
---|
4011 | 4822 | readobj.ResetDisplayList(); |
---|
4012 | 4823 | } catch (Exception e) |
---|
4013 | 4824 | { |
---|
4014 | | - e.printStackTrace(); |
---|
| 4825 | + if (!e.toString().contains("GZIP")) |
---|
| 4826 | + e.printStackTrace(); |
---|
| 4827 | + |
---|
| 4828 | + try |
---|
| 4829 | + { |
---|
| 4830 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4831 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4832 | + |
---|
| 4833 | + readobj = (Object3D) p.readObject(); |
---|
| 4834 | + istream.close(); |
---|
| 4835 | + |
---|
| 4836 | + readobj.ResetDisplayList(); |
---|
| 4837 | + } catch (Exception e2) |
---|
| 4838 | + { |
---|
| 4839 | + e2.printStackTrace(); |
---|
| 4840 | + } |
---|
4015 | 4841 | } |
---|
4016 | 4842 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4017 | 4843 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4057 | 4883 | |
---|
4058 | 4884 | void LoadIt(Object obj) |
---|
4059 | 4885 | { |
---|
| 4886 | + if (obj == null) |
---|
| 4887 | + { |
---|
| 4888 | + // Invalid file |
---|
| 4889 | + return; |
---|
| 4890 | + } |
---|
| 4891 | + |
---|
4060 | 4892 | System.out.println("Loaded " + obj); |
---|
4061 | 4893 | //new Exception().printStackTrace(); |
---|
4062 | 4894 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4066 | 4898 | |
---|
4067 | 4899 | if (readobj != null) |
---|
4068 | 4900 | { |
---|
| 4901 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 4902 | + // Save(); |
---|
4069 | 4903 | try |
---|
4070 | 4904 | { |
---|
4071 | 4905 | //readobj.deepCopySelf(copy); |
---|
4072 | 4906 | copy.clear(); // june 2014 |
---|
| 4907 | + copy.skyboxname = readobj.skyboxname; |
---|
| 4908 | + copy.skyboxext = readobj.skyboxext; |
---|
4073 | 4909 | for (int i = 0; i < readobj.size(); i++) |
---|
4074 | 4910 | { |
---|
4075 | 4911 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4110 | 4946 | } |
---|
4111 | 4947 | } catch (ClassCastException e) |
---|
4112 | 4948 | { |
---|
| 4949 | + e.printStackTrace(); |
---|
4113 | 4950 | assert (false); |
---|
4114 | 4951 | Composite c = (Composite) copy; |
---|
4115 | 4952 | c.children.clear(); |
---|
.. | .. |
---|
4120 | 4957 | c.addChild(csg); |
---|
4121 | 4958 | } |
---|
4122 | 4959 | |
---|
| 4960 | + copy.versions = readobj.versions; |
---|
| 4961 | + copy.versionindex = readobj.versionindex; |
---|
| 4962 | + |
---|
| 4963 | + if (copy.versions == null) |
---|
| 4964 | + { |
---|
| 4965 | + copy.versions = new byte[100][]; |
---|
| 4966 | + copy.versionindex = -1; |
---|
| 4967 | + } |
---|
| 4968 | + |
---|
| 4969 | + //? SetUndoStates(); |
---|
| 4970 | + |
---|
4123 | 4971 | ResetModel(); |
---|
4124 | 4972 | copy.HardTouch(); // recompile? |
---|
4125 | 4973 | refreshContents(); |
---|
4126 | 4974 | } |
---|
4127 | 4975 | } |
---|
4128 | 4976 | |
---|
4129 | | - void load() // throws ClassNotFoundException |
---|
| 4977 | + void Open() // throws ClassNotFoundException |
---|
4130 | 4978 | { |
---|
4131 | | - if (GrafreeD.standAlone) |
---|
| 4979 | + if (Grafreed.standAlone) |
---|
4132 | 4980 | { |
---|
4133 | 4981 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4134 | 4982 | browser.show(); |
---|
.. | .. |
---|
4215 | 5063 | try |
---|
4216 | 5064 | { |
---|
4217 | 5065 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4218 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 5066 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5067 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4219 | 5068 | |
---|
4220 | 5069 | p.writeObject(copy); |
---|
4221 | 5070 | p.flush(); |
---|
4222 | 5071 | |
---|
| 5072 | + zstream.close(); |
---|
4223 | 5073 | ostream.close(); |
---|
4224 | 5074 | |
---|
4225 | 5075 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4227 | 5077 | //ps.print(buffer.toString()); |
---|
4228 | 5078 | } catch (IOException e) |
---|
4229 | 5079 | { |
---|
| 5080 | + e.printStackTrace(); |
---|
4230 | 5081 | } |
---|
4231 | 5082 | } |
---|
| 5083 | + |
---|
4232 | 5084 | String lastname; |
---|
4233 | 5085 | |
---|
4234 | 5086 | void saveAs() |
---|
4235 | 5087 | { |
---|
4236 | | - if (GrafreeD.standAlone) |
---|
| 5088 | + if (Grafreed.standAlone) |
---|
4237 | 5089 | { |
---|
4238 | 5090 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4239 | 5091 | browser.setVisible(true); |
---|
4240 | 5092 | String filename = browser.getFile(); |
---|
4241 | 5093 | if (filename != null && filename.length() > 0) |
---|
4242 | 5094 | { |
---|
| 5095 | + if (!filename.endsWith(".gfd")) |
---|
| 5096 | + filename += ".gfd"; |
---|
4243 | 5097 | lastname = browser.getDirectory() + filename; |
---|
4244 | 5098 | save(); |
---|
4245 | 5099 | } |
---|
.. | .. |
---|
4338 | 5192 | try |
---|
4339 | 5193 | { |
---|
4340 | 5194 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4341 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4342 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 5195 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5196 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4343 | 5197 | |
---|
4344 | 5198 | Object3D objectparent = obj.parent; |
---|
4345 | 5199 | obj.parent = null; |
---|
4346 | 5200 | |
---|
4347 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 5201 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4348 | 5202 | |
---|
4349 | 5203 | obj.parent = objectparent; |
---|
4350 | 5204 | |
---|
.. | .. |
---|
4356 | 5210 | p.writeObject(object); |
---|
4357 | 5211 | p.flush(); |
---|
4358 | 5212 | |
---|
| 5213 | + zstream.close(); |
---|
4359 | 5214 | ostream.close(); |
---|
4360 | | - // zstream.close(); |
---|
4361 | 5215 | |
---|
4362 | 5216 | // group.selection.get(0).parent = parent; |
---|
4363 | 5217 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4378 | 5232 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4379 | 5233 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4380 | 5234 | copy.generatePOV(buffer); |
---|
4381 | | - if (GrafreeD.standAlone) |
---|
| 5235 | + if (Grafreed.standAlone) |
---|
4382 | 5236 | { |
---|
4383 | 5237 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4384 | 5238 | browser.show(); |
---|
.. | .. |
---|
4404 | 5258 | Object3D client; |
---|
4405 | 5259 | Object3D copy; |
---|
4406 | 5260 | MenuBar menuBar; |
---|
4407 | | - Menu windowMenu; |
---|
4408 | | - MenuItem loadItem; |
---|
| 5261 | + Menu fileMenu; |
---|
| 5262 | + MenuItem newItem; |
---|
| 5263 | + MenuItem openItem; |
---|
4409 | 5264 | MenuItem saveItem; |
---|
4410 | 5265 | MenuItem saveAsItem; |
---|
4411 | 5266 | MenuItem exportAsItem; |
---|
4412 | 5267 | MenuItem reexportItem; |
---|
4413 | 5268 | MenuItem povItem; |
---|
4414 | 5269 | MenuItem closeItem; |
---|
4415 | | - Menu cameraMenu; |
---|
| 5270 | + |
---|
4416 | 5271 | CheckboxMenuItem zBufferItem; |
---|
4417 | 5272 | //MenuItem normalLensItem; |
---|
4418 | | - MenuItem editCameraItem; |
---|
4419 | | - MenuItem revertCameraItem; |
---|
4420 | 5273 | MenuItem stepItem; |
---|
4421 | 5274 | CheckboxMenuItem toggleLiveItem; |
---|
4422 | 5275 | CheckboxMenuItem toggleFullScreenItem; |
---|
.. | .. |
---|
4427 | 5280 | CheckboxMenuItem toggleFootContactItem; |
---|
4428 | 5281 | CheckboxMenuItem toggleDLItem; |
---|
4429 | 5282 | CheckboxMenuItem toggleTextureItem; |
---|
4430 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 5283 | + CheckboxMenuItem toggleSwitchItem; |
---|
4431 | 5284 | CheckboxMenuItem toggleRootItem; |
---|
4432 | 5285 | CheckboxMenuItem animationItem; |
---|
| 5286 | + MenuItem archiveItem; |
---|
4433 | 5287 | CheckboxMenuItem toggleHandleItem; |
---|
4434 | 5288 | CheckboxMenuItem togglePaintItem; |
---|
4435 | 5289 | JSplitPane mainPanel; |
---|
4436 | 5290 | JScrollPane scrollpane; |
---|
| 5291 | + |
---|
4437 | 5292 | JPanel toolbarPanel; |
---|
| 5293 | + |
---|
4438 | 5294 | cGridBag treePanel; |
---|
| 5295 | + |
---|
4439 | 5296 | JPanel radioPanel; |
---|
4440 | 5297 | ButtonGroup buttonGroup; |
---|
4441 | | - cGridBag ctrlPanel; |
---|
| 5298 | + |
---|
| 5299 | + cGridBag toolboxPanel; |
---|
4442 | 5300 | cGridBag materialPanel; |
---|
| 5301 | + cGridBag ctrlPanel; |
---|
| 5302 | + |
---|
4443 | 5303 | JScrollPane infoPanel; |
---|
| 5304 | + |
---|
4444 | 5305 | cGridBag optionsPanel; |
---|
| 5306 | + |
---|
4445 | 5307 | JTabbedPane objectPanel; |
---|
| 5308 | + boolean materialFlushed; |
---|
| 5309 | + Object3D latestObject; |
---|
| 5310 | + |
---|
4446 | 5311 | cGridBag XYZPanel; |
---|
| 5312 | + |
---|
4447 | 5313 | JSplitPane gridPanel; |
---|
4448 | 5314 | JSplitPane bigPanel; |
---|
| 5315 | + |
---|
4449 | 5316 | cGridBag bigThree; |
---|
4450 | 5317 | cGridBag scenePanel; |
---|
4451 | 5318 | cGridBag centralPanel; |
---|
.. | .. |
---|
4560 | 5427 | cNumberSlider fogField; |
---|
4561 | 5428 | JLabel opacityPowerLabel; |
---|
4562 | 5429 | cNumberSlider opacityPowerField; |
---|
4563 | | - JTree jTree; |
---|
| 5430 | + cTree jTree; |
---|
4564 | 5431 | //ObjectUI parent; |
---|
4565 | 5432 | |
---|
4566 | 5433 | cNumberSlider normalpushField; |
---|
| 5434 | + |
---|
| 5435 | + private MenuItem importGFDItem; |
---|
| 5436 | + private MenuItem importVRMLX3DItem; |
---|
| 5437 | + private MenuItem import3DSItem; |
---|
| 5438 | + private MenuItem importOBJItem; |
---|
4567 | 5439 | } |
---|