.. | .. |
---|
4 | 4 | |
---|
5 | 5 | import java.awt.*; |
---|
6 | 6 | import java.awt.event.*; |
---|
| 7 | +import java.awt.image.BufferedImage; |
---|
7 | 8 | import javax.swing.*; |
---|
8 | 9 | import javax.swing.event.*; |
---|
9 | 10 | import javax.swing.text.*; |
---|
.. | .. |
---|
13 | 14 | import javax.swing.plaf.metal.MetalLookAndFeel; |
---|
14 | 15 | //import javax.swing.plaf.ColorUIResource; |
---|
15 | 16 | //import javax.swing.plaf.metal.DefaultMetalTheme; |
---|
| 17 | + |
---|
| 18 | +import javax.swing.plaf.basic.BasicSplitPaneDivider; |
---|
| 19 | +import javax.swing.plaf.basic.BasicSplitPaneUI; |
---|
16 | 20 | |
---|
17 | 21 | //import javax.media.opengl.GLCanvas; |
---|
18 | 22 | |
---|
.. | .. |
---|
30 | 34 | iSendInfo |
---|
31 | 35 | //KeyListener |
---|
32 | 36 | { |
---|
| 37 | + public cToggleButton pinButton; |
---|
33 | 38 | boolean timeline; |
---|
34 | 39 | boolean wasFullScreen; |
---|
35 | 40 | |
---|
36 | 41 | GroupEditor callee; |
---|
37 | 42 | JFrame frame; |
---|
| 43 | + |
---|
| 44 | + static ObjEditor theFrame; |
---|
| 45 | + |
---|
| 46 | + public void AllocProjectedVertices(Object3D object) |
---|
| 47 | + { |
---|
| 48 | + assert (object.projectedVertices != null); |
---|
| 49 | + |
---|
| 50 | + if (object.projectedVertices.length <= 2) |
---|
| 51 | + { |
---|
| 52 | + // Side effect... |
---|
| 53 | + Object3D.cVector2[] keep = object.projectedVertices; |
---|
| 54 | + object.projectedVertices = new Object3D.cVector2[3]; |
---|
| 55 | + for (int i = 0; i < 3; i++) |
---|
| 56 | + { |
---|
| 57 | + if (i < keep.length) |
---|
| 58 | + { |
---|
| 59 | + object.projectedVertices[i] = keep[i]; |
---|
| 60 | + } else |
---|
| 61 | + { |
---|
| 62 | + object.projectedVertices[i] = new Object3D.cVector2(); |
---|
| 63 | + } |
---|
| 64 | + /* |
---|
| 65 | + if(keep.length == 0) |
---|
| 66 | + object.projectedVertices[0] = new Object3D.cVector2(); |
---|
| 67 | + else |
---|
| 68 | + object.projectedVertices[0] = keep[0]; |
---|
| 69 | + object.projectedVertices[1] = new Object3D.cVector2(); |
---|
| 70 | + */ |
---|
| 71 | + } |
---|
| 72 | + } |
---|
| 73 | + } |
---|
| 74 | + |
---|
| 75 | + public cGridBag GetSeparator() |
---|
| 76 | + { |
---|
| 77 | + cGridBag separator = new cGridBag(); |
---|
| 78 | + separator.add(new JSeparator()); |
---|
| 79 | + separator.preferredHeight = 5; |
---|
| 80 | + return separator; |
---|
| 81 | + } |
---|
| 82 | + |
---|
| 83 | + cButton GetButton(String name, boolean border) |
---|
| 84 | + { |
---|
| 85 | + ImageIcon icon = GetIcon(name); |
---|
| 86 | + if (icon != null) |
---|
| 87 | + return new cButton(icon, border); |
---|
| 88 | + else |
---|
| 89 | + return new cButton(name, border); |
---|
| 90 | + } |
---|
| 91 | + |
---|
| 92 | + cLabel GetLabel(String name, boolean border) |
---|
| 93 | + { |
---|
| 94 | + //ImageIcon icon = GetIcon(name); |
---|
| 95 | + return new cLabel(GetImage(name), border); |
---|
| 96 | + } |
---|
| 97 | + |
---|
| 98 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 99 | + { |
---|
| 100 | + ImageIcon icon = GetIcon(name); |
---|
| 101 | + return new cToggleButton(icon, border); |
---|
| 102 | + } |
---|
| 103 | + |
---|
| 104 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 105 | + { |
---|
| 106 | + ImageIcon icon = GetIcon(name); |
---|
| 107 | + return new cCheckBox(icon, border); |
---|
| 108 | + } |
---|
| 109 | + |
---|
| 110 | + static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); |
---|
| 111 | + |
---|
| 112 | + static ImageIcon GetIcon(String name) |
---|
| 113 | + { |
---|
| 114 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 115 | + if (iconCache != null) |
---|
| 116 | + { |
---|
| 117 | + return iconCache; |
---|
| 118 | + } |
---|
| 119 | + |
---|
| 120 | + try |
---|
| 121 | + { |
---|
| 122 | + BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
| 123 | + |
---|
| 124 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 125 | +// { |
---|
| 126 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 127 | +// Graphics2D g = resized.createGraphics(); |
---|
| 128 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 129 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 130 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 131 | +// g.dispose(); |
---|
| 132 | +// |
---|
| 133 | +// image = resized; |
---|
| 134 | +// } |
---|
| 135 | + |
---|
| 136 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 137 | + |
---|
| 138 | + icons.put(name, icon); |
---|
| 139 | + |
---|
| 140 | + return icon; |
---|
| 141 | + } |
---|
| 142 | + catch (Exception e) |
---|
| 143 | + { |
---|
| 144 | + //icons.put(name, null); |
---|
| 145 | + return null; |
---|
| 146 | + } |
---|
| 147 | + } |
---|
| 148 | + |
---|
| 149 | + BufferedImage GetImage(String name) |
---|
| 150 | + { |
---|
| 151 | + try |
---|
| 152 | + { |
---|
| 153 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 154 | + |
---|
| 155 | + return image; |
---|
| 156 | + } |
---|
| 157 | + catch (Exception e) |
---|
| 158 | + { |
---|
| 159 | + return null; |
---|
| 160 | + } |
---|
| 161 | + } |
---|
38 | 162 | |
---|
39 | 163 | // SCRIPT |
---|
40 | 164 | |
---|
.. | .. |
---|
145 | 269 | |
---|
146 | 270 | objEditor.ctrlPanel.remove(namePanel); |
---|
147 | 271 | |
---|
148 | | - if (!GroupEditor.allparams) |
---|
| 272 | + if (!allparams) |
---|
149 | 273 | return; |
---|
150 | 274 | |
---|
151 | 275 | // objEditor.ctrlPanel.remove(liveCB); |
---|
.. | .. |
---|
168 | 292 | // objEditor.ctrlPanel.remove(remarkButton); |
---|
169 | 293 | |
---|
170 | 294 | objEditor.ctrlPanel.remove(setupPanel); |
---|
171 | | - objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 295 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 296 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
172 | 297 | objEditor.ctrlPanel.remove(pushPanel); |
---|
173 | 298 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
174 | 299 | |
---|
.. | .. |
---|
216 | 341 | client = inClient; |
---|
217 | 342 | copy = client; |
---|
218 | 343 | |
---|
| 344 | +// if (copy.versionlist == null) |
---|
| 345 | +// { |
---|
| 346 | +// copy.versionlist = new Object3D[100]; |
---|
| 347 | +// copy.versionindex = -1; |
---|
| 348 | +// |
---|
| 349 | +// callee.Save(true); |
---|
| 350 | +// } |
---|
| 351 | + |
---|
219 | 352 | // "this" is not called: SetupUI2(objEditor); |
---|
220 | 353 | } |
---|
221 | 354 | |
---|
.. | .. |
---|
229 | 362 | client = inClient; |
---|
230 | 363 | copy = client; |
---|
231 | 364 | |
---|
| 365 | + if (copy.versionlist == null) |
---|
| 366 | + { |
---|
| 367 | + copy.versionlist = new Object3D[100]; |
---|
| 368 | + copy.versionindex = -1; |
---|
| 369 | + |
---|
| 370 | +// Save(true); |
---|
| 371 | + } |
---|
| 372 | + |
---|
232 | 373 | SetupUI2(callee.GetEditor()); |
---|
233 | 374 | } |
---|
234 | 375 | |
---|
.. | .. |
---|
243 | 384 | //localCopy.parent = null; |
---|
244 | 385 | |
---|
245 | 386 | frame = new JFrame(); |
---|
| 387 | + frame.setUndecorated(false); |
---|
246 | 388 | objEditor = this; |
---|
247 | 389 | this.callee = callee; |
---|
248 | 390 | |
---|
249 | 391 | //parent = p; |
---|
250 | 392 | |
---|
251 | 393 | GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); |
---|
252 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 394 | + if (Globals.DEBUG) |
---|
| 395 | + System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
253 | 396 | //gd.setFullScreenWindow(this); |
---|
254 | 397 | //setResizable(false); |
---|
255 | 398 | //if (!isDisplayable()) |
---|
.. | .. |
---|
260 | 403 | copy = localCopy; |
---|
261 | 404 | copy.editWindow = this; |
---|
262 | 405 | |
---|
| 406 | +// if (copy.versionlist == null) |
---|
| 407 | +// { |
---|
| 408 | +// copy.versionlist = new Object3D[100]; |
---|
| 409 | +// copy.versionindex = -1; |
---|
| 410 | +// |
---|
| 411 | +// Save(true); |
---|
| 412 | +// } |
---|
| 413 | + |
---|
263 | 414 | SetupMenu(); |
---|
264 | 415 | |
---|
265 | 416 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
273 | 424 | return frame.action(event, obj); |
---|
274 | 425 | } |
---|
275 | 426 | |
---|
| 427 | + // Cannot work without static |
---|
| 428 | + static boolean allparams = true; |
---|
| 429 | + |
---|
| 430 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 431 | + |
---|
| 432 | + // This is to refresh the UI of the material panel. |
---|
| 433 | + boolean patchMaterial; |
---|
| 434 | + |
---|
276 | 435 | void SetupMenu() |
---|
277 | 436 | { |
---|
278 | 437 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
279 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
280 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
281 | | - windowMenu.add("-"); |
---|
282 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
283 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 438 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 439 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 440 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
| 441 | + |
---|
| 442 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 443 | + Menu menu = new Menu("Import"); |
---|
| 444 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 445 | + importOBJItem.addActionListener(this); |
---|
| 446 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 447 | + import3DSItem.addActionListener(this); |
---|
| 448 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 449 | + importVRMLX3DItem.addActionListener(this); |
---|
| 450 | + menu.add("-"); |
---|
| 451 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 452 | + importGFDItem.addActionListener(this); |
---|
| 453 | + fileMenu.add(menu); |
---|
| 454 | + fileMenu.add("-"); |
---|
| 455 | + |
---|
| 456 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 457 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
284 | 458 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
285 | | - windowMenu.add("-"); |
---|
286 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
287 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
288 | | - windowMenu.add("-"); |
---|
| 459 | + fileMenu.add("-"); |
---|
| 460 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 461 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 462 | + fileMenu.add("-"); |
---|
289 | 463 | if (client.parent != null) |
---|
290 | 464 | { |
---|
291 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 465 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
292 | 466 | } else |
---|
293 | 467 | { |
---|
294 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 468 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
295 | 469 | } |
---|
296 | 470 | |
---|
297 | | - loadItem.addActionListener(this); |
---|
| 471 | + newItem.addActionListener(this); |
---|
| 472 | + openItem.addActionListener(this); |
---|
298 | 473 | saveItem.addActionListener(this); |
---|
299 | 474 | saveAsItem.addActionListener(this); |
---|
300 | 475 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
302 | 477 | //povItem.addActionListener(this); |
---|
303 | 478 | closeItem.addActionListener(this); |
---|
304 | 479 | |
---|
305 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
306 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
307 | | - //zBufferItem.addActionListener(this); |
---|
308 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
309 | | - //normalLensItem.addActionListener(this); |
---|
310 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
311 | | - revertCameraItem.addActionListener(this); |
---|
312 | | - |
---|
313 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
314 | | - toggleFullScreenItem.addItemListener(this); |
---|
315 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
316 | | - cameraMenu.add("-"); |
---|
317 | | - |
---|
318 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
319 | | - toggleTextureItem.addItemListener(this); |
---|
320 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
321 | | - |
---|
322 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
323 | | - toggleSwitchItem.addItemListener(this); |
---|
324 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
325 | | - |
---|
326 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
327 | | - toggleHandleItem.addItemListener(this); |
---|
328 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
329 | | - |
---|
330 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
331 | | - togglePaintItem.addItemListener(this); |
---|
332 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
333 | | - |
---|
334 | | - if (Globals.ADVANCED) |
---|
335 | | - { |
---|
336 | | - cameraMenu.add("-"); |
---|
337 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
338 | | - toggleLiveItem.addItemListener(this); |
---|
339 | | - toggleLiveItem.setState(Globals.isLIVE()); |
---|
340 | | - |
---|
341 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
342 | | - stepItem.addActionListener(this); |
---|
343 | | - // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
344 | | - // toggleDLItem.addItemListener(this); |
---|
345 | | - // toggleDLItem.setState(false); |
---|
346 | | - |
---|
347 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
348 | | - toggleRenderItem.addItemListener(this); |
---|
349 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
350 | | - |
---|
351 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
352 | | - toggleDebugItem.addItemListener(this); |
---|
353 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
354 | | - |
---|
355 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
356 | | - toggleFrustumItem.addItemListener(this); |
---|
357 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
358 | | - |
---|
359 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
360 | | - toggleFootContactItem.addItemListener(this); |
---|
361 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
362 | | - |
---|
363 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
364 | | - toggleTimelineItem.addItemListener(this); |
---|
365 | | - } |
---|
366 | | - |
---|
367 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
368 | | -// toggleRootItem.addItemListener(this); |
---|
369 | | -// toggleRootItem.setState(false); |
---|
370 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
371 | | -// animationItem.addItemListener(this); |
---|
372 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
373 | | - cameraMenu.add("-"); |
---|
374 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
375 | | - editCameraItem.addActionListener(this); |
---|
376 | | - |
---|
377 | 480 | objectPanel = new JTabbedPane(); |
---|
| 481 | + |
---|
| 482 | + ChangeListener changeListener = new ChangeListener() |
---|
| 483 | + { |
---|
| 484 | + //String name; |
---|
| 485 | + |
---|
| 486 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 487 | + { |
---|
| 488 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 489 | +// { |
---|
| 490 | +// if (latestObject != null) |
---|
| 491 | +// { |
---|
| 492 | +// refreshContents(true); |
---|
| 493 | +// SetMaterial(latestObject); |
---|
| 494 | +// } |
---|
| 495 | +// |
---|
| 496 | +// materialFlushed = true; |
---|
| 497 | +// } |
---|
| 498 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 499 | +// { |
---|
| 500 | +// if (listUI.size() == 0) |
---|
| 501 | +// EditSelection(false); |
---|
| 502 | +// } |
---|
| 503 | + |
---|
| 504 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 505 | +// { |
---|
| 506 | +// name = copy.skyboxname; |
---|
| 507 | +// |
---|
| 508 | +// if (name == null) |
---|
| 509 | +// { |
---|
| 510 | +// name = ""; |
---|
| 511 | +// } |
---|
| 512 | +// |
---|
| 513 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 514 | +// copy.skyboxext = "jpg"; |
---|
| 515 | +// } |
---|
| 516 | +// else |
---|
| 517 | +// { |
---|
| 518 | +// if (name != null) |
---|
| 519 | +// { |
---|
| 520 | +// if (name.equals("")) |
---|
| 521 | +// { |
---|
| 522 | +// copy.skyboxname = null; |
---|
| 523 | +// copy.skyboxext = null; |
---|
| 524 | +// } |
---|
| 525 | +// else |
---|
| 526 | +// { |
---|
| 527 | +// copy.skyboxname = name; |
---|
| 528 | +// } |
---|
| 529 | +// } |
---|
| 530 | +// } |
---|
| 531 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 532 | + |
---|
| 533 | +// refreshContents(false); // To refresh Info tab |
---|
| 534 | + cameraView.repaint(); |
---|
| 535 | + } |
---|
| 536 | + }; |
---|
| 537 | + objectPanel.addChangeListener(changeListener); |
---|
| 538 | + |
---|
378 | 539 | toolbarPanel = new JPanel(); |
---|
379 | 540 | toolbarPanel.setName("Toolbar"); |
---|
| 541 | + |
---|
380 | 542 | treePanel = new cGridBag(); |
---|
381 | 543 | treePanel.setName("Tree"); |
---|
| 544 | + |
---|
| 545 | + editPanel = new cGridBag().setVertical(true); |
---|
| 546 | + //editPanel.setName("Edit"); |
---|
| 547 | + |
---|
382 | 548 | ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
383 | | - ctrlPanel.setName("Edit"); |
---|
384 | | - materialPanel = new cGridBag().setVertical(true); |
---|
385 | | - materialPanel.setName("Material"); |
---|
| 549 | + |
---|
| 550 | + editCommandsPanel = new cGridBag(); |
---|
| 551 | + editPanel.add(editCommandsPanel); |
---|
| 552 | + editPanel.add(ctrlPanel); |
---|
| 553 | + |
---|
| 554 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 555 | + //toolboxPanel.setName("Toolbox"); |
---|
| 556 | + |
---|
| 557 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 558 | + |
---|
| 559 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 560 | + //materialPanel.setName("Material"); |
---|
| 561 | + |
---|
386 | 562 | /*JTextPane*/ |
---|
387 | 563 | infoarea = createTextPane(); |
---|
388 | 564 | doc = infoarea.getStyledDocument(); |
---|
389 | 565 | |
---|
390 | 566 | infoarea.setEditable(true); |
---|
391 | 567 | SetText(); |
---|
| 568 | + |
---|
392 | 569 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
393 | 570 | // infoarea.setOpaque(false); |
---|
394 | 571 | // //infoarea.setForeground(textcolor); |
---|
395 | 572 | // TEXTAREA infoarea.setLineWrap(true); |
---|
396 | 573 | // TEXTAREA infoarea.setWrapStyleWord(true); |
---|
397 | 574 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
398 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
399 | | - infoPanel.setName("Info"); |
---|
| 575 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
| 576 | + //infoPanel.setName("Info"); |
---|
400 | 577 | //infoPanel.setLayout(new BorderLayout()); |
---|
401 | 578 | //infoPanel.add(createTextPane()); |
---|
402 | 579 | |
---|
.. | .. |
---|
407 | 584 | mainPanel.setDividerSize(9); |
---|
408 | 585 | mainPanel.setDividerLocation(0.5); //1.0); |
---|
409 | 586 | mainPanel.setResizeWeight(0.5); |
---|
410 | | - |
---|
| 587 | + |
---|
| 588 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 589 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 590 | + divider.setDividerSize(15); |
---|
| 591 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 592 | + |
---|
| 593 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 594 | + |
---|
411 | 595 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
412 | 596 | //mainPanel.setLayout(new GridBagLayout()); |
---|
413 | 597 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
.. | .. |
---|
475 | 659 | e.printStackTrace(); |
---|
476 | 660 | } |
---|
477 | 661 | |
---|
478 | | - String selection = infoarea.getText(); |
---|
479 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
480 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
481 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 662 | +// String selection = infoarea.getText(); |
---|
| 663 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 664 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 665 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
482 | 666 | //clipboard.setContents(data, data); |
---|
483 | 667 | } |
---|
484 | 668 | |
---|
.. | .. |
---|
638 | 822 | } |
---|
639 | 823 | } |
---|
640 | 824 | |
---|
| 825 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 826 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 827 | + |
---|
| 828 | + Rectangle keeprect; |
---|
| 829 | + cRadio radio; |
---|
| 830 | + |
---|
| 831 | +cButton keepButton; |
---|
| 832 | + cButton twoButton; // Full 3D |
---|
| 833 | + cButton sixButton; |
---|
| 834 | + cButton threeButton; |
---|
| 835 | + cButton sevenButton; |
---|
| 836 | + cButton fourButton; // full panel |
---|
| 837 | + cButton oneButton; // full XYZ |
---|
| 838 | + //cButton currentLayout; |
---|
| 839 | + |
---|
| 840 | + boolean maximized; |
---|
| 841 | + |
---|
| 842 | + cButton fullscreenLayout; |
---|
| 843 | + cButton expandedLayout; |
---|
| 844 | + |
---|
| 845 | + void Minimize() |
---|
| 846 | + { |
---|
| 847 | + frame.setState(Frame.ICONIFIED); |
---|
| 848 | + frame.validate(); |
---|
| 849 | + } |
---|
| 850 | + |
---|
| 851 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 852 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 853 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
| 854 | + void Maximize() |
---|
| 855 | + { |
---|
| 856 | + if (CameraPane.FULLSCREEN) |
---|
| 857 | + { |
---|
| 858 | + ToggleFullScreen(); |
---|
| 859 | + } |
---|
| 860 | + |
---|
| 861 | + if (maximized) |
---|
| 862 | + { |
---|
| 863 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 864 | + } |
---|
| 865 | + else |
---|
| 866 | + { |
---|
| 867 | + keeprect = frame.getBounds(); |
---|
| 868 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 869 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 870 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 871 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 872 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
| 873 | + } |
---|
| 874 | + |
---|
| 875 | + maximized ^= true; |
---|
| 876 | + |
---|
| 877 | + frame.validate(); |
---|
| 878 | + } |
---|
| 879 | + |
---|
| 880 | + cButton minButton; |
---|
| 881 | + cButton maxButton; |
---|
| 882 | + cButton fullButton; |
---|
| 883 | + cButton collapseButton; |
---|
| 884 | + cButton maximize3DButton; |
---|
| 885 | + |
---|
641 | 886 | void ToggleFullScreen() |
---|
642 | 887 | { |
---|
643 | | - if (CameraPane.FULLSCREEN) |
---|
| 888 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 889 | + |
---|
| 890 | + cameraView.ToggleFullScreen(); |
---|
| 891 | + |
---|
| 892 | + if (!CameraPane.FULLSCREEN) |
---|
644 | 893 | { |
---|
645 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
646 | | - framePanel.add(bigThree); |
---|
647 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 894 | + device.setFullScreenWindow(null); |
---|
| 895 | + frame.dispose(); |
---|
| 896 | + frame.setUndecorated(false); |
---|
| 897 | + frame.validate(); |
---|
| 898 | + frame.setVisible(true); |
---|
| 899 | + |
---|
| 900 | + //frame.setVisible(false); |
---|
| 901 | +// frame.removeNotify(); |
---|
| 902 | +// frame.setUndecorated(false); |
---|
| 903 | +// frame.addNotify(); |
---|
| 904 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 905 | + |
---|
| 906 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 907 | +// X framePanel.add(bigThree); |
---|
| 908 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 909 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
| 910 | + |
---|
| 911 | + //frame.setVisible(true); |
---|
| 912 | +// radio.layout = keepButton; |
---|
| 913 | + //theFrame = null; |
---|
| 914 | + keepButton = null; |
---|
| 915 | +// radio.layout.doClick(); |
---|
| 916 | + |
---|
648 | 917 | } else |
---|
649 | 918 | { |
---|
650 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
651 | | - framePanel.remove(bigThree); |
---|
652 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 919 | + keepButton = radio.layout; |
---|
| 920 | + //keeprect = frame.getBounds(); |
---|
| 921 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 922 | +// frame.getToolkit().getScreenSize().height); |
---|
| 923 | + //frame.setVisible(false); |
---|
| 924 | + |
---|
| 925 | + frame.dispose(); |
---|
| 926 | + frame.setUndecorated(true); |
---|
| 927 | + device.setFullScreenWindow(frame); |
---|
| 928 | + frame.validate(); |
---|
| 929 | + frame.setVisible(true); |
---|
| 930 | +// frame.removeNotify(); |
---|
| 931 | +// frame.setUndecorated(true); |
---|
| 932 | +// frame.addNotify(); |
---|
| 933 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 934 | +// X framePanel.remove(bigThree); |
---|
| 935 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 936 | +// framePanel.setDividerLocation(0); |
---|
| 937 | + |
---|
| 938 | +// radio.layout = fullscreenLayout; |
---|
| 939 | +// radio.layout.doClick(); |
---|
| 940 | + //frame.setVisible(true); |
---|
653 | 941 | } |
---|
654 | | - cameraView.ToggleFullScreen(); |
---|
| 942 | + frame.validate(); |
---|
| 943 | + |
---|
| 944 | + cameraView.requestFocusInWindow(); |
---|
655 | 945 | } |
---|
| 946 | + |
---|
| 947 | + void CollapseToolbar() |
---|
| 948 | + { |
---|
| 949 | + framePanel.setDividerLocation(0); |
---|
| 950 | + //frame.validate(); |
---|
| 951 | + |
---|
| 952 | + cameraView.requestFocusInWindow(); |
---|
| 953 | + } |
---|
| 954 | + |
---|
| 955 | + private Object3D Duplicate(Object3D object) |
---|
| 956 | + { |
---|
| 957 | + boolean temp = CameraPane.SWITCH; |
---|
| 958 | + CameraPane.SWITCH = false; |
---|
| 959 | + |
---|
| 960 | + if (Grafreed.grafreed.universe.versiontable == null) |
---|
| 961 | + Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 962 | + |
---|
| 963 | + object.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 964 | + // if (copy == client) |
---|
| 965 | + |
---|
| 966 | + Object3D versions[] = object.versionlist; |
---|
| 967 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe |
---|
| 968 | + object.versionlist = null; |
---|
| 969 | + object.versiontable = null; |
---|
| 970 | + |
---|
| 971 | + Object3D parent = object.parent; |
---|
| 972 | + object.parent = null; |
---|
| 973 | + |
---|
| 974 | + //byte[] compress = Compress(copy); |
---|
| 975 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
| 976 | + |
---|
| 977 | + object.parent = parent; |
---|
| 978 | + |
---|
| 979 | + object.versionlist = versions; |
---|
| 980 | + object.versiontable = versiontable; // if Grafreed.grafreed.universe |
---|
| 981 | + |
---|
| 982 | + object.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 983 | + |
---|
| 984 | + CameraPane.SWITCH = temp; |
---|
| 985 | + |
---|
| 986 | + return compress; |
---|
| 987 | + } |
---|
656 | 988 | |
---|
657 | 989 | private JTextPane createTextPane() |
---|
658 | 990 | { |
---|
.. | .. |
---|
775 | 1107 | { |
---|
776 | 1108 | SetupMaterial(materialPanel); |
---|
777 | 1109 | } |
---|
| 1110 | + |
---|
778 | 1111 | //SetupName(); |
---|
779 | 1112 | //SetupViews(); |
---|
780 | 1113 | } |
---|
.. | .. |
---|
784 | 1117 | // NumberSlider vDivsField; |
---|
785 | 1118 | // JCheckBox endcaps; |
---|
786 | 1119 | JCheckBox liveCB; |
---|
787 | | - JCheckBox selectCB; |
---|
| 1120 | + JCheckBox selectableCB; |
---|
788 | 1121 | JCheckBox hideCB; |
---|
789 | 1122 | JCheckBox link2masterCB; |
---|
790 | 1123 | JCheckBox markCB; |
---|
.. | .. |
---|
792 | 1125 | JCheckBox speedupCB; |
---|
793 | 1126 | JCheckBox rewindCB; |
---|
794 | 1127 | JCheckBox flipVCB; |
---|
| 1128 | + |
---|
| 1129 | + cCheckBox toggleTextureCB; |
---|
| 1130 | + cCheckBox toggleSwitchCB; |
---|
| 1131 | + |
---|
795 | 1132 | JComboBox texresMenu; |
---|
| 1133 | + |
---|
796 | 1134 | JButton resetButton; |
---|
797 | 1135 | JButton stepButton; |
---|
798 | 1136 | JButton stepAllButton; |
---|
.. | .. |
---|
801 | 1139 | JButton fasterButton; |
---|
802 | 1140 | JButton remarkButton; |
---|
803 | 1141 | |
---|
| 1142 | + cGridBag editPanel; |
---|
| 1143 | + cGridBag editCommandsPanel; |
---|
| 1144 | + |
---|
804 | 1145 | cGridBag namePanel; |
---|
805 | 1146 | cGridBag setupPanel; |
---|
806 | | - cGridBag commandsPanel; |
---|
| 1147 | + cGridBag setupPanel2; |
---|
| 1148 | + cGridBag objectCommandsPanel; |
---|
807 | 1149 | cGridBag pushPanel; |
---|
808 | 1150 | cGridBag fillPanel; |
---|
809 | 1151 | |
---|
.. | .. |
---|
974 | 1316 | |
---|
975 | 1317 | namePanel = new cGridBag(); |
---|
976 | 1318 | |
---|
| 1319 | + //if (copy.pinned) |
---|
| 1320 | + { |
---|
| 1321 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1322 | + pinButton.setSelected(copy.pinned); |
---|
| 1323 | + cGridBag t = new cGridBag(); |
---|
| 1324 | + t.preferredWidth = 2; |
---|
| 1325 | + t.add(pinButton); |
---|
| 1326 | + namePanel.add(t); |
---|
| 1327 | + |
---|
| 1328 | + pinButton.addItemListener(this); |
---|
| 1329 | + } |
---|
| 1330 | + |
---|
977 | 1331 | nameField = AddText(namePanel, copy.GetName()); |
---|
978 | | - namePanel.add(nameField); |
---|
| 1332 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
979 | 1333 | oe.ctrlPanel.add(namePanel); |
---|
980 | 1334 | |
---|
981 | 1335 | oe.ctrlPanel.Return(); |
---|
982 | 1336 | |
---|
983 | | - if (!GroupEditor.allparams) |
---|
| 1337 | + if (!allparams) |
---|
984 | 1338 | return; |
---|
985 | 1339 | |
---|
986 | 1340 | setupPanel = new cGridBag().setVertical(false); |
---|
987 | 1341 | |
---|
988 | 1342 | liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
989 | 1343 | liveCB.setToolTipText("Animate object"); |
---|
990 | | - selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
991 | | - selectCB.setToolTipText("Make object selectable"); |
---|
| 1344 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1345 | + markCB.setToolTipText("Set target transform"); |
---|
| 1346 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1347 | + selectableCB.setToolTipText("Make object selectable"); |
---|
992 | 1348 | // Return(); |
---|
| 1349 | + |
---|
993 | 1350 | hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
994 | 1351 | hideCB.setToolTipText("Hide object"); |
---|
995 | | - markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
996 | | - markCB.setToolTipText("Set the animation target transform"); |
---|
997 | 1352 | |
---|
998 | | - rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 1353 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
| 1354 | + |
---|
| 1355 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1356 | + |
---|
| 1357 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
999 | 1358 | rewindCB.setToolTipText("Rewind animation"); |
---|
1000 | 1359 | |
---|
1001 | | - randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
1002 | | - randomCB.setToolTipText("Option for switch node"); |
---|
| 1360 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1361 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
1003 | 1362 | |
---|
| 1363 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1364 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1365 | + |
---|
1004 | 1366 | if (Globals.ADVANCED) |
---|
1005 | 1367 | { |
---|
1006 | | - link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
1007 | | - link2masterCB.setToolTipText("Attach to support"); |
---|
1008 | | - speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 1368 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
1009 | 1369 | speedupCB.setToolTipText("Option motion capture"); |
---|
1010 | 1370 | } |
---|
1011 | 1371 | |
---|
1012 | 1372 | oe.ctrlPanel.add(setupPanel); |
---|
1013 | 1373 | oe.ctrlPanel.Return(); |
---|
| 1374 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1375 | + oe.ctrlPanel.Return(); |
---|
1014 | 1376 | |
---|
1015 | | - commandsPanel = new cGridBag().setVertical(false); |
---|
| 1377 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
1016 | 1378 | |
---|
1017 | | - resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 1379 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
1018 | 1380 | resetButton.setToolTipText("Jump to frame zero"); |
---|
1019 | | - stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1381 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
1020 | 1382 | stepButton.setToolTipText("Step one frame"); |
---|
1021 | 1383 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
1022 | 1384 | // stepAllButton = AddButton(oe, "Step All"); |
---|
1023 | 1385 | // Return(); |
---|
1024 | | - slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 1386 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
1025 | 1387 | slowerButton.setToolTipText("Decrease animation speed"); |
---|
1026 | | - fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 1388 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
1027 | 1389 | fasterButton.setToolTipText("Increase animation speed"); |
---|
1028 | | - remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1390 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
1029 | 1391 | remarkButton.setToolTipText("Set the current transform as the target"); |
---|
1030 | 1392 | |
---|
1031 | | - oe.ctrlPanel.add(commandsPanel); |
---|
| 1393 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
1032 | 1394 | oe.ctrlPanel.Return(); |
---|
1033 | 1395 | |
---|
1034 | 1396 | pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
.. | .. |
---|
1188 | 1550 | |
---|
1189 | 1551 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1190 | 1552 | { |
---|
| 1553 | + if (Globals.DEBUG) |
---|
1191 | 1554 | System.out.println("CREATE CAMERAS"); |
---|
1192 | 1555 | cams = new cTemplate(); |
---|
1193 | 1556 | cams.name = "Cameras"; |
---|
.. | .. |
---|
1234 | 1597 | //worldPanel.setName("World"); |
---|
1235 | 1598 | centralPanel = new cGridBag(); |
---|
1236 | 1599 | centralPanel.preferredWidth = 20; |
---|
1237 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1238 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1600 | + |
---|
| 1601 | + if (Globals.ADVANCED) |
---|
| 1602 | + { |
---|
| 1603 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1604 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1239 | 1605 | |
---|
1240 | 1606 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1241 | 1607 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1244 | 1610 | // cameraPanel.setDividerSize(9); |
---|
1245 | 1611 | cameraPanel.setResizeWeight(1.0); |
---|
1246 | 1612 | |
---|
| 1613 | + } |
---|
| 1614 | + |
---|
1247 | 1615 | centralPanel.add(cameraView); |
---|
| 1616 | + centralPanel.setFocusable(true); |
---|
1248 | 1617 | //frame.setJMenuBar(timelineMenubar); |
---|
1249 | 1618 | //centralPanel.add(timelinePanel); |
---|
1250 | 1619 | |
---|
.. | .. |
---|
1263 | 1632 | //frontView.object = copy; |
---|
1264 | 1633 | //sideView.object = copy; |
---|
1265 | 1634 | |
---|
| 1635 | + transformPanel = new cGridBag().setVertical(true); |
---|
| 1636 | + |
---|
| 1637 | + cGridBag resetTransformPanel = new cGridBag(); |
---|
| 1638 | + |
---|
| 1639 | + resetTransformPanel.preferredHeight = 2; |
---|
| 1640 | + |
---|
| 1641 | + cButton resetTransform = GetButton("Reset all", !Grafreed.NIMBUSLAF); |
---|
| 1642 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1643 | + { |
---|
| 1644 | + public void mouseClicked(MouseEvent e) |
---|
| 1645 | + { |
---|
| 1646 | + ResetTransform(); |
---|
| 1647 | + } |
---|
| 1648 | + }); |
---|
| 1649 | + resetTransformPanel.add(resetTransform); |
---|
| 1650 | + |
---|
| 1651 | + resetTransform = GetButton("T only", !Grafreed.NIMBUSLAF); |
---|
| 1652 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1653 | + { |
---|
| 1654 | + public void mouseClicked(MouseEvent e) |
---|
| 1655 | + { |
---|
| 1656 | + ResetTransform(1); |
---|
| 1657 | + } |
---|
| 1658 | + }); |
---|
| 1659 | + resetTransformPanel.add(resetTransform); |
---|
| 1660 | + |
---|
| 1661 | + resetTransform = GetButton("RS only", !Grafreed.NIMBUSLAF); |
---|
| 1662 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1663 | + { |
---|
| 1664 | + public void mouseClicked(MouseEvent e) |
---|
| 1665 | + { |
---|
| 1666 | + ResetTransform(2); |
---|
| 1667 | + } |
---|
| 1668 | + }); |
---|
| 1669 | + resetTransformPanel.add(resetTransform); |
---|
| 1670 | + |
---|
1266 | 1671 | XYZPanel = new cGridBag().setVertical(true); |
---|
1267 | 1672 | //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1268 | 1673 | |
---|
.. | .. |
---|
1270 | 1675 | XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1271 | 1676 | XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1272 | 1677 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1678 | + //XYZPanel.setName("XYZ"); |
---|
1273 | 1679 | |
---|
| 1680 | + transformPanel.add(resetTransformPanel); |
---|
| 1681 | + transformPanel.add(XYZPanel); |
---|
| 1682 | + |
---|
1274 | 1683 | /* |
---|
1275 | 1684 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
1276 | 1685 | gridPanel.setLayout(new GridLayout(1, 2)); |
---|
.. | .. |
---|
1278 | 1687 | gridPanel.add(cameraView); |
---|
1279 | 1688 | gridPanel.add(XYZPanel); |
---|
1280 | 1689 | */ |
---|
1281 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1282 | | - gridPanel.setContinuousLayout(true); |
---|
1283 | | - gridPanel.setOneTouchExpandable(true); |
---|
1284 | | - gridPanel.setDividerLocation(1.0); |
---|
1285 | | - gridPanel.setDividerSize(9); |
---|
1286 | | - gridPanel.setResizeWeight(0.85); |
---|
| 1690 | +// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
| 1691 | +// gridPanel.setContinuousLayout(true); |
---|
| 1692 | +// gridPanel.setOneTouchExpandable(true); |
---|
| 1693 | +// gridPanel.setDividerLocation(1.0); |
---|
| 1694 | +// gridPanel.setDividerSize(9); |
---|
| 1695 | +// gridPanel.setResizeWeight(0.85); |
---|
1287 | 1696 | |
---|
1288 | 1697 | // aConstraints.weighty = 0; |
---|
1289 | 1698 | //System.out.println("THIS = " + this); |
---|
.. | .. |
---|
1306 | 1715 | |
---|
1307 | 1716 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1308 | 1717 | //tmp.setName("Edit"); |
---|
| 1718 | + objectPanel.add(toolboxPanel); |
---|
| 1719 | + objectPanel.setIconAt(0, GetIcon("icons/primitives.png")); |
---|
| 1720 | + objectPanel.setToolTipTextAt(0, "Objects & textures"); |
---|
| 1721 | + |
---|
1309 | 1722 | objectPanel.add(materialPanel); |
---|
| 1723 | + objectPanel.setIconAt(1, GetIcon("icons/material.png")); |
---|
| 1724 | + objectPanel.setToolTipTextAt(1, "Material"); |
---|
| 1725 | + |
---|
| 1726 | + objectPanel.add(skyboxPanel); |
---|
| 1727 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1728 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1729 | + |
---|
1310 | 1730 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1311 | 1731 | // north.setName("Edit"); |
---|
1312 | 1732 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1313 | 1733 | // objectPanel.add(north); |
---|
1314 | | - objectPanel.add(ctrlPanel); |
---|
1315 | | - objectPanel.add(infoPanel); |
---|
1316 | | - |
---|
| 1734 | + objectPanel.add(editPanel); |
---|
| 1735 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1736 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
| 1737 | + |
---|
| 1738 | + objectPanel.add(transformPanel); |
---|
| 1739 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1740 | + objectPanel.setToolTipTextAt(4, "TRS transform"); |
---|
| 1741 | + |
---|
| 1742 | + patchMaterial = true; |
---|
| 1743 | + cameraView.patchMaterial = this; |
---|
| 1744 | + objectPanel.setSelectedIndex(1); |
---|
| 1745 | + |
---|
1317 | 1746 | /* |
---|
1318 | 1747 | aConstraints.gridx = 0; |
---|
1319 | 1748 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1321 | 1750 | aConstraints.gridy += 1; |
---|
1322 | 1751 | aConstraints.gridwidth = 1; |
---|
1323 | 1752 | mainPanel.add(objectPanel, aConstraints); |
---|
1324 | | - */ |
---|
| 1753 | + */ |
---|
1325 | 1754 | |
---|
1326 | 1755 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1327 | 1756 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1338 | 1767 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1339 | 1768 | tabbedPane.add(scrollpane); |
---|
1340 | 1769 | |
---|
1341 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1342 | | - |
---|
1343 | | - optionsPanel = new cGridBag().setVertical(true); |
---|
| 1770 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1344 | 1771 | |
---|
1345 | 1772 | optionsPanel.setName("Options"); |
---|
1346 | 1773 | |
---|
.. | .. |
---|
1348 | 1775 | |
---|
1349 | 1776 | tabbedPane.add(optionsPanel); |
---|
1350 | 1777 | |
---|
| 1778 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1779 | + |
---|
1351 | 1780 | scenePanel.add(tabbedPane); |
---|
1352 | 1781 | |
---|
| 1782 | + //if (Globals.ADVANCED) |
---|
| 1783 | +// tabbedPane.add(infoPanel); |
---|
| 1784 | +// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1785 | +// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1786 | + |
---|
1353 | 1787 | /* |
---|
1354 | 1788 | cTree jTree = new cTree(null); |
---|
1355 | 1789 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1370 | 1804 | jtp.add(tree); |
---|
1371 | 1805 | */ |
---|
1372 | 1806 | |
---|
1373 | | - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
1374 | | - bigPanel.setContinuousLayout(true); |
---|
1375 | | - bigPanel.setOneTouchExpandable(true); |
---|
1376 | | - bigPanel.setDividerLocation(0.8); |
---|
1377 | | - bigPanel.setDividerSize(15); |
---|
1378 | | - bigPanel.setResizeWeight(0.15); |
---|
1379 | | - bigPanel.setName("Scene"); |
---|
| 1807 | +// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
| 1808 | +// bigPanel.setContinuousLayout(true); |
---|
| 1809 | +// bigPanel.setOneTouchExpandable(true); |
---|
| 1810 | +// bigPanel.setDividerLocation(0.8); |
---|
| 1811 | +// bigPanel.setDividerSize(15); |
---|
| 1812 | +// bigPanel.setResizeWeight(0.15); |
---|
| 1813 | +// bigPanel.setName("Scene"); |
---|
1380 | 1814 | |
---|
1381 | 1815 | //bigPanel.setLayout(new BorderLayout()); |
---|
1382 | 1816 | //bigPanel.setSize(new Dimension(10,10)); |
---|
.. | .. |
---|
1411 | 1845 | bigThree = new cGridBag(); |
---|
1412 | 1846 | bigThree.addComponent(scenePanel); |
---|
1413 | 1847 | bigThree.addComponent(centralPanel); |
---|
1414 | | - bigThree.addComponent(XYZPanel); |
---|
| 1848 | + //bigThree.addComponent(XYZPanel); |
---|
1415 | 1849 | |
---|
1416 | 1850 | // // SIDE EFFECT!!! |
---|
1417 | 1851 | // aConstraints.gridx = 0; |
---|
.. | .. |
---|
1420 | 1854 | // aConstraints.gridheight = 1; |
---|
1421 | 1855 | |
---|
1422 | 1856 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1423 | | - framePanel.setContinuousLayout(true); |
---|
1424 | | - framePanel.setOneTouchExpandable(true); |
---|
1425 | | - framePanel.setDividerLocation(0.8); |
---|
| 1857 | + |
---|
| 1858 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1859 | + new java.beans.PropertyChangeListener() |
---|
| 1860 | + { |
---|
| 1861 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1862 | + { |
---|
| 1863 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1864 | + { |
---|
| 1865 | + if (radio.layout != expandedLayout) |
---|
| 1866 | + { |
---|
| 1867 | + radio.layout = expandedLayout; |
---|
| 1868 | + radio.layout.doClick(); |
---|
| 1869 | + } |
---|
| 1870 | + } |
---|
| 1871 | + } |
---|
| 1872 | + }); |
---|
| 1873 | + |
---|
| 1874 | + framePanel.setContinuousLayout(false); |
---|
| 1875 | + framePanel.setOneTouchExpandable(false); |
---|
| 1876 | + //.setDividerLocation(0.8); |
---|
1426 | 1877 | //framePanel.setDividerSize(15); |
---|
1427 | 1878 | //framePanel.setResizeWeight(0.15); |
---|
1428 | 1879 | framePanel.setName("Frame"); |
---|
1429 | 1880 | |
---|
1430 | 1881 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1431 | 1882 | /**/ |
---|
1432 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1883 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1433 | 1884 | //worldPane.add(bigPanel); |
---|
1434 | 1885 | //worldPane.add(worldPanel); |
---|
1435 | 1886 | /**/ |
---|
.. | .. |
---|
1440 | 1891 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1441 | 1892 | |
---|
1442 | 1893 | frame.setSize(1280, 860); |
---|
1443 | | - frame.setVisible(true); |
---|
| 1894 | + |
---|
| 1895 | + cameraView.requestFocusInWindow(); |
---|
| 1896 | + |
---|
| 1897 | +// gridPanel.setDividerLocation(1.0); |
---|
| 1898 | + |
---|
| 1899 | + frame.validate(); |
---|
1444 | 1900 | |
---|
1445 | | - gridPanel.setDividerLocation(1.0); |
---|
| 1901 | + frame.setVisible(true); |
---|
1446 | 1902 | |
---|
1447 | 1903 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1448 | 1904 | frame.addWindowListener(new WindowAdapter() |
---|
1449 | 1905 | { |
---|
1450 | | - |
---|
1451 | 1906 | public void windowClosing(WindowEvent e) |
---|
1452 | 1907 | { |
---|
1453 | 1908 | Close(); |
---|
.. | .. |
---|
1470 | 1925 | ctrlPanel.removeAll(); |
---|
1471 | 1926 | } |
---|
1472 | 1927 | |
---|
1473 | | - void SetupMaterial(cGridBag panel) |
---|
| 1928 | + void SetupMaterial(cGridBag materialpanel) |
---|
1474 | 1929 | { |
---|
1475 | | - /* |
---|
| 1930 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1931 | + |
---|
| 1932 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1933 | + skin.setToolTipText("Skin"); |
---|
| 1934 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1935 | + { |
---|
| 1936 | + public void mouseClicked(MouseEvent e) |
---|
| 1937 | + { |
---|
| 1938 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1939 | + cMaterial material = object.material; |
---|
| 1940 | + |
---|
| 1941 | + // Skin |
---|
| 1942 | + colorField.setFloat(material.color); |
---|
| 1943 | + float saturation = material.modulation; |
---|
| 1944 | + |
---|
| 1945 | + if (!cameraView.Skinshader) |
---|
| 1946 | + { |
---|
| 1947 | + saturation /= 1.5; |
---|
| 1948 | + } |
---|
| 1949 | + |
---|
| 1950 | + saturationField.setFloat(saturation); |
---|
| 1951 | + |
---|
| 1952 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1953 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1954 | + diffusenessField.setFloat(material.factor); |
---|
| 1955 | + shininessField.setFloat(material.shininess); |
---|
| 1956 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1957 | + diffuseField.setFloat(material.diffuse); |
---|
| 1958 | + specularField.setFloat(material.specular); |
---|
| 1959 | + |
---|
| 1960 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1961 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1962 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1963 | + |
---|
| 1964 | + materialtouched = true; |
---|
| 1965 | + applySelf(); |
---|
| 1966 | + } |
---|
| 1967 | + }); |
---|
| 1968 | + presetpanel.add(skin); |
---|
| 1969 | + |
---|
| 1970 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1971 | + lambert.setToolTipText("Diffuse"); |
---|
| 1972 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1973 | + { |
---|
| 1974 | + public void mouseClicked(MouseEvent e) |
---|
| 1975 | + { |
---|
| 1976 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1977 | + cMaterial material = object.material; |
---|
| 1978 | + |
---|
| 1979 | + diffusenessField.setFloat(material.factor); |
---|
| 1980 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1981 | + |
---|
| 1982 | + materialtouched = true; |
---|
| 1983 | + applySelf(); |
---|
| 1984 | + } |
---|
| 1985 | + }); |
---|
| 1986 | + presetpanel.add(lambert); |
---|
| 1987 | + |
---|
| 1988 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1989 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1990 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1991 | + { |
---|
| 1992 | + public void mouseClicked(MouseEvent e) |
---|
| 1993 | + { |
---|
| 1994 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1995 | + cMaterial material = object.material; |
---|
| 1996 | + |
---|
| 1997 | + diffusenessField.setFloat(material.factor); |
---|
| 1998 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1999 | + |
---|
| 2000 | + materialtouched = true; |
---|
| 2001 | + applySelf(); |
---|
| 2002 | + } |
---|
| 2003 | + }); |
---|
| 2004 | + presetpanel.add(diffuse2); |
---|
| 2005 | + |
---|
| 2006 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 2007 | + diffusemoon.setToolTipText("Moon"); |
---|
| 2008 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 2009 | + { |
---|
| 2010 | + public void mouseClicked(MouseEvent e) |
---|
| 2011 | + { |
---|
| 2012 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 2013 | + cMaterial material = object.material; |
---|
| 2014 | + |
---|
| 2015 | + diffusenessField.setFloat(material.factor); |
---|
| 2016 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2017 | + |
---|
| 2018 | + materialtouched = true; |
---|
| 2019 | + applySelf(); |
---|
| 2020 | + } |
---|
| 2021 | + }); |
---|
| 2022 | + presetpanel.add(diffusemoon); |
---|
| 2023 | + |
---|
| 2024 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 2025 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 2026 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 2027 | + { |
---|
| 2028 | + public void mouseClicked(MouseEvent e) |
---|
| 2029 | + { |
---|
| 2030 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 2031 | + cMaterial material = object.material; |
---|
| 2032 | + |
---|
| 2033 | + diffusenessField.setFloat(material.factor); |
---|
| 2034 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2035 | + |
---|
| 2036 | + materialtouched = true; |
---|
| 2037 | + applySelf(); |
---|
| 2038 | + } |
---|
| 2039 | + }); |
---|
| 2040 | + presetpanel.add(diffusemoon2); |
---|
| 2041 | + |
---|
| 2042 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 2043 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 2044 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 2045 | + { |
---|
| 2046 | + public void mouseClicked(MouseEvent e) |
---|
| 2047 | + { |
---|
| 2048 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 2049 | + cMaterial material = object.material; |
---|
| 2050 | + |
---|
| 2051 | + diffusenessField.setFloat(material.factor); |
---|
| 2052 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2053 | + |
---|
| 2054 | + materialtouched = true; |
---|
| 2055 | + applySelf(); |
---|
| 2056 | + } |
---|
| 2057 | + }); |
---|
| 2058 | + presetpanel.add(diffusemoon3); |
---|
| 2059 | + |
---|
| 2060 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 2061 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 2062 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 2063 | + { |
---|
| 2064 | + public void mouseClicked(MouseEvent e) |
---|
| 2065 | + { |
---|
| 2066 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 2067 | + cMaterial material = object.material; |
---|
| 2068 | + |
---|
| 2069 | + sheenField.setFloat(material.sheen); |
---|
| 2070 | + |
---|
| 2071 | + materialtouched = true; |
---|
| 2072 | + applySelf(); |
---|
| 2073 | + } |
---|
| 2074 | + }); |
---|
| 2075 | + presetpanel.add(diffusesheen); |
---|
| 2076 | + |
---|
| 2077 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2078 | + rough.setToolTipText("Rough metal"); |
---|
| 2079 | + rough.addMouseListener(new MouseAdapter() |
---|
| 2080 | + { |
---|
| 2081 | + public void mouseClicked(MouseEvent e) |
---|
| 2082 | + { |
---|
| 2083 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 2084 | + cMaterial material = object.material; |
---|
| 2085 | + |
---|
| 2086 | + shininessField.setFloat(material.shininess); |
---|
| 2087 | + velvetField.setFloat(material.velvet); |
---|
| 2088 | + |
---|
| 2089 | + materialtouched = true; |
---|
| 2090 | + applySelf(); |
---|
| 2091 | + } |
---|
| 2092 | + }); |
---|
| 2093 | + presetpanel.add(rough); |
---|
| 2094 | + |
---|
| 2095 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2096 | + rough2.setToolTipText("Medium metal"); |
---|
| 2097 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 2098 | + { |
---|
| 2099 | + public void mouseClicked(MouseEvent e) |
---|
| 2100 | + { |
---|
| 2101 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2102 | + cMaterial material = object.material; |
---|
| 2103 | + |
---|
| 2104 | + shininessField.setFloat(material.shininess); |
---|
| 2105 | + lightareaField.setFloat(material.lightarea); |
---|
| 2106 | + |
---|
| 2107 | + materialtouched = true; |
---|
| 2108 | + applySelf(); |
---|
| 2109 | + } |
---|
| 2110 | + }); |
---|
| 2111 | + presetpanel.add(rough2); |
---|
| 2112 | + |
---|
| 2113 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2114 | + shini0.setToolTipText("Shiny"); |
---|
| 2115 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2116 | + { |
---|
| 2117 | + public void mouseClicked(MouseEvent e) |
---|
| 2118 | + { |
---|
| 2119 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2120 | + cMaterial material = object.material; |
---|
| 2121 | + |
---|
| 2122 | + shininessField.setFloat(material.shininess); |
---|
| 2123 | + lightareaField.setFloat(material.lightarea); |
---|
| 2124 | + |
---|
| 2125 | + materialtouched = true; |
---|
| 2126 | + applySelf(); |
---|
| 2127 | + } |
---|
| 2128 | + }); |
---|
| 2129 | + presetpanel.add(shini0); |
---|
| 2130 | + |
---|
| 2131 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2132 | + shini1.setToolTipText("Shiny2"); |
---|
| 2133 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2134 | + { |
---|
| 2135 | + public void mouseClicked(MouseEvent e) |
---|
| 2136 | + { |
---|
| 2137 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2138 | + cMaterial material = object.material; |
---|
| 2139 | + |
---|
| 2140 | + shininessField.setFloat(material.shininess); |
---|
| 2141 | + lightareaField.setFloat(material.lightarea); |
---|
| 2142 | + |
---|
| 2143 | + materialtouched = true; |
---|
| 2144 | + applySelf(); |
---|
| 2145 | + } |
---|
| 2146 | + }); |
---|
| 2147 | + presetpanel.add(shini1); |
---|
| 2148 | + |
---|
| 2149 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2150 | + shini2.setToolTipText("Shiny3"); |
---|
| 2151 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2152 | + { |
---|
| 2153 | + public void mouseClicked(MouseEvent e) |
---|
| 2154 | + { |
---|
| 2155 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2156 | + cMaterial material = object.material; |
---|
| 2157 | + |
---|
| 2158 | + shininessField.setFloat(material.shininess); |
---|
| 2159 | + lightareaField.setFloat(material.lightarea); |
---|
| 2160 | + |
---|
| 2161 | + materialtouched = true; |
---|
| 2162 | + applySelf(); |
---|
| 2163 | + } |
---|
| 2164 | + }); |
---|
| 2165 | + presetpanel.add(shini2); |
---|
| 2166 | + |
---|
| 2167 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2168 | + aniso.setToolTipText("AnisoU"); |
---|
| 2169 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2170 | + { |
---|
| 2171 | + public void mouseClicked(MouseEvent e) |
---|
| 2172 | + { |
---|
| 2173 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2174 | + cMaterial material = object.material; |
---|
| 2175 | + |
---|
| 2176 | + anisoField.setFloat(material.aniso); |
---|
| 2177 | + anisoVField.setFloat(material.anisoV); |
---|
| 2178 | + |
---|
| 2179 | + materialtouched = true; |
---|
| 2180 | + applySelf(); |
---|
| 2181 | + } |
---|
| 2182 | + }); |
---|
| 2183 | + presetpanel.add(aniso); |
---|
| 2184 | + |
---|
| 2185 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2186 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2187 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2188 | + { |
---|
| 2189 | + public void mouseClicked(MouseEvent e) |
---|
| 2190 | + { |
---|
| 2191 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2192 | + cMaterial material = object.material; |
---|
| 2193 | + |
---|
| 2194 | + anisoField.setFloat(material.aniso); |
---|
| 2195 | + anisoVField.setFloat(material.anisoV); |
---|
| 2196 | + |
---|
| 2197 | + materialtouched = true; |
---|
| 2198 | + applySelf(); |
---|
| 2199 | + } |
---|
| 2200 | + }); |
---|
| 2201 | + presetpanel.add(aniso2); |
---|
| 2202 | + |
---|
| 2203 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2204 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2205 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2206 | + { |
---|
| 2207 | + public void mouseClicked(MouseEvent e) |
---|
| 2208 | + { |
---|
| 2209 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2210 | + cMaterial material = object.material; |
---|
| 2211 | + |
---|
| 2212 | + anisoField.setFloat(material.aniso); |
---|
| 2213 | + anisoVField.setFloat(material.anisoV); |
---|
| 2214 | + |
---|
| 2215 | + materialtouched = true; |
---|
| 2216 | + applySelf(); |
---|
| 2217 | + } |
---|
| 2218 | + }); |
---|
| 2219 | + presetpanel.add(aniso3); |
---|
| 2220 | + |
---|
| 2221 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2222 | + velvet0.setToolTipText("Velvet"); |
---|
| 2223 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2224 | + { |
---|
| 2225 | + public void mouseClicked(MouseEvent e) |
---|
| 2226 | + { |
---|
| 2227 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2228 | + cMaterial material = object.material; |
---|
| 2229 | + |
---|
| 2230 | + diffusenessField.setFloat(material.factor); |
---|
| 2231 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2232 | + sheenField.setFloat(material.sheen); |
---|
| 2233 | + shininessField.setFloat(material.shininess); |
---|
| 2234 | + velvetField.setFloat(material.velvet); |
---|
| 2235 | + shiftField.setFloat(material.shift); |
---|
| 2236 | + |
---|
| 2237 | + materialtouched = true; |
---|
| 2238 | + applySelf(); |
---|
| 2239 | + } |
---|
| 2240 | + }); |
---|
| 2241 | + presetpanel.add(velvet0); |
---|
| 2242 | + |
---|
| 2243 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2244 | + bump0.setToolTipText("Bump texture"); |
---|
| 2245 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2246 | + { |
---|
| 2247 | + public void mouseClicked(MouseEvent e) |
---|
| 2248 | + { |
---|
| 2249 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2250 | + cMaterial material = object.material; |
---|
| 2251 | + |
---|
| 2252 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2253 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2254 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2255 | + |
---|
| 2256 | + materialtouched = true; |
---|
| 2257 | + applySelf(); |
---|
| 2258 | + } |
---|
| 2259 | + }); |
---|
| 2260 | + presetpanel.add(bump0); |
---|
| 2261 | + |
---|
| 2262 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF); |
---|
| 2263 | + borderShader.setToolTipText("Border fade"); |
---|
| 2264 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2265 | + { |
---|
| 2266 | + public void mouseClicked(MouseEvent e) |
---|
| 2267 | + { |
---|
| 2268 | + borderfadeField.setFloat(0.5); |
---|
| 2269 | + opacityField.setFloat(0.75); |
---|
| 2270 | + |
---|
| 2271 | + materialtouched = true; |
---|
| 2272 | + applySelf(); |
---|
| 2273 | + } |
---|
| 2274 | + }); |
---|
| 2275 | + presetpanel.add(borderShader); |
---|
| 2276 | + |
---|
| 2277 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2278 | + halo.setToolTipText("Halo"); |
---|
| 2279 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2280 | + { |
---|
| 2281 | + public void mouseClicked(MouseEvent e) |
---|
| 2282 | + { |
---|
| 2283 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2284 | + cMaterial material = object.material; |
---|
| 2285 | + |
---|
| 2286 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2287 | + |
---|
| 2288 | + materialtouched = true; |
---|
| 2289 | + applySelf(); |
---|
| 2290 | + } |
---|
| 2291 | + }); |
---|
| 2292 | + presetpanel.add(halo); |
---|
| 2293 | + |
---|
| 2294 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2295 | + candle.setToolTipText("Candle"); |
---|
| 2296 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2297 | + { |
---|
| 2298 | + public void mouseClicked(MouseEvent e) |
---|
| 2299 | + { |
---|
| 2300 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2301 | + cMaterial material = object.material; |
---|
| 2302 | + |
---|
| 2303 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2304 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2305 | + ambientField.setFloat(material.ambient); |
---|
| 2306 | + specularField.setFloat(material.specular); |
---|
| 2307 | + lightareaField.setFloat(material.lightarea); |
---|
| 2308 | + shininessField.setFloat(material.shininess); |
---|
| 2309 | + |
---|
| 2310 | + materialtouched = true; |
---|
| 2311 | + applySelf(); |
---|
| 2312 | + } |
---|
| 2313 | + }); |
---|
| 2314 | + presetpanel.add(candle); |
---|
| 2315 | + |
---|
| 2316 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2317 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2318 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2319 | + { |
---|
| 2320 | + public void mouseClicked(MouseEvent e) |
---|
| 2321 | + { |
---|
| 2322 | + diffuseField.setFloat(0.001); |
---|
| 2323 | + ambientField.setFloat(0.001); |
---|
| 2324 | + cameraField.setFloat(0.001); |
---|
| 2325 | + specularField.setFloat(0.001); |
---|
| 2326 | + fakedepthField.setFloat(0.001); |
---|
| 2327 | + opacityField.setFloat(0.6); |
---|
| 2328 | + |
---|
| 2329 | + materialtouched = true; |
---|
| 2330 | + applySelf(); |
---|
| 2331 | + } |
---|
| 2332 | + }); |
---|
| 2333 | + presetpanel.add(shadowShader); |
---|
| 2334 | + |
---|
| 2335 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2336 | + |
---|
| 2337 | + presetpanel.preferredWidth = 1; |
---|
| 2338 | + |
---|
| 2339 | + materialpanel.add(presetpanel); |
---|
| 2340 | + materialpanel.add(panel); |
---|
| 2341 | + |
---|
| 2342 | + panel.preferredWidth = 8; |
---|
| 2343 | + |
---|
| 2344 | + /* |
---|
1476 | 2345 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1477 | 2346 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1478 | | - */ |
---|
| 2347 | + */ |
---|
1479 | 2348 | |
---|
1480 | 2349 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1481 | 2350 | |
---|
.. | .. |
---|
1509 | 2378 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1510 | 2379 | |
---|
1511 | 2380 | cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 2381 | + |
---|
| 2382 | + cGridBag huepanel = new cGridBag(); |
---|
| 2383 | + cGridBag huelabel = new cGridBag(); |
---|
| 2384 | + cLabel hue = GetLabel("icons/hue.png", false); |
---|
| 2385 | + hue.fit = true; |
---|
| 2386 | + |
---|
| 2387 | + hue.addMouseListener(new MouseAdapter() |
---|
| 2388 | + { |
---|
| 2389 | + public void mousePressed(MouseEvent e) |
---|
| 2390 | + { |
---|
| 2391 | + int x = e.getX(); |
---|
| 2392 | + |
---|
| 2393 | + colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth()); |
---|
| 2394 | + } |
---|
| 2395 | + }); |
---|
| 2396 | + |
---|
| 2397 | + huelabel.add(hue); |
---|
| 2398 | + huelabel.preferredWidth = 20; |
---|
| 2399 | + huepanel.add(new cGridBag()); // Label |
---|
| 2400 | + huepanel.add(huelabel); // Field/slider |
---|
| 2401 | + |
---|
| 2402 | + huepanel.preferredHeight = 7; |
---|
| 2403 | + |
---|
| 2404 | + colorSection.add(huepanel); |
---|
1512 | 2405 | |
---|
1513 | 2406 | cGridBag color = new cGridBag(); |
---|
1514 | | - color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
1515 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1516 | | - color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2407 | + |
---|
| 2408 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2409 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2410 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2411 | + |
---|
1517 | 2412 | //colorField.preferredWidth = 200; |
---|
1518 | 2413 | colorSection.add(color); |
---|
1519 | 2414 | |
---|
1520 | 2415 | cGridBag modulation = new cGridBag(); |
---|
1521 | 2416 | modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
1522 | 2417 | modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1523 | | - modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2418 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1524 | 2419 | colorSection.add(modulation); |
---|
1525 | 2420 | |
---|
| 2421 | + cGridBag opacity = new cGridBag(); |
---|
| 2422 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2423 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2424 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2425 | + colorSection.add(opacity); |
---|
| 2426 | + |
---|
| 2427 | + colorSection.add(GetSeparator()); |
---|
| 2428 | + |
---|
1526 | 2429 | cGridBag texture = new cGridBag(); |
---|
1527 | 2430 | texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
1528 | 2431 | textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1529 | 2432 | texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1530 | 2433 | colorSection.add(texture); |
---|
1531 | 2434 | |
---|
1532 | | - cGridBag anisoU = new cGridBag(); |
---|
1533 | | - anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
1534 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1535 | | - anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1536 | | - colorSection.add(anisoU); |
---|
1537 | | - |
---|
1538 | | - cGridBag anisoV = new cGridBag(); |
---|
1539 | | - anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
1540 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1541 | | - anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1542 | | - colorSection.add(anisoV); |
---|
1543 | | - |
---|
1544 | | - cGridBag shadowbias = new cGridBag(); |
---|
1545 | | - shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
1546 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1547 | | - shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1548 | | - colorSection.add(shadowbias); |
---|
1549 | | - |
---|
1550 | | - panel.add(new JSeparator()); |
---|
| 2435 | + panel.add(GetSeparator()); |
---|
1551 | 2436 | |
---|
1552 | 2437 | panel.add(colorSection); |
---|
1553 | 2438 | |
---|
.. | .. |
---|
1597 | 2482 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1598 | 2483 | diffuseSection.add(fakedepth); |
---|
1599 | 2484 | |
---|
1600 | | - panel.add(new JSeparator()); |
---|
| 2485 | + cGridBag shadowbias = new cGridBag(); |
---|
| 2486 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 2487 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2488 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2489 | + diffuseSection.add(shadowbias); |
---|
| 2490 | + |
---|
| 2491 | + panel.add(GetSeparator()); |
---|
1601 | 2492 | |
---|
1602 | 2493 | panel.add(diffuseSection); |
---|
1603 | 2494 | |
---|
.. | .. |
---|
1647 | 2538 | // aConstraints.gridy += 1; |
---|
1648 | 2539 | // aConstraints.gridwidth = 1; |
---|
1649 | 2540 | |
---|
| 2541 | + cGridBag anisoU = new cGridBag(); |
---|
| 2542 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 2543 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2544 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2545 | + specularSection.add(anisoU); |
---|
1650 | 2546 | |
---|
1651 | | - panel.add(new JSeparator()); |
---|
| 2547 | + cGridBag anisoV = new cGridBag(); |
---|
| 2548 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 2549 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2550 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2551 | + specularSection.add(anisoV); |
---|
| 2552 | + |
---|
| 2553 | + |
---|
| 2554 | + panel.add(GetSeparator()); |
---|
1652 | 2555 | |
---|
1653 | 2556 | panel.add(specularSection); |
---|
1654 | 2557 | |
---|
1655 | 2558 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1656 | 2559 | |
---|
1657 | | - cGridBag globalSection = new cGridBag().setVertical(true); |
---|
| 2560 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1658 | 2561 | |
---|
1659 | 2562 | cGridBag camera = new cGridBag(); |
---|
1660 | 2563 | camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
1661 | 2564 | cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1662 | 2565 | camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1663 | | - globalSection.add(camera); |
---|
| 2566 | + colorSection.add(camera); |
---|
1664 | 2567 | |
---|
1665 | 2568 | cGridBag ambient = new cGridBag(); |
---|
1666 | 2569 | ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
1667 | 2570 | ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1668 | 2571 | ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1669 | | - globalSection.add(ambient); |
---|
| 2572 | + colorSection.add(ambient); |
---|
1670 | 2573 | |
---|
1671 | 2574 | cGridBag backlit = new cGridBag(); |
---|
1672 | 2575 | backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
1673 | 2576 | backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1674 | 2577 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1675 | | - globalSection.add(backlit); |
---|
| 2578 | + colorSection.add(backlit); |
---|
1676 | 2579 | |
---|
1677 | | - cGridBag opacity = new cGridBag(); |
---|
1678 | | - opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
1679 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1680 | | - opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1681 | | - globalSection.add(opacity); |
---|
1682 | | - |
---|
1683 | | - panel.add(new JSeparator()); |
---|
| 2580 | + //panel.add(new JSeparator()); |
---|
1684 | 2581 | |
---|
1685 | | - panel.add(globalSection); |
---|
| 2582 | + //panel.add(globalSection); |
---|
1686 | 2583 | |
---|
1687 | 2584 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1688 | 2585 | |
---|
.. | .. |
---|
1724 | 2621 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1725 | 2622 | textureSection.add(opacityPower); |
---|
1726 | 2623 | |
---|
1727 | | - panel.add(new JSeparator()); |
---|
| 2624 | + panel.add(GetSeparator()); |
---|
1728 | 2625 | |
---|
1729 | 2626 | panel.add(textureSection); |
---|
1730 | 2627 | |
---|
.. | .. |
---|
1789 | 2686 | // 3D models |
---|
1790 | 2687 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1791 | 2688 | { |
---|
1792 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1793 | | - LoadFile(filename, lastConverter); |
---|
| 2689 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2690 | + //LoadFile(filename, lastConverter); |
---|
| 2691 | + LoadObjFile(filename); // New 3ds loader |
---|
1794 | 2692 | continue; |
---|
1795 | 2693 | } |
---|
1796 | 2694 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
1991 | 2889 | e2.printStackTrace(); |
---|
1992 | 2890 | } |
---|
1993 | 2891 | } |
---|
| 2892 | + |
---|
1994 | 2893 | LoadJMEThread loadThread; |
---|
1995 | 2894 | |
---|
1996 | 2895 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2048 | 2947 | //LoadFile0(filename, converter); |
---|
2049 | 2948 | } |
---|
2050 | 2949 | } |
---|
| 2950 | + |
---|
2051 | 2951 | LoadOBJThread loadObjThread; |
---|
2052 | 2952 | |
---|
2053 | 2953 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2126 | 3026 | |
---|
2127 | 3027 | void LoadObjFile(String fullname) |
---|
2128 | 3028 | { |
---|
2129 | | - /* |
---|
| 3029 | + System.out.println("Loading " + fullname); |
---|
| 3030 | + /**/ |
---|
2130 | 3031 | //lastFilename = fullname; |
---|
2131 | 3032 | if(loadObjThread == null) |
---|
2132 | 3033 | { |
---|
2133 | | - loadObjThread = new LoadOBJThread(); |
---|
2134 | | - loadObjThread.start(); |
---|
| 3034 | + loadObjThread = new LoadOBJThread(); |
---|
| 3035 | + loadObjThread.start(); |
---|
2135 | 3036 | } |
---|
2136 | 3037 | |
---|
2137 | 3038 | loadObjThread.add(fullname); |
---|
2138 | | - */ |
---|
| 3039 | + /**/ |
---|
2139 | 3040 | |
---|
2140 | | - System.out.println("Loading " + fullname); |
---|
2141 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 3041 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2142 | 3042 | } |
---|
2143 | 3043 | |
---|
2144 | 3044 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2514 | 3414 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2515 | 3415 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2516 | 3416 | } |
---|
| 3417 | + |
---|
2517 | 3418 | //cJME.count++; |
---|
2518 | 3419 | //cJME.count %= 12; |
---|
2519 | 3420 | if (gc) |
---|
.. | .. |
---|
2697 | 3598 | } |
---|
2698 | 3599 | } |
---|
2699 | 3600 | } |
---|
| 3601 | + |
---|
2700 | 3602 | cFileSystemPane FSPane; |
---|
2701 | 3603 | |
---|
2702 | 3604 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2706 | 3608 | |
---|
2707 | 3609 | freezematerial = true; |
---|
2708 | 3610 | colorField.setFloat(mat.color); |
---|
2709 | | - modulationField.setFloat(mat.modulation); |
---|
| 3611 | + saturationField.setFloat(mat.modulation); |
---|
2710 | 3612 | metalnessField.setFloat(mat.metalness); |
---|
2711 | 3613 | diffuseField.setFloat(mat.diffuse); |
---|
2712 | 3614 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
2750 | 3652 | } |
---|
2751 | 3653 | } |
---|
2752 | 3654 | } |
---|
| 3655 | + |
---|
2753 | 3656 | freezematerial = false; |
---|
2754 | 3657 | } |
---|
2755 | 3658 | |
---|
2756 | 3659 | void SetMaterial(Object3D object) |
---|
2757 | 3660 | { |
---|
| 3661 | + latestObject = object; |
---|
| 3662 | + |
---|
2758 | 3663 | cMaterial mat = object.material; |
---|
2759 | 3664 | |
---|
2760 | 3665 | if (mat == null) |
---|
.. | .. |
---|
2765 | 3670 | |
---|
2766 | 3671 | if (multiplyToggle != null) |
---|
2767 | 3672 | multiplyToggle.setSelected(mat.multiply); |
---|
2768 | | - |
---|
2769 | | - assert (object.projectedVertices != null); |
---|
2770 | | - |
---|
2771 | | - if (object.projectedVertices.length <= 2) |
---|
2772 | | - { |
---|
2773 | | - // Side effect... |
---|
2774 | | - Object3D.cVector2[] keep = object.projectedVertices; |
---|
2775 | | - object.projectedVertices = new Object3D.cVector2[3]; |
---|
2776 | | - for (int i = 0; i < 3; i++) |
---|
2777 | | - { |
---|
2778 | | - if (i < keep.length) |
---|
2779 | | - { |
---|
2780 | | - object.projectedVertices[i] = keep[i]; |
---|
2781 | | - } else |
---|
2782 | | - { |
---|
2783 | | - object.projectedVertices[i] = new Object3D.cVector2(); |
---|
2784 | | - } |
---|
2785 | | - /* |
---|
2786 | | - if(keep.length == 0) |
---|
2787 | | - object.projectedVertices[0] = new Object3D.cVector2(); |
---|
2788 | | - else |
---|
2789 | | - object.projectedVertices[0] = keep[0]; |
---|
2790 | | - object.projectedVertices[1] = new Object3D.cVector2(); |
---|
2791 | | - */ |
---|
2792 | | - } |
---|
2793 | | - } |
---|
| 3673 | + |
---|
| 3674 | + AllocProjectedVertices(object); |
---|
2794 | 3675 | |
---|
2795 | 3676 | SetMaterial(mat, object.projectedVertices); |
---|
2796 | 3677 | } |
---|
.. | .. |
---|
2866 | 3747 | // } |
---|
2867 | 3748 | |
---|
2868 | 3749 | /**/ |
---|
2869 | | - if (deselect) |
---|
| 3750 | + if (deselect || child == null) |
---|
2870 | 3751 | { |
---|
2871 | 3752 | //group.deselectAll(); |
---|
2872 | 3753 | //freeze = true; |
---|
2873 | 3754 | GetTree().clearSelection(); |
---|
2874 | 3755 | //freeze = false; |
---|
| 3756 | + |
---|
| 3757 | + if (child == null) |
---|
| 3758 | + { |
---|
| 3759 | + return; |
---|
| 3760 | + } |
---|
2875 | 3761 | } |
---|
2876 | 3762 | |
---|
2877 | 3763 | //group.addSelectee(child); |
---|
.. | .. |
---|
2905 | 3791 | public void itemStateChanged(ItemEvent event) |
---|
2906 | 3792 | { |
---|
2907 | 3793 | // System.out.println("Propagate = " + propagate); |
---|
| 3794 | + if (event.getSource() == pinButton) |
---|
| 3795 | + { |
---|
| 3796 | + copy.pinned ^= true; |
---|
| 3797 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3798 | + { |
---|
| 3799 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3800 | + copy.CloseUI(); |
---|
| 3801 | + //copy.editWindow.refreshContents(); |
---|
| 3802 | + } |
---|
| 3803 | + } |
---|
| 3804 | + else |
---|
2908 | 3805 | if (event.getSource() == propagateToggle) |
---|
2909 | 3806 | { |
---|
2910 | 3807 | propagate ^= true; |
---|
.. | .. |
---|
2940 | 3837 | cameraView.ToggleDL(); |
---|
2941 | 3838 | cameraView.repaint(); |
---|
2942 | 3839 | return; |
---|
2943 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3840 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2944 | 3841 | { |
---|
2945 | 3842 | cameraView.ToggleTexture(); |
---|
2946 | 3843 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
2979 | 3876 | frame.validate(); |
---|
2980 | 3877 | |
---|
2981 | 3878 | return; |
---|
2982 | | - } else if (event.getSource() == toggleSwitchItem) |
---|
| 3879 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
2983 | 3880 | { |
---|
2984 | | - cameraView.ToggleRandom(); |
---|
| 3881 | + cameraView.ToggleSwitch(); |
---|
2985 | 3882 | cameraView.repaint(); |
---|
2986 | 3883 | return; |
---|
2987 | 3884 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3009 | 3906 | } else if (event.getSource() == liveCB) |
---|
3010 | 3907 | { |
---|
3011 | 3908 | copy.live ^= true; |
---|
| 3909 | + objEditor.refreshContents(true); // To show item colors |
---|
3012 | 3910 | return; |
---|
3013 | | - } else if (event.getSource() == selectCB) |
---|
| 3911 | + } else if (event.getSource() == selectableCB) |
---|
3014 | 3912 | { |
---|
3015 | 3913 | copy.dontselect ^= true; |
---|
3016 | 3914 | return; |
---|
.. | .. |
---|
3018 | 3916 | { |
---|
3019 | 3917 | copy.hide ^= true; |
---|
3020 | 3918 | copy.Touch(); // display list issue |
---|
3021 | | - objEditor.refreshContents(); |
---|
| 3919 | + objEditor.refreshContents(true); // To show item colors |
---|
3022 | 3920 | return; |
---|
3023 | 3921 | } else if (event.getSource() == link2masterCB) |
---|
3024 | 3922 | { |
---|
.. | .. |
---|
3052 | 3950 | |
---|
3053 | 3951 | public void actionPerformed(ActionEvent event) |
---|
3054 | 3952 | { |
---|
| 3953 | + Object source = event.getSource(); |
---|
3055 | 3954 | // SCRIPT DIALOG |
---|
3056 | | - if (event.getSource() == okbutton) |
---|
| 3955 | + if (source == okbutton) |
---|
3057 | 3956 | { |
---|
3058 | 3957 | textpanel.setVisible(false); |
---|
3059 | 3958 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3065 | 3964 | textarea = null; |
---|
3066 | 3965 | textpanel = null; |
---|
3067 | 3966 | } |
---|
3068 | | - if (event.getSource() == cancelbutton) |
---|
| 3967 | + if (source == cancelbutton) |
---|
3069 | 3968 | { |
---|
3070 | 3969 | textpanel.setVisible(false); |
---|
3071 | 3970 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3077 | 3976 | //applySelf(); |
---|
3078 | 3977 | //client.refreshEditWindow(); |
---|
3079 | 3978 | //refreshContents(); |
---|
3080 | | - if (event.getSource() == nameField) |
---|
| 3979 | + if (source == nameField) |
---|
3081 | 3980 | { |
---|
3082 | 3981 | //System.out.println("ObjEditor " + event); |
---|
3083 | 3982 | applySelf0(true); |
---|
3084 | 3983 | //parent.applySelf(); |
---|
3085 | | - objEditor.refreshContents(); |
---|
3086 | | - } else if (event.getSource() == resetButton) |
---|
| 3984 | + // conflicts with requestFocus objEditor.refreshContents(); |
---|
| 3985 | + } else if (source == resetButton) |
---|
3087 | 3986 | { |
---|
3088 | 3987 | CameraPane.fullreset = true; |
---|
3089 | 3988 | copy.Reset(); // ResetMeshes(); |
---|
3090 | 3989 | copy.Touch(); |
---|
3091 | 3990 | objEditor.refreshContents(); |
---|
3092 | | - } else if (event.getSource() == stepItem) |
---|
| 3991 | + } else if (source == stepItem) |
---|
3093 | 3992 | { |
---|
3094 | 3993 | //cameraView.ONESTEP = true; |
---|
3095 | 3994 | Globals.ONESTEP = true; |
---|
3096 | 3995 | cameraView.repaint(); |
---|
3097 | 3996 | return; |
---|
3098 | | - } else if (event.getSource() == stepButton) |
---|
| 3997 | + } else if (source == stepButton) |
---|
3099 | 3998 | { |
---|
3100 | 3999 | copy.Step(); |
---|
3101 | 4000 | copy.Touch(); |
---|
3102 | 4001 | objEditor.refreshContents(); |
---|
3103 | | - } else if (event.getSource() == slowerButton) |
---|
| 4002 | + } else if (source == slowerButton) |
---|
3104 | 4003 | { |
---|
3105 | 4004 | copy.Slower(); |
---|
3106 | 4005 | copy.Touch(); |
---|
3107 | 4006 | objEditor.refreshContents(); |
---|
3108 | | - } else if (event.getSource() == fasterButton) |
---|
| 4007 | + } else if (source == fasterButton) |
---|
3109 | 4008 | { |
---|
3110 | 4009 | copy.Faster(); |
---|
3111 | 4010 | copy.Touch(); |
---|
3112 | 4011 | objEditor.refreshContents(); |
---|
3113 | | - } else if (event.getSource() == remarkButton) |
---|
| 4012 | + } else if (source == remarkButton) |
---|
3114 | 4013 | { |
---|
3115 | 4014 | copy.Remark(); |
---|
3116 | 4015 | copy.Touch(); |
---|
3117 | 4016 | objEditor.refreshContents(); |
---|
3118 | | - } else if (event.getSource() == stepAllButton) |
---|
| 4017 | + } else if (source == stepAllButton) |
---|
3119 | 4018 | { |
---|
3120 | 4019 | copy.StepAll(); |
---|
3121 | 4020 | copy.Touch(); |
---|
3122 | 4021 | objEditor.refreshContents(); |
---|
3123 | | - } else if (event.getSource() == resetAllButton) |
---|
| 4022 | + } else if (source == resetAllButton) |
---|
3124 | 4023 | { |
---|
3125 | 4024 | //CameraPane.fullreset = true; |
---|
3126 | 4025 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3153 | 4052 | // Close(); |
---|
3154 | 4053 | // } |
---|
3155 | 4054 | // else |
---|
3156 | | - if (event.getSource() == resetSlidersButton) |
---|
| 4055 | + if (source == resetSlidersButton) |
---|
3157 | 4056 | { |
---|
3158 | 4057 | ResetSliders(); |
---|
3159 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 4058 | + } else if (source == clearMaterialButton) |
---|
3160 | 4059 | { |
---|
3161 | 4060 | ClearMaterial(); |
---|
3162 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 4061 | + } else if (source == createMaterialButton) |
---|
3163 | 4062 | { |
---|
3164 | 4063 | CreateMaterial(); |
---|
3165 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 4064 | + } else if (source == clearPanelButton) |
---|
3166 | 4065 | { |
---|
3167 | 4066 | copy.ClearUI(); |
---|
3168 | 4067 | refreshContents(true); |
---|
3169 | | - } /* |
---|
3170 | | - } |
---|
3171 | | - |
---|
3172 | | - public boolean action(Event event, Object arg) |
---|
3173 | | - { |
---|
3174 | | - */ else if (event.getSource() == closeItem) |
---|
| 4068 | + } else if (source == importGFDItem) |
---|
| 4069 | + { |
---|
| 4070 | + ImportGFD(); |
---|
| 4071 | + } else |
---|
| 4072 | + if (source == importVRMLX3DItem) |
---|
| 4073 | + { |
---|
| 4074 | + ImportVRMLX3D(); |
---|
| 4075 | + } else |
---|
| 4076 | + if (source == import3DSItem) |
---|
| 4077 | + { |
---|
| 4078 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 4079 | + } else |
---|
| 4080 | + if (source == importOBJItem) |
---|
| 4081 | + { |
---|
| 4082 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 4083 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 4084 | + browser.setVisible(true); |
---|
| 4085 | + String filename = browser.getFile(); |
---|
| 4086 | + if (filename != null && filename.length() > 0) |
---|
| 4087 | + { |
---|
| 4088 | + String fullname = browser.getDirectory() + filename; |
---|
| 4089 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 4090 | + } |
---|
| 4091 | + } else |
---|
| 4092 | + if (source == closeItem) |
---|
3175 | 4093 | { |
---|
3176 | 4094 | Close(); |
---|
3177 | 4095 | //return true; |
---|
3178 | | - } else if (event.getSource() == loadItem) |
---|
| 4096 | + } else if (source == openItem) |
---|
3179 | 4097 | { |
---|
3180 | | - load(); |
---|
| 4098 | + Open(); |
---|
3181 | 4099 | //return true; |
---|
3182 | | - } else if (event.getSource() == saveItem) |
---|
| 4100 | + } else if (source == newItem) |
---|
| 4101 | + { |
---|
| 4102 | + New(); |
---|
| 4103 | + } else if (source == saveItem) |
---|
3183 | 4104 | { |
---|
3184 | 4105 | save(); |
---|
3185 | 4106 | //return true; |
---|
3186 | | - } else if (event.getSource() == saveAsItem) |
---|
| 4107 | + } else if (source == saveAsItem) |
---|
3187 | 4108 | { |
---|
3188 | 4109 | saveAs(); |
---|
3189 | 4110 | //return true; |
---|
3190 | | - } else if (event.getSource() == reexportItem) |
---|
| 4111 | + } else if (source == reexportItem) |
---|
3191 | 4112 | { |
---|
3192 | 4113 | reexport(); |
---|
3193 | 4114 | //return true; |
---|
3194 | | - } else if (event.getSource() == exportAsItem) |
---|
| 4115 | + } else if (source == exportAsItem) |
---|
3195 | 4116 | { |
---|
3196 | 4117 | export(); |
---|
3197 | 4118 | //return true; |
---|
3198 | | - } else if (event.getSource() == povItem) |
---|
| 4119 | + } else if (source == povItem) |
---|
3199 | 4120 | { |
---|
3200 | 4121 | generatePOV(); |
---|
3201 | 4122 | //return true; |
---|
3202 | | - } else if (event.getSource() == zBufferItem) |
---|
| 4123 | + } else if (event.getSource() == archiveItem) |
---|
| 4124 | + { |
---|
| 4125 | + cTools.Archive(frame); |
---|
| 4126 | + return; |
---|
| 4127 | + } else if (source == zBufferItem) |
---|
3203 | 4128 | { |
---|
3204 | 4129 | try |
---|
3205 | 4130 | { |
---|
.. | .. |
---|
3221 | 4146 | cameraView.repaint(); |
---|
3222 | 4147 | //return true; |
---|
3223 | 4148 | } |
---|
3224 | | - */ else if (event.getSource() == editCameraItem) |
---|
3225 | | - { |
---|
3226 | | - cameraView.ProtectCamera(); |
---|
3227 | | - cameraView.repaint(); |
---|
3228 | | - return; |
---|
3229 | | - } else if (event.getSource() == revertCameraItem) |
---|
3230 | | - { |
---|
3231 | | - cameraView.RevertCamera(); |
---|
3232 | | - cameraView.repaint(); |
---|
3233 | | - return; |
---|
3234 | | -// } else if (event.getSource() == textureButton) |
---|
3235 | | -// { |
---|
3236 | | -// return; // true; |
---|
3237 | | - } else // combos... |
---|
3238 | | - if (event.getSource() == texresMenu) |
---|
| 4149 | + */ else // combos... |
---|
| 4150 | + if (source == texresMenu) |
---|
3239 | 4151 | { |
---|
3240 | 4152 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3241 | 4153 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3247 | 4159 | } |
---|
3248 | 4160 | } |
---|
3249 | 4161 | |
---|
| 4162 | + void New() |
---|
| 4163 | + { |
---|
| 4164 | + while (copy.Size() > 1) |
---|
| 4165 | + { |
---|
| 4166 | + copy.remove(1); |
---|
| 4167 | + } |
---|
| 4168 | + |
---|
| 4169 | + ResetModel(); |
---|
| 4170 | + objEditor.refreshContents(); |
---|
| 4171 | + } |
---|
| 4172 | + |
---|
| 4173 | + static public byte[] Compress(Object3D o) |
---|
| 4174 | + { |
---|
| 4175 | + // Slower to actually compress. |
---|
| 4176 | + try |
---|
| 4177 | + { |
---|
| 4178 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4179 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 4180 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
| 4181 | + |
---|
| 4182 | + Object3D parent = o.parent; |
---|
| 4183 | + o.parent = null; |
---|
| 4184 | + |
---|
| 4185 | + out.writeObject(o); |
---|
| 4186 | + |
---|
| 4187 | + o.parent = parent; |
---|
| 4188 | + |
---|
| 4189 | + out.flush(); |
---|
| 4190 | + |
---|
| 4191 | + baos //zstream |
---|
| 4192 | + .close(); |
---|
| 4193 | + out.close(); |
---|
| 4194 | + |
---|
| 4195 | + byte[] bytes = baos.toByteArray(); |
---|
| 4196 | + |
---|
| 4197 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 4198 | + return bytes; |
---|
| 4199 | + } catch (Exception e) |
---|
| 4200 | + { |
---|
| 4201 | + System.err.println(e); |
---|
| 4202 | + return null; |
---|
| 4203 | + } |
---|
| 4204 | + } |
---|
| 4205 | + |
---|
| 4206 | + static public Object Uncompress(byte[] bytes) |
---|
| 4207 | + { |
---|
| 4208 | + System.out.println("restore #bytes = " + bytes.length); |
---|
| 4209 | + try |
---|
| 4210 | + { |
---|
| 4211 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4212 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 4213 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
| 4214 | + Object obj = in.readObject(); |
---|
| 4215 | + |
---|
| 4216 | + bais //istream |
---|
| 4217 | + .close(); |
---|
| 4218 | + in.close(); |
---|
| 4219 | + |
---|
| 4220 | + return obj; |
---|
| 4221 | + } catch (Exception e) |
---|
| 4222 | + { |
---|
| 4223 | + System.err.println(e); |
---|
| 4224 | + return null; |
---|
| 4225 | + } |
---|
| 4226 | + } |
---|
| 4227 | + |
---|
| 4228 | + static public Object clone(Object o) |
---|
| 4229 | + { |
---|
| 4230 | + try |
---|
| 4231 | + { |
---|
| 4232 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4233 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 4234 | + |
---|
| 4235 | + out.writeObject(o); |
---|
| 4236 | + |
---|
| 4237 | + out.flush(); |
---|
| 4238 | + out.close(); |
---|
| 4239 | + |
---|
| 4240 | + byte[] bytes = baos.toByteArray(); |
---|
| 4241 | + |
---|
| 4242 | + System.out.println("clone = " + bytes.length); |
---|
| 4243 | + |
---|
| 4244 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4245 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 4246 | + Object obj = in.readObject(); |
---|
| 4247 | + in.close(); |
---|
| 4248 | + |
---|
| 4249 | + return obj; |
---|
| 4250 | + } catch (Exception e) |
---|
| 4251 | + { |
---|
| 4252 | + System.err.println(e); |
---|
| 4253 | + return null; |
---|
| 4254 | + } |
---|
| 4255 | + } |
---|
| 4256 | + |
---|
| 4257 | + cRadio GetCurrentTab() |
---|
| 4258 | + { |
---|
| 4259 | + cRadio ab; |
---|
| 4260 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4261 | + { |
---|
| 4262 | + ab = (cRadio)e.nextElement(); |
---|
| 4263 | + if(ab.GetObject() == copy) |
---|
| 4264 | + { |
---|
| 4265 | + return ab; |
---|
| 4266 | + } |
---|
| 4267 | + } |
---|
| 4268 | + |
---|
| 4269 | + return null; |
---|
| 4270 | + } |
---|
| 4271 | + |
---|
| 4272 | + |
---|
| 4273 | + public void Save() |
---|
| 4274 | + { |
---|
| 4275 | + //Save(true); |
---|
| 4276 | + Replace(); |
---|
| 4277 | + SetVersionStates(); |
---|
| 4278 | + } |
---|
| 4279 | + |
---|
| 4280 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 4281 | + { |
---|
| 4282 | + if (compress.length != name.length) |
---|
| 4283 | + { |
---|
| 4284 | + return false; |
---|
| 4285 | + } |
---|
| 4286 | + |
---|
| 4287 | + for (int i=compress.length; --i>=0;) |
---|
| 4288 | + { |
---|
| 4289 | + if (compress[i] != name[i]) |
---|
| 4290 | + return false; |
---|
| 4291 | + } |
---|
| 4292 | + |
---|
| 4293 | + return true; |
---|
| 4294 | + } |
---|
| 4295 | + |
---|
| 4296 | + void DeleteVersion() |
---|
| 4297 | + { |
---|
| 4298 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4299 | + { |
---|
| 4300 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4301 | + } |
---|
| 4302 | + |
---|
| 4303 | + if (copy.versionlist[copy.versionindex] == null) |
---|
| 4304 | + copy.versionindex -= 1; |
---|
| 4305 | + |
---|
| 4306 | + if (copy.versionindex != -1) |
---|
| 4307 | + CopyChanged(); |
---|
| 4308 | + |
---|
| 4309 | + SetVersionStates(); |
---|
| 4310 | + } |
---|
| 4311 | + |
---|
| 4312 | + public boolean Save(boolean user) |
---|
| 4313 | + { |
---|
| 4314 | + System.err.println("Save"); |
---|
| 4315 | + Replace(); |
---|
| 4316 | + |
---|
| 4317 | + //cRadio tab = GetCurrentTab(); |
---|
| 4318 | + |
---|
| 4319 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
| 4320 | + |
---|
| 4321 | + boolean thesame = false; |
---|
| 4322 | + |
---|
| 4323 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4324 | +// { |
---|
| 4325 | +// thesame = true; |
---|
| 4326 | +// } |
---|
| 4327 | + |
---|
| 4328 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 4329 | + if (!thesame) |
---|
| 4330 | + { |
---|
| 4331 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4332 | + { |
---|
| 4333 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4334 | + } |
---|
| 4335 | + |
---|
| 4336 | + //tab.user[tab.versionindex] = user; |
---|
| 4337 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 4338 | + |
---|
| 4339 | + copy.versionlist[++copy.versionindex] = compress; |
---|
| 4340 | + |
---|
| 4341 | + // if (increment) |
---|
| 4342 | + // tab.versionindex++; |
---|
| 4343 | + } |
---|
| 4344 | + |
---|
| 4345 | + //copy.RestoreBigData(versiontable); |
---|
| 4346 | + |
---|
| 4347 | + //assert(hashtable.isEmpty()); |
---|
| 4348 | + |
---|
| 4349 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4350 | +// { |
---|
| 4351 | +// //tab.user[i] = false; |
---|
| 4352 | +// copy.versionlist[i] = null; |
---|
| 4353 | +// } |
---|
| 4354 | + |
---|
| 4355 | + SetVersionStates(); |
---|
| 4356 | + |
---|
| 4357 | + // test save |
---|
| 4358 | + if (false) |
---|
| 4359 | + { |
---|
| 4360 | + try |
---|
| 4361 | + { |
---|
| 4362 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
| 4363 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4364 | + |
---|
| 4365 | + p.writeObject(copy); |
---|
| 4366 | + |
---|
| 4367 | + p.flush(); |
---|
| 4368 | + |
---|
| 4369 | + ostream.close(); |
---|
| 4370 | + } catch (Exception e) |
---|
| 4371 | + { |
---|
| 4372 | + e.printStackTrace(); |
---|
| 4373 | + } |
---|
| 4374 | + } |
---|
| 4375 | + |
---|
| 4376 | + return !thesame; |
---|
| 4377 | + } |
---|
| 4378 | + |
---|
| 4379 | + boolean flashIt = true; |
---|
| 4380 | + |
---|
| 4381 | + void RefreshSelection() |
---|
| 4382 | + { |
---|
| 4383 | + Object3D selection = new Object3D(); |
---|
| 4384 | + |
---|
| 4385 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4386 | + { |
---|
| 4387 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4388 | + |
---|
| 4389 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4390 | + |
---|
| 4391 | + if (obj == null) |
---|
| 4392 | + { |
---|
| 4393 | + copy.selection.remove(i--); |
---|
| 4394 | + } |
---|
| 4395 | + else |
---|
| 4396 | + { |
---|
| 4397 | + selection.add(obj); |
---|
| 4398 | + copy.selection.setElementAt(obj, i); |
---|
| 4399 | + } |
---|
| 4400 | + } |
---|
| 4401 | + |
---|
| 4402 | + flashIt = false; |
---|
| 4403 | + GetTree().clearSelection(); |
---|
| 4404 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4405 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4406 | + flashIt = true; |
---|
| 4407 | + |
---|
| 4408 | + //refreshContents(false); |
---|
| 4409 | + } |
---|
| 4410 | + |
---|
| 4411 | + void CopyChanged() |
---|
| 4412 | + { |
---|
| 4413 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4414 | + |
---|
| 4415 | + SetVersionStates(); |
---|
| 4416 | + |
---|
| 4417 | + boolean temp = CameraPane.SWITCH; |
---|
| 4418 | + CameraPane.SWITCH = false; |
---|
| 4419 | + |
---|
| 4420 | + copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4421 | + |
---|
| 4422 | + copy.clear(); |
---|
| 4423 | + |
---|
| 4424 | + copy.skyboxname = obj.skyboxname; |
---|
| 4425 | + copy.skyboxext = obj.skyboxext; |
---|
| 4426 | + |
---|
| 4427 | + for (int i=0; i<obj.Size(); i++) |
---|
| 4428 | + { |
---|
| 4429 | + copy.add(obj.get(i)); |
---|
| 4430 | + } |
---|
| 4431 | + |
---|
| 4432 | + copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4433 | + |
---|
| 4434 | + CameraPane.SWITCH = temp; |
---|
| 4435 | + |
---|
| 4436 | + RefreshSelection(); |
---|
| 4437 | + //assert(hashtable.isEmpty()); |
---|
| 4438 | + |
---|
| 4439 | + copy.Touch(); |
---|
| 4440 | + |
---|
| 4441 | + ResetModel(); |
---|
| 4442 | + copy.HardTouch(); // recompile? |
---|
| 4443 | + |
---|
| 4444 | + cRadio ab; |
---|
| 4445 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4446 | + { |
---|
| 4447 | + ab = (cRadio)e.nextElement(); |
---|
| 4448 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 4449 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 4450 | + if (test != null) |
---|
| 4451 | + { |
---|
| 4452 | + test.editWindow = ab.object.editWindow; |
---|
| 4453 | + ab.object = test; |
---|
| 4454 | + } |
---|
| 4455 | + } |
---|
| 4456 | + |
---|
| 4457 | + refreshContents(true); |
---|
| 4458 | + } |
---|
| 4459 | + |
---|
| 4460 | + cButton previousVersionButton; |
---|
| 4461 | + cButton restoreButton; |
---|
| 4462 | + cButton replaceButton; |
---|
| 4463 | + cButton nextVersionButton; |
---|
| 4464 | + cButton saveVersionButton; |
---|
| 4465 | + cButton deleteVersionButton; |
---|
| 4466 | + |
---|
| 4467 | + boolean muteSlider; |
---|
| 4468 | + |
---|
| 4469 | + int VersionCount() |
---|
| 4470 | + { |
---|
| 4471 | + int count = 0; |
---|
| 4472 | + |
---|
| 4473 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 4474 | + { |
---|
| 4475 | + if (copy.versionlist[i] != null) |
---|
| 4476 | + count++; |
---|
| 4477 | + } |
---|
| 4478 | + |
---|
| 4479 | + return count; |
---|
| 4480 | + } |
---|
| 4481 | + |
---|
| 4482 | + public cGridBag versionSliderPane; |
---|
| 4483 | + |
---|
| 4484 | + void SetVersionStates() |
---|
| 4485 | + { |
---|
| 4486 | + //if (true) |
---|
| 4487 | + // return; |
---|
| 4488 | + |
---|
| 4489 | + //cRadio tab = GetCurrentTab(); |
---|
| 4490 | + |
---|
| 4491 | + if (copy.versionlist == null) |
---|
| 4492 | + { |
---|
| 4493 | + saveVersionButton.setEnabled(false); |
---|
| 4494 | + restoreButton.setEnabled(false); |
---|
| 4495 | + replaceButton.setEnabled(false); |
---|
| 4496 | + previousVersionButton.setEnabled(false); |
---|
| 4497 | + nextVersionButton.setEnabled(false); |
---|
| 4498 | + deleteVersionButton.setEnabled(false); |
---|
| 4499 | + versionSliderPane.setVisible(false); |
---|
| 4500 | + } |
---|
| 4501 | + else |
---|
| 4502 | + { |
---|
| 4503 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4504 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4505 | + |
---|
| 4506 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4507 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4508 | + |
---|
| 4509 | + deleteVersionButton.setEnabled(copy.versionindex != -1); |
---|
| 4510 | + //copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4511 | + |
---|
| 4512 | + muteSlider = true; |
---|
| 4513 | + versionSlider.setMinimum(0); |
---|
| 4514 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4515 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4516 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
| 4517 | + muteSlider = false; |
---|
| 4518 | + |
---|
| 4519 | + versionSliderPane.setVisible(true); |
---|
| 4520 | + } |
---|
| 4521 | + } |
---|
| 4522 | + |
---|
| 4523 | + public boolean PreviousVersion() |
---|
| 4524 | + { |
---|
| 4525 | + // Option? |
---|
| 4526 | + Replace(); |
---|
| 4527 | + |
---|
| 4528 | + System.err.println("Undo"); |
---|
| 4529 | + |
---|
| 4530 | + //cRadio tab = GetCurrentTab(); |
---|
| 4531 | + |
---|
| 4532 | + if (copy.versionindex == 0) |
---|
| 4533 | + { |
---|
| 4534 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4535 | + return false; |
---|
| 4536 | + } |
---|
| 4537 | + |
---|
| 4538 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 4539 | +// { |
---|
| 4540 | +// if (Save(false)) |
---|
| 4541 | +// tab.versionindex -= 1; |
---|
| 4542 | +// else |
---|
| 4543 | +// { |
---|
| 4544 | +// if (tab.versionindex <= 0) |
---|
| 4545 | +// return false; |
---|
| 4546 | +// else |
---|
| 4547 | +// tab.versionindex -= 1; |
---|
| 4548 | +// } |
---|
| 4549 | +// } |
---|
| 4550 | + |
---|
| 4551 | + copy.versionindex -= 1; |
---|
| 4552 | + |
---|
| 4553 | + CopyChanged(); |
---|
| 4554 | + |
---|
| 4555 | + return true; |
---|
| 4556 | + } |
---|
| 4557 | + |
---|
| 4558 | + public boolean Restore() |
---|
| 4559 | + { |
---|
| 4560 | + System.err.println("Restore"); |
---|
| 4561 | + |
---|
| 4562 | + //cRadio tab = GetCurrentTab(); |
---|
| 4563 | + |
---|
| 4564 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4565 | + { |
---|
| 4566 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4567 | + return false; |
---|
| 4568 | + } |
---|
| 4569 | + |
---|
| 4570 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4571 | + CopyChanged(); |
---|
| 4572 | + |
---|
| 4573 | + return true; |
---|
| 4574 | + } |
---|
| 4575 | + |
---|
| 4576 | + public boolean Replace() |
---|
| 4577 | + { |
---|
| 4578 | + //System.err.println("Replace"); |
---|
| 4579 | + |
---|
| 4580 | + //cRadio tab = GetCurrentTab(); |
---|
| 4581 | + |
---|
| 4582 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4583 | + { |
---|
| 4584 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4585 | + return false; |
---|
| 4586 | + } |
---|
| 4587 | + |
---|
| 4588 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
| 4589 | + |
---|
| 4590 | + return true; |
---|
| 4591 | + } |
---|
| 4592 | + |
---|
| 4593 | + public void NextVersion() |
---|
| 4594 | + { |
---|
| 4595 | + // Option? |
---|
| 4596 | + Replace(); |
---|
| 4597 | + |
---|
| 4598 | + //cRadio tab = GetCurrentTab(); |
---|
| 4599 | + |
---|
| 4600 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
| 4601 | + { |
---|
| 4602 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4603 | + return; |
---|
| 4604 | + } |
---|
| 4605 | + |
---|
| 4606 | + copy.versionindex += 1; |
---|
| 4607 | + |
---|
| 4608 | + CopyChanged(); |
---|
| 4609 | + |
---|
| 4610 | + //if (!tab.user[tab.versionindex]) |
---|
| 4611 | + // tab.graphs[tab.versionindex] = null; |
---|
| 4612 | + } |
---|
| 4613 | + |
---|
| 4614 | + void ImportGFD() |
---|
| 4615 | + { |
---|
| 4616 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
| 4617 | + browser.show(); |
---|
| 4618 | + String filename = browser.getFile(); |
---|
| 4619 | + if (filename != null && filename.length() > 0) |
---|
| 4620 | + { |
---|
| 4621 | + String fullname = browser.getDirectory() + filename; |
---|
| 4622 | + |
---|
| 4623 | + //Object3D readobj = |
---|
| 4624 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 4625 | + //makeSomething(readobj); |
---|
| 4626 | + } |
---|
| 4627 | + } |
---|
| 4628 | + |
---|
| 4629 | + void ImportVRMLX3D() |
---|
| 4630 | + { |
---|
| 4631 | + if (Grafreed.standAlone) |
---|
| 4632 | + { |
---|
| 4633 | + /**/ |
---|
| 4634 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 4635 | + browser.show(); |
---|
| 4636 | + String filename = browser.getFile(); |
---|
| 4637 | + if (filename != null && filename.length() > 0) |
---|
| 4638 | + { |
---|
| 4639 | + String fullname = browser.getDirectory() + filename; |
---|
| 4640 | + LoadVRMLX3D(fullname); |
---|
| 4641 | + } |
---|
| 4642 | + /**/ |
---|
| 4643 | + } |
---|
| 4644 | + } |
---|
| 4645 | + |
---|
3250 | 4646 | void ToggleAnimation() |
---|
3251 | 4647 | { |
---|
3252 | 4648 | if (!Globals.ANIMATION) |
---|
.. | .. |
---|
3364 | 4760 | assert false; |
---|
3365 | 4761 | } |
---|
3366 | 4762 | |
---|
3367 | | - void EditSelection() |
---|
| 4763 | + void EditSelection(boolean newWindow) |
---|
3368 | 4764 | { |
---|
3369 | 4765 | } |
---|
3370 | 4766 | |
---|
.. | .. |
---|
3406 | 4802 | // else |
---|
3407 | 4803 | // applySelf(true); |
---|
3408 | 4804 | // } |
---|
| 4805 | + |
---|
| 4806 | + boolean Equal(double a, double b) |
---|
| 4807 | + { |
---|
| 4808 | + return Math.abs(a - b) < 0.001; |
---|
| 4809 | + } |
---|
| 4810 | + |
---|
3409 | 4811 | void applySelf0(boolean name) |
---|
3410 | 4812 | { |
---|
3411 | 4813 | if (name) |
---|
.. | .. |
---|
3423 | 4825 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
3424 | 4826 | |
---|
3425 | 4827 | current.color = (float) colorField.getFloat(); |
---|
3426 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4828 | + current.modulation = (float) saturationField.getFloat(); |
---|
3427 | 4829 | current.metalness = (float) metalnessField.getFloat(); |
---|
3428 | 4830 | current.diffuse = (float) diffuseField.getFloat(); |
---|
3429 | 4831 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
3455 | 4857 | { |
---|
3456 | 4858 | cMaterial mat = copy.material; |
---|
3457 | 4859 | |
---|
3458 | | - colorField.SetToolTipValue((mat.color)); |
---|
3459 | | - modulationField.SetToolTipValue((mat.modulation)); |
---|
3460 | | - metalnessField.SetToolTipValue((mat.metalness)); |
---|
3461 | | - diffuseField.SetToolTipValue((mat.diffuse)); |
---|
3462 | | - specularField.SetToolTipValue((mat.specular)); |
---|
3463 | | - shininessField.SetToolTipValue((mat.shininess)); |
---|
3464 | | - shiftField.SetToolTipValue((mat.shift)); |
---|
3465 | | - ambientField.SetToolTipValue((mat.ambient)); |
---|
3466 | | - lightareaField.SetToolTipValue((mat.lightarea)); |
---|
3467 | | - diffusenessField.SetToolTipValue((mat.factor)); |
---|
3468 | | - velvetField.SetToolTipValue((mat.velvet)); |
---|
3469 | | - sheenField.SetToolTipValue((mat.sheen)); |
---|
3470 | | - subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
3471 | | - backlitField.SetToolTipValue((mat.bump)); |
---|
3472 | | - anisoField.SetToolTipValue((mat.aniso)); |
---|
3473 | | - anisoVField.SetToolTipValue((mat.anisoV)); |
---|
3474 | | - cameraField.SetToolTipValue((mat.cameralight)); |
---|
3475 | | - selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
3476 | | - shadowField.SetToolTipValue((mat.shadow)); |
---|
3477 | | - textureField.SetToolTipValue((mat.texture)); |
---|
3478 | | - opacityField.SetToolTipValue((mat.opacity)); |
---|
3479 | | - fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
3480 | | - shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4860 | + if (!Equal(colorField.getFloat(), mat.color)) |
---|
| 4861 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4862 | + if (!Equal(saturationField.getFloat(), mat.modulation)) |
---|
| 4863 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4864 | + if (!Equal(metalnessField.getFloat(), mat.metalness)) |
---|
| 4865 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4866 | + if (!Equal(diffuseField.getFloat(), mat.diffuse)) |
---|
| 4867 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4868 | + if (!Equal(specularField.getFloat(), mat.specular)) |
---|
| 4869 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4870 | + if (!Equal(shininessField.getFloat(), mat.shininess)) |
---|
| 4871 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4872 | + if (!Equal(shiftField.getFloat(), mat.shift)) |
---|
| 4873 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4874 | + if (!Equal(ambientField.getFloat(), mat.ambient)) |
---|
| 4875 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4876 | + if (!Equal(lightareaField.getFloat(), mat.lightarea)) |
---|
| 4877 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4878 | + if (!Equal(diffusenessField.getFloat(), mat.factor)) |
---|
| 4879 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4880 | + if (!Equal(velvetField.getFloat(), mat.velvet)) |
---|
| 4881 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4882 | + if (!Equal(sheenField.getFloat(), mat.sheen)) |
---|
| 4883 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4884 | + if (!Equal(subsurfaceField.getFloat(), mat.subsurface)) |
---|
| 4885 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4886 | + if (!Equal(backlitField.getFloat(), mat.bump)) |
---|
| 4887 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4888 | + if (!Equal(anisoField.getFloat(), mat.aniso)) |
---|
| 4889 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4890 | + if (!Equal(anisoVField.getFloat(), mat.anisoV)) |
---|
| 4891 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4892 | + if (!Equal(cameraField.getFloat(), mat.cameralight)) |
---|
| 4893 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4894 | + if (!Equal(selfshadowField.getFloat(), mat.diffuseness)) |
---|
| 4895 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4896 | + if (!Equal(shadowField.getFloat(), mat.shadow)) |
---|
| 4897 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4898 | + if (!Equal(textureField.getFloat(), mat.texture)) |
---|
| 4899 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4900 | + if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
| 4901 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4902 | + if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
| 4903 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4904 | + if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
| 4905 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
3481 | 4906 | } |
---|
3482 | 4907 | |
---|
3483 | 4908 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
.. | .. |
---|
3508 | 4933 | //copy.Touch(); |
---|
3509 | 4934 | } |
---|
3510 | 4935 | |
---|
| 4936 | + cNumberSlider versionSlider; |
---|
| 4937 | + |
---|
3511 | 4938 | public void stateChanged(ChangeEvent e) |
---|
3512 | 4939 | { |
---|
3513 | | - // assert(false); |
---|
| 4940 | + // assert(false); |
---|
| 4941 | + if (e.getSource() == versionSlider) |
---|
| 4942 | + { |
---|
| 4943 | + if (muteSlider) |
---|
| 4944 | + return; |
---|
| 4945 | + |
---|
| 4946 | + Replace(); |
---|
| 4947 | + |
---|
| 4948 | + int version = versionSlider.getInteger(); |
---|
| 4949 | + |
---|
| 4950 | + if (version != -1 && copy.versionlist[version] != null) |
---|
| 4951 | + { |
---|
| 4952 | + copy.versionindex = version; |
---|
| 4953 | + CopyChanged(); |
---|
| 4954 | + } |
---|
| 4955 | + |
---|
| 4956 | + return; |
---|
| 4957 | + } |
---|
3514 | 4958 | |
---|
3515 | 4959 | if (freezematerial) |
---|
3516 | 4960 | { |
---|
.. | .. |
---|
3546 | 4990 | { |
---|
3547 | 4991 | //System.out.println("stateChanged = " + this); |
---|
3548 | 4992 | materialtouched = true; |
---|
| 4993 | + |
---|
| 4994 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4995 | + { |
---|
| 4996 | + saturationField.setFloat(1); |
---|
| 4997 | + } |
---|
| 4998 | + |
---|
3549 | 4999 | applySelf(); |
---|
3550 | 5000 | //System.out.println("this = " + this); |
---|
3551 | 5001 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
3845 | 5295 | { |
---|
3846 | 5296 | if (GetTree() != null) |
---|
3847 | 5297 | { |
---|
| 5298 | + GetTree().revalidate(); |
---|
3848 | 5299 | GetTree().repaint(); |
---|
3849 | 5300 | } |
---|
3850 | 5301 | |
---|
.. | .. |
---|
3853 | 5304 | ctrlPanel.validate(); // ? new |
---|
3854 | 5305 | ctrlPanel.repaint(); |
---|
3855 | 5306 | } |
---|
| 5307 | + |
---|
| 5308 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5309 | + SetVersionStates(); |
---|
| 5310 | + |
---|
| 5311 | + cameraView.requestFocusInWindow(); |
---|
3856 | 5312 | } |
---|
3857 | 5313 | |
---|
3858 | 5314 | static TweenManager tweenManager = new TweenManager(); |
---|
3859 | 5315 | |
---|
3860 | 5316 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3861 | 5317 | { |
---|
| 5318 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
| 5319 | + Save(); |
---|
3862 | 5320 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3863 | 5321 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3864 | 5322 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3882 | 5340 | // group = (Composite) group.get(0); |
---|
3883 | 5341 | // } |
---|
3884 | 5342 | |
---|
3885 | | - System.out.println("makeSomething of " + thing); |
---|
| 5343 | + //System.out.println("makeSomething of " + thing); |
---|
3886 | 5344 | |
---|
3887 | 5345 | /* |
---|
3888 | 5346 | if (deselect && jList != null) |
---|
.. | .. |
---|
3945 | 5403 | { |
---|
3946 | 5404 | ResetModel(); |
---|
3947 | 5405 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 5406 | + |
---|
| 5407 | + if (thing.Size() == 0) |
---|
| 5408 | + { |
---|
| 5409 | + //EditSelection(false); |
---|
| 5410 | + } |
---|
| 5411 | + |
---|
3948 | 5412 | refreshContents(); |
---|
3949 | 5413 | } |
---|
3950 | 5414 | |
---|
.. | .. |
---|
4062 | 5526 | } |
---|
4063 | 5527 | } |
---|
4064 | 5528 | } |
---|
| 5529 | + |
---|
4065 | 5530 | LoadGFDThread loadGFDThread; |
---|
4066 | 5531 | |
---|
4067 | 5532 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4081 | 5546 | |
---|
4082 | 5547 | try |
---|
4083 | 5548 | { |
---|
| 5549 | + // Try compressed version first. |
---|
4084 | 5550 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4085 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5551 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 5552 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4086 | 5553 | |
---|
4087 | 5554 | readobj = (Object3D) p.readObject(); |
---|
4088 | 5555 | istream.close(); |
---|
.. | .. |
---|
4090 | 5557 | readobj.ResetDisplayList(); |
---|
4091 | 5558 | } catch (Exception e) |
---|
4092 | 5559 | { |
---|
4093 | | - e.printStackTrace(); |
---|
| 5560 | + if (!e.toString().contains("GZIP")) |
---|
| 5561 | + e.printStackTrace(); |
---|
| 5562 | + |
---|
| 5563 | + try |
---|
| 5564 | + { |
---|
| 5565 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 5566 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5567 | + |
---|
| 5568 | + readobj = (Object3D) p.readObject(); |
---|
| 5569 | + istream.close(); |
---|
| 5570 | + |
---|
| 5571 | + readobj.ResetDisplayList(); |
---|
| 5572 | + } catch (Exception e2) |
---|
| 5573 | + { |
---|
| 5574 | + e2.printStackTrace(); |
---|
| 5575 | + } |
---|
4094 | 5576 | } |
---|
4095 | 5577 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4096 | 5578 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4136 | 5618 | |
---|
4137 | 5619 | void LoadIt(Object obj) |
---|
4138 | 5620 | { |
---|
| 5621 | + if (obj == null) |
---|
| 5622 | + { |
---|
| 5623 | + // Invalid file |
---|
| 5624 | + return; |
---|
| 5625 | + } |
---|
| 5626 | + |
---|
4139 | 5627 | System.out.println("Loaded " + obj); |
---|
4140 | 5628 | //new Exception().printStackTrace(); |
---|
4141 | 5629 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4145 | 5633 | |
---|
4146 | 5634 | if (readobj != null) |
---|
4147 | 5635 | { |
---|
| 5636 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 5637 | + // Save(); |
---|
4148 | 5638 | try |
---|
4149 | 5639 | { |
---|
4150 | 5640 | //readobj.deepCopySelf(copy); |
---|
4151 | 5641 | copy.clear(); // june 2014 |
---|
| 5642 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5643 | + copy.skyboxext = readobj.skyboxext; |
---|
4152 | 5644 | for (int i = 0; i < readobj.size(); i++) |
---|
4153 | 5645 | { |
---|
4154 | 5646 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4189 | 5681 | } |
---|
4190 | 5682 | } catch (ClassCastException e) |
---|
4191 | 5683 | { |
---|
| 5684 | + e.printStackTrace(); |
---|
4192 | 5685 | assert (false); |
---|
4193 | 5686 | Composite c = (Composite) copy; |
---|
4194 | 5687 | c.children.clear(); |
---|
.. | .. |
---|
4199 | 5692 | c.addChild(csg); |
---|
4200 | 5693 | } |
---|
4201 | 5694 | |
---|
| 5695 | + copy.versionlist = readobj.versionlist; |
---|
| 5696 | + copy.versionindex = readobj.versionindex; |
---|
| 5697 | + copy.versiontable = readobj.versiontable; |
---|
| 5698 | + |
---|
| 5699 | + if (copy.versionlist == null) |
---|
| 5700 | + { |
---|
| 5701 | + // Backward compatibility |
---|
| 5702 | + copy.versionlist = new Object3D[100]; |
---|
| 5703 | + copy.versionindex = -1; |
---|
| 5704 | + |
---|
| 5705 | + //Save(true); |
---|
| 5706 | + } |
---|
| 5707 | + |
---|
| 5708 | + //? SetUndoStates(); |
---|
| 5709 | + |
---|
4202 | 5710 | ResetModel(); |
---|
4203 | 5711 | copy.HardTouch(); // recompile? |
---|
4204 | 5712 | refreshContents(); |
---|
4205 | 5713 | } |
---|
4206 | 5714 | } |
---|
4207 | 5715 | |
---|
4208 | | - void load() // throws ClassNotFoundException |
---|
| 5716 | + void Open() // throws ClassNotFoundException |
---|
4209 | 5717 | { |
---|
4210 | 5718 | if (Grafreed.standAlone) |
---|
4211 | 5719 | { |
---|
4212 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5720 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4213 | 5721 | browser.show(); |
---|
4214 | 5722 | String filename = browser.getFile(); |
---|
4215 | 5723 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4286 | 5794 | |
---|
4287 | 5795 | void save() |
---|
4288 | 5796 | { |
---|
| 5797 | + Replace(); |
---|
| 5798 | + |
---|
4289 | 5799 | if (lastname == null) |
---|
4290 | 5800 | { |
---|
4291 | 5801 | return; |
---|
.. | .. |
---|
4294 | 5804 | try |
---|
4295 | 5805 | { |
---|
4296 | 5806 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4297 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 5807 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5808 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4298 | 5809 | |
---|
4299 | 5810 | p.writeObject(copy); |
---|
4300 | 5811 | p.flush(); |
---|
4301 | 5812 | |
---|
| 5813 | + zstream.close(); |
---|
4302 | 5814 | ostream.close(); |
---|
4303 | 5815 | |
---|
4304 | 5816 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4306 | 5818 | //ps.print(buffer.toString()); |
---|
4307 | 5819 | } catch (IOException e) |
---|
4308 | 5820 | { |
---|
| 5821 | + e.printStackTrace(); |
---|
4309 | 5822 | } |
---|
4310 | 5823 | } |
---|
| 5824 | + |
---|
4311 | 5825 | String lastname; |
---|
4312 | 5826 | |
---|
4313 | 5827 | void saveAs() |
---|
.. | .. |
---|
4319 | 5833 | String filename = browser.getFile(); |
---|
4320 | 5834 | if (filename != null && filename.length() > 0) |
---|
4321 | 5835 | { |
---|
| 5836 | + if (!filename.endsWith(".gfd")) |
---|
| 5837 | + filename += ".gfd"; |
---|
4322 | 5838 | lastname = browser.getDirectory() + filename; |
---|
4323 | 5839 | save(); |
---|
4324 | 5840 | } |
---|
.. | .. |
---|
4417 | 5933 | try |
---|
4418 | 5934 | { |
---|
4419 | 5935 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4420 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4421 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 5936 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5937 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4422 | 5938 | |
---|
4423 | 5939 | Object3D objectparent = obj.parent; |
---|
4424 | 5940 | obj.parent = null; |
---|
.. | .. |
---|
4435 | 5951 | p.writeObject(object); |
---|
4436 | 5952 | p.flush(); |
---|
4437 | 5953 | |
---|
| 5954 | + zstream.close(); |
---|
4438 | 5955 | ostream.close(); |
---|
4439 | | - // zstream.close(); |
---|
4440 | 5956 | |
---|
4441 | 5957 | // group.selection.get(0).parent = parent; |
---|
4442 | 5958 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4483 | 5999 | Object3D client; |
---|
4484 | 6000 | Object3D copy; |
---|
4485 | 6001 | MenuBar menuBar; |
---|
4486 | | - Menu windowMenu; |
---|
4487 | | - MenuItem loadItem; |
---|
| 6002 | + Menu fileMenu; |
---|
| 6003 | + MenuItem newItem; |
---|
| 6004 | + MenuItem openItem; |
---|
4488 | 6005 | MenuItem saveItem; |
---|
4489 | 6006 | MenuItem saveAsItem; |
---|
4490 | 6007 | MenuItem exportAsItem; |
---|
4491 | 6008 | MenuItem reexportItem; |
---|
4492 | 6009 | MenuItem povItem; |
---|
4493 | 6010 | MenuItem closeItem; |
---|
4494 | | - Menu cameraMenu; |
---|
| 6011 | + |
---|
4495 | 6012 | CheckboxMenuItem zBufferItem; |
---|
4496 | 6013 | //MenuItem normalLensItem; |
---|
4497 | | - MenuItem editCameraItem; |
---|
4498 | | - MenuItem revertCameraItem; |
---|
4499 | 6014 | MenuItem stepItem; |
---|
4500 | 6015 | CheckboxMenuItem toggleLiveItem; |
---|
4501 | 6016 | CheckboxMenuItem toggleFullScreenItem; |
---|
.. | .. |
---|
4509 | 6024 | CheckboxMenuItem toggleSwitchItem; |
---|
4510 | 6025 | CheckboxMenuItem toggleRootItem; |
---|
4511 | 6026 | CheckboxMenuItem animationItem; |
---|
| 6027 | + MenuItem archiveItem; |
---|
4512 | 6028 | CheckboxMenuItem toggleHandleItem; |
---|
4513 | 6029 | CheckboxMenuItem togglePaintItem; |
---|
4514 | 6030 | JSplitPane mainPanel; |
---|
4515 | 6031 | JScrollPane scrollpane; |
---|
| 6032 | + |
---|
4516 | 6033 | JPanel toolbarPanel; |
---|
| 6034 | + |
---|
4517 | 6035 | cGridBag treePanel; |
---|
| 6036 | + |
---|
4518 | 6037 | JPanel radioPanel; |
---|
4519 | 6038 | ButtonGroup buttonGroup; |
---|
4520 | | - cGridBag ctrlPanel; |
---|
| 6039 | + |
---|
| 6040 | + cGridBag toolboxPanel; |
---|
| 6041 | + cGridBag skyboxPanel; |
---|
4521 | 6042 | cGridBag materialPanel; |
---|
| 6043 | + cGridBag ctrlPanel; |
---|
| 6044 | + |
---|
4522 | 6045 | JScrollPane infoPanel; |
---|
| 6046 | + |
---|
4523 | 6047 | cGridBag optionsPanel; |
---|
| 6048 | + |
---|
4524 | 6049 | JTabbedPane objectPanel; |
---|
| 6050 | + boolean materialFlushed; |
---|
| 6051 | + Object3D latestObject; |
---|
| 6052 | + |
---|
| 6053 | + cGridBag transformPanel; |
---|
4525 | 6054 | cGridBag XYZPanel; |
---|
| 6055 | + |
---|
4526 | 6056 | JSplitPane gridPanel; |
---|
4527 | 6057 | JSplitPane bigPanel; |
---|
| 6058 | + |
---|
4528 | 6059 | cGridBag bigThree; |
---|
4529 | 6060 | cGridBag scenePanel; |
---|
4530 | 6061 | cGridBag centralPanel; |
---|
.. | .. |
---|
4582 | 6113 | JLabel colorLabel; |
---|
4583 | 6114 | cNumberSlider colorField; |
---|
4584 | 6115 | JLabel modulationLabel; |
---|
4585 | | - cNumberSlider modulationField; |
---|
| 6116 | + cNumberSlider saturationField; |
---|
4586 | 6117 | JLabel metalnessLabel; |
---|
4587 | 6118 | cNumberSlider metalnessField; |
---|
4588 | 6119 | JLabel diffuseLabel; |
---|
.. | .. |
---|
4613 | 6144 | cNumberSlider anisoField; |
---|
4614 | 6145 | JLabel anisoVLabel; |
---|
4615 | 6146 | cNumberSlider anisoVField; |
---|
| 6147 | + |
---|
4616 | 6148 | JLabel cameraLabel; |
---|
4617 | 6149 | cNumberSlider cameraField; |
---|
4618 | 6150 | JLabel selfshadowLabel; |
---|
.. | .. |
---|
4627 | 6159 | cNumberSlider fakedepthField; |
---|
4628 | 6160 | JLabel shadowbiasLabel; |
---|
4629 | 6161 | cNumberSlider shadowbiasField; |
---|
| 6162 | + |
---|
4630 | 6163 | JLabel bumpLabel; |
---|
4631 | 6164 | cNumberSlider bumpField; |
---|
4632 | 6165 | JLabel noiseLabel; |
---|
.. | .. |
---|
4639 | 6172 | cNumberSlider fogField; |
---|
4640 | 6173 | JLabel opacityPowerLabel; |
---|
4641 | 6174 | cNumberSlider opacityPowerField; |
---|
4642 | | - JTree jTree; |
---|
| 6175 | + cTree jTree; |
---|
4643 | 6176 | //ObjectUI parent; |
---|
4644 | 6177 | |
---|
4645 | 6178 | cNumberSlider normalpushField; |
---|
| 6179 | + |
---|
| 6180 | + private MenuItem importGFDItem; |
---|
| 6181 | + private MenuItem importVRMLX3DItem; |
---|
| 6182 | + private MenuItem import3DSItem; |
---|
| 6183 | + private MenuItem importOBJItem; |
---|
4646 | 6184 | } |
---|