.. | .. |
---|
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.*; |
---|
.. | .. |
---|
14 | 15 | //import javax.swing.plaf.ColorUIResource; |
---|
15 | 16 | //import javax.swing.plaf.metal.DefaultMetalTheme; |
---|
16 | 17 | |
---|
| 18 | +import javax.swing.plaf.basic.BasicSplitPaneDivider; |
---|
| 19 | +import javax.swing.plaf.basic.BasicSplitPaneUI; |
---|
| 20 | + |
---|
17 | 21 | //import javax.media.opengl.GLCanvas; |
---|
18 | 22 | |
---|
19 | 23 | import //weka.core. |
---|
20 | 24 | matrix.Matrix; |
---|
| 25 | + |
---|
| 26 | +import grafeme.ui.*; |
---|
21 | 27 | |
---|
22 | 28 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 29 | ActionListener, ChangeListener, |
---|
.. | .. |
---|
28 | 34 | iSendInfo |
---|
29 | 35 | //KeyListener |
---|
30 | 36 | { |
---|
| 37 | + public cToggleButton pinButton; |
---|
31 | 38 | boolean timeline; |
---|
32 | 39 | boolean wasFullScreen; |
---|
33 | 40 | |
---|
34 | 41 | GroupEditor callee; |
---|
35 | 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 | + return new cButton(icon, border); |
---|
| 87 | + } |
---|
| 88 | + |
---|
| 89 | + cLabel GetLabel(String name, boolean border) |
---|
| 90 | + { |
---|
| 91 | + //ImageIcon icon = GetIcon(name); |
---|
| 92 | + return new cLabel(GetImage(name), border); |
---|
| 93 | + } |
---|
| 94 | + |
---|
| 95 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 96 | + { |
---|
| 97 | + ImageIcon icon = GetIcon(name); |
---|
| 98 | + return new cToggleButton(icon, border); |
---|
| 99 | + } |
---|
| 100 | + |
---|
| 101 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 102 | + { |
---|
| 103 | + ImageIcon icon = GetIcon(name); |
---|
| 104 | + return new cCheckBox(icon, border); |
---|
| 105 | + } |
---|
| 106 | + |
---|
| 107 | + static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); |
---|
| 108 | + |
---|
| 109 | + ImageIcon GetIcon(String name) |
---|
| 110 | + { |
---|
| 111 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 112 | + if (iconCache != null) |
---|
| 113 | + { |
---|
| 114 | + return iconCache; |
---|
| 115 | + } |
---|
| 116 | + |
---|
| 117 | + try |
---|
| 118 | + { |
---|
| 119 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 120 | + |
---|
| 121 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 122 | +// { |
---|
| 123 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 124 | +// Graphics2D g = resized.createGraphics(); |
---|
| 125 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 126 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 127 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 128 | +// g.dispose(); |
---|
| 129 | +// |
---|
| 130 | +// image = resized; |
---|
| 131 | +// } |
---|
| 132 | + |
---|
| 133 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 134 | + |
---|
| 135 | + icons.put(name, icon); |
---|
| 136 | + |
---|
| 137 | + return icon; |
---|
| 138 | + } |
---|
| 139 | + catch (Exception e) |
---|
| 140 | + { |
---|
| 141 | + //icons.put(name, null); |
---|
| 142 | + return null; |
---|
| 143 | + } |
---|
| 144 | + } |
---|
| 145 | + |
---|
| 146 | + BufferedImage GetImage(String name) |
---|
| 147 | + { |
---|
| 148 | + try |
---|
| 149 | + { |
---|
| 150 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 151 | + |
---|
| 152 | + return image; |
---|
| 153 | + } |
---|
| 154 | + catch (Exception e) |
---|
| 155 | + { |
---|
| 156 | + return null; |
---|
| 157 | + } |
---|
| 158 | + } |
---|
36 | 159 | |
---|
37 | 160 | // SCRIPT |
---|
38 | 161 | |
---|
.. | .. |
---|
136 | 259 | public void closeUI() |
---|
137 | 260 | { |
---|
138 | 261 | //new Exception().printStackTrace(); |
---|
139 | | - System.out.println("this = " + this); |
---|
140 | | - System.out.println("objEditor = " + objEditor); |
---|
| 262 | +// System.out.println("this = " + this); |
---|
| 263 | +// System.out.println("objEditor = " + objEditor); |
---|
141 | 264 | //nameField.removeActionListener(this); |
---|
142 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 265 | +// objEditor.ctrlPanel.remove(nameField); |
---|
143 | 266 | |
---|
144 | | - if (!GroupEditor.allparams) |
---|
| 267 | + objEditor.ctrlPanel.remove(namePanel); |
---|
| 268 | + |
---|
| 269 | + if (!allparams) |
---|
145 | 270 | return; |
---|
146 | 271 | |
---|
147 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
148 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
149 | | - objEditor.ctrlPanel.remove(markCB); |
---|
150 | | - |
---|
151 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
152 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
153 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
154 | | - |
---|
155 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
156 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
157 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
158 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
159 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
160 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
161 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
162 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
163 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
164 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 272 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 273 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 274 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 275 | +// |
---|
| 276 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 277 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 278 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 279 | +// |
---|
| 280 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 281 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 282 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 283 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 284 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 285 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 286 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 287 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 288 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 289 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
165 | 290 | |
---|
166 | | - Remove(normalpushField); |
---|
| 291 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 292 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 293 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
| 294 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 295 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 296 | + |
---|
| 297 | + //Remove(normalpushField); |
---|
167 | 298 | } |
---|
168 | 299 | |
---|
169 | 300 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
207 | 338 | client = inClient; |
---|
208 | 339 | copy = client; |
---|
209 | 340 | |
---|
| 341 | +// if (copy.versionlist == null) |
---|
| 342 | +// { |
---|
| 343 | +// copy.versionlist = new Object3D[100]; |
---|
| 344 | +// copy.versionindex = -1; |
---|
| 345 | +// |
---|
| 346 | +// callee.Save(true); |
---|
| 347 | +// } |
---|
| 348 | + |
---|
210 | 349 | // "this" is not called: SetupUI2(objEditor); |
---|
211 | 350 | } |
---|
212 | 351 | |
---|
.. | .. |
---|
220 | 359 | client = inClient; |
---|
221 | 360 | copy = client; |
---|
222 | 361 | |
---|
| 362 | + if (copy.versionlist == null) |
---|
| 363 | + { |
---|
| 364 | + copy.versionlist = new Object3D[100]; |
---|
| 365 | + copy.versionindex = -1; |
---|
| 366 | + |
---|
| 367 | +// Save(true); |
---|
| 368 | + } |
---|
| 369 | + |
---|
223 | 370 | SetupUI2(callee.GetEditor()); |
---|
224 | 371 | } |
---|
225 | 372 | |
---|
.. | .. |
---|
234 | 381 | //localCopy.parent = null; |
---|
235 | 382 | |
---|
236 | 383 | frame = new JFrame(); |
---|
| 384 | + frame.setUndecorated(false); |
---|
237 | 385 | objEditor = this; |
---|
238 | 386 | this.callee = callee; |
---|
239 | 387 | |
---|
.. | .. |
---|
251 | 399 | copy = localCopy; |
---|
252 | 400 | copy.editWindow = this; |
---|
253 | 401 | |
---|
| 402 | +// if (copy.versionlist == null) |
---|
| 403 | +// { |
---|
| 404 | +// copy.versionlist = new Object3D[100]; |
---|
| 405 | +// copy.versionindex = -1; |
---|
| 406 | +// |
---|
| 407 | +// Save(true); |
---|
| 408 | +// } |
---|
| 409 | + |
---|
254 | 410 | SetupMenu(); |
---|
255 | 411 | |
---|
256 | 412 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
264 | 420 | return frame.action(event, obj); |
---|
265 | 421 | } |
---|
266 | 422 | |
---|
| 423 | + // Cannot work without static |
---|
| 424 | + static boolean allparams = true; |
---|
| 425 | + |
---|
| 426 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 427 | + |
---|
267 | 428 | void SetupMenu() |
---|
268 | 429 | { |
---|
269 | 430 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
270 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
271 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
272 | | - windowMenu.add("-"); |
---|
273 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
274 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 431 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 432 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 433 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
| 434 | + |
---|
| 435 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 436 | + Menu menu = new Menu("Import"); |
---|
| 437 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 438 | + importOBJItem.addActionListener(this); |
---|
| 439 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 440 | + import3DSItem.addActionListener(this); |
---|
| 441 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 442 | + importVRMLX3DItem.addActionListener(this); |
---|
| 443 | + menu.add("-"); |
---|
| 444 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 445 | + importGFDItem.addActionListener(this); |
---|
| 446 | + fileMenu.add(menu); |
---|
| 447 | + fileMenu.add("-"); |
---|
| 448 | + |
---|
| 449 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 450 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
275 | 451 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
276 | | - windowMenu.add("-"); |
---|
277 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
278 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
279 | | - windowMenu.add("-"); |
---|
| 452 | + fileMenu.add("-"); |
---|
| 453 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 454 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 455 | + fileMenu.add("-"); |
---|
280 | 456 | if (client.parent != null) |
---|
281 | 457 | { |
---|
282 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 458 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
283 | 459 | } else |
---|
284 | 460 | { |
---|
285 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 461 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
286 | 462 | } |
---|
287 | 463 | |
---|
288 | | - loadItem.addActionListener(this); |
---|
| 464 | + newItem.addActionListener(this); |
---|
| 465 | + openItem.addActionListener(this); |
---|
289 | 466 | saveItem.addActionListener(this); |
---|
290 | 467 | saveAsItem.addActionListener(this); |
---|
291 | 468 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
293 | 470 | //povItem.addActionListener(this); |
---|
294 | 471 | closeItem.addActionListener(this); |
---|
295 | 472 | |
---|
296 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
297 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
298 | | - //zBufferItem.addActionListener(this); |
---|
299 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
300 | | - //normalLensItem.addActionListener(this); |
---|
301 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
302 | | - revertCameraItem.addActionListener(this); |
---|
303 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
304 | | - toggleTimelineItem.addItemListener(this); |
---|
305 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
306 | | - toggleFullScreenItem.addItemListener(this); |
---|
307 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
308 | | - cameraMenu.add("-"); |
---|
309 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
310 | | - toggleTextureItem.addItemListener(this); |
---|
311 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
312 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
313 | | - toggleLiveItem.addItemListener(this); |
---|
314 | | - toggleLiveItem.setState(Globals.isLIVE()); |
---|
315 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
316 | | - stepItem.addActionListener(this); |
---|
317 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
318 | | -// toggleDLItem.addItemListener(this); |
---|
319 | | -// toggleDLItem.setState(false); |
---|
320 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
321 | | - toggleRenderItem.addItemListener(this); |
---|
322 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
323 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
324 | | - toggleDebugItem.addItemListener(this); |
---|
325 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
326 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
327 | | - toggleFrustumItem.addItemListener(this); |
---|
328 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
329 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
330 | | - toggleFootContactItem.addItemListener(this); |
---|
331 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
332 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
333 | | - toggleRandomItem.addItemListener(this); |
---|
334 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
335 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
336 | | - toggleHandleItem.addItemListener(this); |
---|
337 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
338 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
339 | | - togglePaintItem.addItemListener(this); |
---|
340 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
341 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
342 | | -// toggleRootItem.addItemListener(this); |
---|
343 | | -// toggleRootItem.setState(false); |
---|
344 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
345 | | -// animationItem.addItemListener(this); |
---|
346 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
347 | | - cameraMenu.add("-"); |
---|
348 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
349 | | - editCameraItem.addActionListener(this); |
---|
350 | | - |
---|
351 | 473 | objectPanel = new JTabbedPane(); |
---|
| 474 | + |
---|
| 475 | + ChangeListener changeListener = new ChangeListener() |
---|
| 476 | + { |
---|
| 477 | + //String name; |
---|
| 478 | + |
---|
| 479 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 480 | + { |
---|
| 481 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 482 | +// { |
---|
| 483 | +// if (latestObject != null) |
---|
| 484 | +// { |
---|
| 485 | +// refreshContents(true); |
---|
| 486 | +// SetMaterial(latestObject); |
---|
| 487 | +// } |
---|
| 488 | +// |
---|
| 489 | +// materialFlushed = true; |
---|
| 490 | +// } |
---|
| 491 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 492 | +// { |
---|
| 493 | +// if (listUI.size() == 0) |
---|
| 494 | +// EditSelection(false); |
---|
| 495 | +// } |
---|
| 496 | + |
---|
| 497 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 498 | +// { |
---|
| 499 | +// name = copy.skyboxname; |
---|
| 500 | +// |
---|
| 501 | +// if (name == null) |
---|
| 502 | +// { |
---|
| 503 | +// name = ""; |
---|
| 504 | +// } |
---|
| 505 | +// |
---|
| 506 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 507 | +// copy.skyboxext = "jpg"; |
---|
| 508 | +// } |
---|
| 509 | +// else |
---|
| 510 | +// { |
---|
| 511 | +// if (name != null) |
---|
| 512 | +// { |
---|
| 513 | +// if (name.equals("")) |
---|
| 514 | +// { |
---|
| 515 | +// copy.skyboxname = null; |
---|
| 516 | +// copy.skyboxext = null; |
---|
| 517 | +// } |
---|
| 518 | +// else |
---|
| 519 | +// { |
---|
| 520 | +// copy.skyboxname = name; |
---|
| 521 | +// } |
---|
| 522 | +// } |
---|
| 523 | +// } |
---|
| 524 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 525 | + |
---|
| 526 | +// refreshContents(false); // To refresh Info tab |
---|
| 527 | + cameraView.repaint(); |
---|
| 528 | + } |
---|
| 529 | + }; |
---|
| 530 | + objectPanel.addChangeListener(changeListener); |
---|
| 531 | + |
---|
352 | 532 | toolbarPanel = new JPanel(); |
---|
353 | 533 | toolbarPanel.setName("Toolbar"); |
---|
354 | | - treePanel = new JPanel(); |
---|
| 534 | + |
---|
| 535 | + treePanel = new cGridBag(); |
---|
355 | 536 | treePanel.setName("Tree"); |
---|
356 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
357 | | - ctrlPanel.setName("Edit"); |
---|
358 | | - materialPanel = new JPanel(); |
---|
359 | | - materialPanel.setName("Material"); |
---|
| 537 | + |
---|
| 538 | + editPanel = new cGridBag().setVertical(true); |
---|
| 539 | + //editPanel.setName("Edit"); |
---|
| 540 | + |
---|
| 541 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
| 542 | + |
---|
| 543 | + editCommandsPanel = new cGridBag(); |
---|
| 544 | + editPanel.add(editCommandsPanel); |
---|
| 545 | + editPanel.add(ctrlPanel); |
---|
| 546 | + |
---|
| 547 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 548 | + //toolboxPanel.setName("Toolbox"); |
---|
| 549 | + |
---|
| 550 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 551 | + |
---|
| 552 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 553 | + //materialPanel.setName("Material"); |
---|
| 554 | + |
---|
360 | 555 | /*JTextPane*/ |
---|
361 | 556 | infoarea = createTextPane(); |
---|
| 557 | + doc = infoarea.getStyledDocument(); |
---|
| 558 | + |
---|
362 | 559 | infoarea.setEditable(true); |
---|
363 | 560 | SetText(); |
---|
| 561 | + |
---|
364 | 562 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
365 | 563 | // infoarea.setOpaque(false); |
---|
366 | 564 | // //infoarea.setForeground(textcolor); |
---|
367 | | - infoarea.setLineWrap(true); |
---|
368 | | - infoarea.setWrapStyleWord(true); |
---|
| 565 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 566 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
369 | 567 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
370 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
371 | | - infoPanel.setName("Info"); |
---|
| 568 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
| 569 | + //infoPanel.setName("Info"); |
---|
372 | 570 | //infoPanel.setLayout(new BorderLayout()); |
---|
373 | 571 | //infoPanel.add(createTextPane()); |
---|
374 | 572 | |
---|
.. | .. |
---|
376 | 574 | mainPanel.setName("Main"); |
---|
377 | 575 | mainPanel.setContinuousLayout(true); |
---|
378 | 576 | mainPanel.setOneTouchExpandable(true); |
---|
379 | | - mainPanel.setDividerLocation(1.0); |
---|
380 | 577 | mainPanel.setDividerSize(9); |
---|
381 | | - mainPanel.setResizeWeight(0); |
---|
382 | | - |
---|
| 578 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 579 | + mainPanel.setResizeWeight(0.5); |
---|
| 580 | + |
---|
| 581 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 582 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 583 | + divider.setDividerSize(15); |
---|
| 584 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 585 | + |
---|
| 586 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 587 | + |
---|
383 | 588 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
384 | 589 | //mainPanel.setLayout(new GridBagLayout()); |
---|
385 | 590 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
386 | | - treePanel.setLayout(new GridBagLayout()); |
---|
387 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
388 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 591 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 592 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 593 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
389 | 594 | |
---|
390 | 595 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
391 | 596 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
424 | 629 | static String newline = "\n"; |
---|
425 | 630 | protected static final String buttonString = "JButton"; |
---|
426 | 631 | StyledDocument doc; |
---|
427 | | - JTextArea infoarea; |
---|
| 632 | + JTextPane infoarea; |
---|
428 | 633 | |
---|
429 | 634 | void ClearInfo() |
---|
430 | 635 | { |
---|
.. | .. |
---|
447 | 652 | e.printStackTrace(); |
---|
448 | 653 | } |
---|
449 | 654 | |
---|
450 | | - String selection = infoarea.getText(); |
---|
451 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
452 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
453 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 655 | +// String selection = infoarea.getText(); |
---|
| 656 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 657 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 658 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
454 | 659 | //clipboard.setContents(data, data); |
---|
455 | 660 | } |
---|
456 | 661 | |
---|
.. | .. |
---|
473 | 678 | //SendInfo("Name:", "bold"); |
---|
474 | 679 | if (sel.GetTextures() != null || debug) |
---|
475 | 680 | { |
---|
476 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 681 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
477 | 682 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
478 | 683 | if (sel.Size() > 0) |
---|
479 | 684 | { |
---|
480 | 685 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
481 | 686 | } |
---|
482 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 687 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
483 | 688 | if (debug) |
---|
484 | 689 | { |
---|
485 | 690 | try |
---|
.. | .. |
---|
491 | 696 | } |
---|
492 | 697 | |
---|
493 | 698 | if (full) |
---|
494 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 699 | + { |
---|
| 700 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 701 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 702 | + } |
---|
495 | 703 | |
---|
496 | 704 | if (sel.bRep != null) |
---|
497 | 705 | { |
---|
.. | .. |
---|
518 | 726 | } |
---|
519 | 727 | if (sel.support != null) |
---|
520 | 728 | { |
---|
521 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 729 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
522 | 730 | } |
---|
523 | 731 | if (sel.scriptnode != null) |
---|
524 | 732 | { |
---|
.. | .. |
---|
589 | 797 | { |
---|
590 | 798 | CameraPane.pointflow = (PointFlow) sel; |
---|
591 | 799 | } |
---|
| 800 | + |
---|
| 801 | + si.SendInfo("_____________________", "regular"); |
---|
| 802 | + si.SendInfo("", "regular"); |
---|
592 | 803 | } |
---|
593 | 804 | } |
---|
594 | 805 | |
---|
.. | .. |
---|
604 | 815 | } |
---|
605 | 816 | } |
---|
606 | 817 | |
---|
| 818 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 819 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 820 | + |
---|
| 821 | + Rectangle keeprect; |
---|
| 822 | + cRadio radio; |
---|
| 823 | + |
---|
| 824 | +cButton keepButton; |
---|
| 825 | + cButton twoButton; // Full 3D |
---|
| 826 | + cButton sixButton; |
---|
| 827 | + cButton threeButton; |
---|
| 828 | + cButton sevenButton; |
---|
| 829 | + cButton fourButton; // full panel |
---|
| 830 | + cButton oneButton; // full XYZ |
---|
| 831 | + //cButton currentLayout; |
---|
| 832 | + |
---|
| 833 | + boolean maximized; |
---|
| 834 | + |
---|
| 835 | + cButton fullscreenLayout; |
---|
| 836 | + cButton expandedLayout; |
---|
| 837 | + |
---|
| 838 | + void Minimize() |
---|
| 839 | + { |
---|
| 840 | + frame.setState(Frame.ICONIFIED); |
---|
| 841 | + frame.validate(); |
---|
| 842 | + } |
---|
| 843 | + |
---|
| 844 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 845 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 846 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
| 847 | + void Maximize() |
---|
| 848 | + { |
---|
| 849 | + if (CameraPane.FULLSCREEN) |
---|
| 850 | + { |
---|
| 851 | + ToggleFullScreen(); |
---|
| 852 | + } |
---|
| 853 | + |
---|
| 854 | + if (maximized) |
---|
| 855 | + { |
---|
| 856 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 857 | + } |
---|
| 858 | + else |
---|
| 859 | + { |
---|
| 860 | + keeprect = frame.getBounds(); |
---|
| 861 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 862 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 863 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 864 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 865 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
| 866 | + } |
---|
| 867 | + |
---|
| 868 | + maximized ^= true; |
---|
| 869 | + |
---|
| 870 | + frame.validate(); |
---|
| 871 | + } |
---|
| 872 | + |
---|
| 873 | + cButton minButton; |
---|
| 874 | + cButton maxButton; |
---|
| 875 | + cButton fullButton; |
---|
| 876 | + cButton collapseButton; |
---|
| 877 | + cButton maximize3DButton; |
---|
| 878 | + |
---|
607 | 879 | void ToggleFullScreen() |
---|
608 | 880 | { |
---|
609 | | - if (CameraPane.FULLSCREEN) |
---|
| 881 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 882 | + |
---|
| 883 | + cameraView.ToggleFullScreen(); |
---|
| 884 | + |
---|
| 885 | + if (!CameraPane.FULLSCREEN) |
---|
610 | 886 | { |
---|
611 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
612 | | - framePanel.add(bigThree); |
---|
613 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 887 | + device.setFullScreenWindow(null); |
---|
| 888 | + frame.dispose(); |
---|
| 889 | + frame.setUndecorated(false); |
---|
| 890 | + frame.validate(); |
---|
| 891 | + frame.setVisible(true); |
---|
| 892 | + |
---|
| 893 | + //frame.setVisible(false); |
---|
| 894 | +// frame.removeNotify(); |
---|
| 895 | +// frame.setUndecorated(false); |
---|
| 896 | +// frame.addNotify(); |
---|
| 897 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 898 | + |
---|
| 899 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 900 | +// X framePanel.add(bigThree); |
---|
| 901 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 902 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
| 903 | + |
---|
| 904 | + //frame.setVisible(true); |
---|
| 905 | +// radio.layout = keepButton; |
---|
| 906 | + //theFrame = null; |
---|
| 907 | + keepButton = null; |
---|
| 908 | +// radio.layout.doClick(); |
---|
| 909 | + |
---|
614 | 910 | } else |
---|
615 | 911 | { |
---|
616 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
617 | | - framePanel.remove(bigThree); |
---|
618 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 912 | + keepButton = radio.layout; |
---|
| 913 | + //keeprect = frame.getBounds(); |
---|
| 914 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 915 | +// frame.getToolkit().getScreenSize().height); |
---|
| 916 | + //frame.setVisible(false); |
---|
| 917 | + |
---|
| 918 | + frame.dispose(); |
---|
| 919 | + frame.setUndecorated(true); |
---|
| 920 | + device.setFullScreenWindow(frame); |
---|
| 921 | + frame.validate(); |
---|
| 922 | + frame.setVisible(true); |
---|
| 923 | +// frame.removeNotify(); |
---|
| 924 | +// frame.setUndecorated(true); |
---|
| 925 | +// frame.addNotify(); |
---|
| 926 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 927 | +// X framePanel.remove(bigThree); |
---|
| 928 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 929 | +// framePanel.setDividerLocation(0); |
---|
| 930 | + |
---|
| 931 | +// radio.layout = fullscreenLayout; |
---|
| 932 | +// radio.layout.doClick(); |
---|
| 933 | + //frame.setVisible(true); |
---|
619 | 934 | } |
---|
620 | | - cameraView.ToggleFullScreen(); |
---|
| 935 | + frame.validate(); |
---|
| 936 | + |
---|
| 937 | + cameraView.requestFocusInWindow(); |
---|
621 | 938 | } |
---|
622 | 939 | |
---|
623 | | - private JTextArea createTextPane() |
---|
| 940 | + void CollapseToolbar() |
---|
| 941 | + { |
---|
| 942 | + framePanel.setDividerLocation(0); |
---|
| 943 | + //frame.validate(); |
---|
| 944 | + |
---|
| 945 | + cameraView.requestFocusInWindow(); |
---|
| 946 | + } |
---|
| 947 | + |
---|
| 948 | + private Object3D Duplicate(Object3D object) |
---|
624 | 949 | { |
---|
625 | | - String[] initString = |
---|
626 | | - { |
---|
627 | | - "This is an editable JTextPane, ", //regular |
---|
628 | | - "another ", //italic |
---|
629 | | - "styled ", //bold |
---|
630 | | - "text ", //small |
---|
631 | | - "component, ", //large |
---|
632 | | - "which supports embedded components..." + newline,//regular |
---|
633 | | - " " + newline, //button |
---|
634 | | - "...and embedded icons..." + newline, //regular |
---|
635 | | - " ", //icon |
---|
636 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
637 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
638 | | - + "cover methods for interacting with those objects." |
---|
639 | | - }; |
---|
| 950 | + boolean temp = CameraPane.SWITCH; |
---|
| 951 | + CameraPane.SWITCH = false; |
---|
| 952 | + |
---|
| 953 | + object.ExtractBigData(versiontable); |
---|
| 954 | + // if (copy == client) |
---|
| 955 | + |
---|
| 956 | + Object3D versions[] = object.versionlist; |
---|
| 957 | + object.versionlist = null; |
---|
| 958 | + |
---|
| 959 | + //byte[] compress = Compress(copy); |
---|
| 960 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
| 961 | + |
---|
| 962 | + object.versionlist = versions; |
---|
| 963 | + |
---|
| 964 | + object.RestoreBigData(versiontable); |
---|
| 965 | + |
---|
| 966 | + CameraPane.SWITCH = temp; |
---|
| 967 | + |
---|
| 968 | + return compress; |
---|
| 969 | + } |
---|
640 | 970 | |
---|
641 | | - String[] initStyles = |
---|
642 | | - { |
---|
643 | | - "regular", "italic", "bold", "small", "large", |
---|
644 | | - "regular", "button", "regular", "icon", |
---|
645 | | - "regular" |
---|
646 | | - }; |
---|
| 971 | + private JTextPane createTextPane() |
---|
| 972 | + { |
---|
| 973 | +// TEXTAREA String[] initString = |
---|
| 974 | +// { |
---|
| 975 | +// "This is an editable JTextPane, ", //regular |
---|
| 976 | +// "another ", //italic |
---|
| 977 | +// "styled ", //bold |
---|
| 978 | +// "text ", //small |
---|
| 979 | +// "component, ", //large |
---|
| 980 | +// "which supports embedded components..." + newline,//regular |
---|
| 981 | +// " " + newline, //button |
---|
| 982 | +// "...and embedded icons..." + newline, //regular |
---|
| 983 | +// " ", //icon |
---|
| 984 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 985 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 986 | +// + "cover methods for interacting with those objects." |
---|
| 987 | +// }; |
---|
| 988 | +// |
---|
| 989 | +// String[] initStyles = |
---|
| 990 | +// { |
---|
| 991 | +// "regular", "italic", "bold", "small", "large", |
---|
| 992 | +// "regular", "button", "regular", "icon", |
---|
| 993 | +// "regular" |
---|
| 994 | +// }; |
---|
| 995 | +// |
---|
| 996 | +// JTextPane textPane = new JTextPane(); |
---|
| 997 | +// textPane.setEditable(true); |
---|
| 998 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 999 | +// addStylesToDocument(doc); |
---|
| 1000 | +// |
---|
| 1001 | +// try |
---|
| 1002 | +// { |
---|
| 1003 | +// for (int j = 0; j < 2; j++) |
---|
| 1004 | +// { |
---|
| 1005 | +// for (int i = 0; i < initString.length; i++) |
---|
| 1006 | +// { |
---|
| 1007 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 1008 | +// doc.getStyle(initStyles[i])); |
---|
| 1009 | +// } |
---|
| 1010 | +// } |
---|
| 1011 | +// } catch (BadLocationException ble) |
---|
| 1012 | +// { |
---|
| 1013 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 1014 | +// } |
---|
647 | 1015 | |
---|
648 | | - JTextPane textPane = new JTextPane(); |
---|
649 | | - textPane.setEditable(true); |
---|
650 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
651 | | - addStylesToDocument(doc); |
---|
652 | | - |
---|
653 | | - try |
---|
654 | | - { |
---|
655 | | - for (int j = 0; j < 2; j++) |
---|
656 | | - { |
---|
657 | | - for (int i = 0; i < initString.length; i++) |
---|
658 | | - { |
---|
659 | | - doc.insertString(doc.getLength(), initString[i], |
---|
660 | | - doc.getStyle(initStyles[i])); |
---|
661 | | - } |
---|
662 | | - } |
---|
663 | | - } catch (BadLocationException ble) |
---|
664 | | - { |
---|
665 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
666 | | - } |
---|
667 | | - |
---|
668 | | - return new JTextArea(); // textPane; |
---|
| 1016 | + return new JTextPane(); // textPane; |
---|
669 | 1017 | } |
---|
670 | 1018 | |
---|
671 | 1019 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
718 | 1066 | protected static ImageIcon createImageIcon(String path, |
---|
719 | 1067 | String description) |
---|
720 | 1068 | { |
---|
721 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 1069 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
722 | 1070 | if (imgURL != null) |
---|
723 | 1071 | { |
---|
724 | 1072 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
741 | 1089 | { |
---|
742 | 1090 | SetupMaterial(materialPanel); |
---|
743 | 1091 | } |
---|
| 1092 | + |
---|
744 | 1093 | //SetupName(); |
---|
745 | 1094 | //SetupViews(); |
---|
746 | 1095 | } |
---|
.. | .. |
---|
750 | 1099 | // NumberSlider vDivsField; |
---|
751 | 1100 | // JCheckBox endcaps; |
---|
752 | 1101 | JCheckBox liveCB; |
---|
| 1102 | + JCheckBox selectableCB; |
---|
753 | 1103 | JCheckBox hideCB; |
---|
754 | 1104 | JCheckBox link2masterCB; |
---|
755 | 1105 | JCheckBox markCB; |
---|
.. | .. |
---|
757 | 1107 | JCheckBox speedupCB; |
---|
758 | 1108 | JCheckBox rewindCB; |
---|
759 | 1109 | JCheckBox flipVCB; |
---|
| 1110 | + |
---|
| 1111 | + cCheckBox toggleTextureCB; |
---|
| 1112 | + cCheckBox toggleSwitchCB; |
---|
| 1113 | + |
---|
760 | 1114 | JComboBox texresMenu; |
---|
| 1115 | + |
---|
761 | 1116 | JButton resetButton; |
---|
762 | 1117 | JButton stepButton; |
---|
763 | 1118 | JButton stepAllButton; |
---|
.. | .. |
---|
765 | 1120 | JButton slowerButton; |
---|
766 | 1121 | JButton fasterButton; |
---|
767 | 1122 | JButton remarkButton; |
---|
| 1123 | + |
---|
| 1124 | + cGridBag editPanel; |
---|
| 1125 | + cGridBag editCommandsPanel; |
---|
| 1126 | + |
---|
| 1127 | + cGridBag namePanel; |
---|
| 1128 | + cGridBag setupPanel; |
---|
| 1129 | + cGridBag setupPanel2; |
---|
| 1130 | + cGridBag objectCommandsPanel; |
---|
| 1131 | + cGridBag pushPanel; |
---|
| 1132 | + cGridBag fillPanel; |
---|
768 | 1133 | |
---|
769 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 1134 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
770 | 1135 | { |
---|
771 | 1136 | JCheckBox cb; |
---|
772 | 1137 | |
---|
773 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
774 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
775 | | -// oe.aConstraints.weightx = 1; |
---|
776 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
777 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1138 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
778 | 1139 | cb.addItemListener(this); |
---|
779 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
780 | | - oe.aConstraints.gridwidth = 1; |
---|
781 | | - oe.aConstraints.gridx += 1; |
---|
782 | 1140 | |
---|
783 | 1141 | return cb; |
---|
784 | 1142 | } |
---|
785 | 1143 | |
---|
786 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 1144 | + cButton AddButton(cGridBag panel, String label) |
---|
787 | 1145 | { |
---|
788 | 1146 | cButton cb; |
---|
789 | 1147 | |
---|
790 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
791 | | - oe.aConstraints.gridwidth = 1; |
---|
792 | | -// oe.aConstraints.weightx = 1; |
---|
793 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
794 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 1148 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
795 | 1149 | cb.addActionListener(this); |
---|
796 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
797 | | - oe.aConstraints.gridwidth = 1; |
---|
798 | | - oe.aConstraints.gridx += 1; |
---|
799 | 1150 | |
---|
800 | 1151 | return cb; |
---|
801 | 1152 | } |
---|
802 | 1153 | |
---|
803 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 1154 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
804 | 1155 | { |
---|
805 | 1156 | JComboBox combo; |
---|
806 | 1157 | |
---|
807 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
808 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
809 | | - oe.aConstraints.gridx += 1; |
---|
| 1158 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
810 | 1159 | combo.addActionListener(this); |
---|
811 | 1160 | |
---|
812 | 1161 | return combo; |
---|
813 | 1162 | } |
---|
814 | 1163 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 1164 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
816 | 1165 | { |
---|
817 | | - NumberSlider combo; |
---|
| 1166 | + cGridBag control = new cGridBag(); |
---|
| 1167 | + |
---|
| 1168 | + cNumberSlider combo; |
---|
818 | 1169 | |
---|
819 | 1170 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 1171 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
823 | | - aConstraints.gridwidth = 1; |
---|
824 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
825 | | - aConstraints.gridx += 1; |
---|
826 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
827 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
828 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
829 | | - aConstraints.gridx += 1; |
---|
830 | | - aConstraints.gridwidth = 1; |
---|
831 | | - |
---|
| 1172 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1173 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 1174 | combo.setFloat(current); |
---|
833 | | - |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 1175 | + |
---|
| 1176 | + panel.add(control); |
---|
| 1177 | + |
---|
| 1178 | + return control; |
---|
839 | 1179 | } |
---|
840 | 1180 | |
---|
841 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 1181 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
842 | 1182 | { |
---|
843 | | - NumberSlider combo; |
---|
| 1183 | + cGridBag control = new cGridBag(); |
---|
| 1184 | + |
---|
| 1185 | + cNumberSlider combo; |
---|
844 | 1186 | |
---|
845 | 1187 | JLabel jlabel = new JLabel(label); |
---|
846 | | - |
---|
847 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
848 | 1188 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
849 | | - aConstraints.gridwidth = 2; |
---|
850 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
851 | | - aConstraints.gridx += 1; |
---|
852 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
853 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
854 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
855 | | - aConstraints.gridx += 1; |
---|
856 | | - aConstraints.gridwidth = 1; |
---|
857 | | - |
---|
| 1189 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1190 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
858 | 1191 | combo.setInteger(current); |
---|
859 | 1192 | |
---|
860 | | - combo.label = jlabel; |
---|
861 | | - |
---|
862 | | - combo.addChangeListener(this); |
---|
863 | | - |
---|
864 | | - return combo; |
---|
| 1193 | + panel.add(control); |
---|
| 1194 | + |
---|
| 1195 | + return control; |
---|
865 | 1196 | } |
---|
866 | 1197 | |
---|
867 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 1198 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
868 | 1199 | { |
---|
869 | 1200 | JTextArea text; |
---|
870 | 1201 | |
---|
871 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
872 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
873 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1202 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
874 | 1203 | text.addCaretListener(this); |
---|
875 | | - aConstraints.gridx += 1; |
---|
876 | | - aConstraints.gridwidth = 1; |
---|
877 | 1204 | |
---|
878 | 1205 | return text; |
---|
879 | 1206 | } |
---|
.. | .. |
---|
903 | 1230 | objEditor.ctrlPanel.remove(j); |
---|
904 | 1231 | } |
---|
905 | 1232 | |
---|
| 1233 | + void Remove(cNumberSlider j) |
---|
| 1234 | + { |
---|
| 1235 | + j.removeChangeListener(this); |
---|
| 1236 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 1237 | + objEditor.ctrlPanel.remove(j); |
---|
| 1238 | + } |
---|
| 1239 | + |
---|
906 | 1240 | /* |
---|
907 | 1241 | */ |
---|
908 | | - void Return() // ObjEditor oe) |
---|
| 1242 | + void Return0() // ObjEditor oe) |
---|
909 | 1243 | { |
---|
910 | 1244 | aConstraints.gridy += 1; |
---|
911 | 1245 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
960 | 1294 | |
---|
961 | 1295 | void SetupUI2(ObjEditor oe) |
---|
962 | 1296 | { |
---|
963 | | -// oe.aConstraints.weightx = 0; |
---|
964 | | -// oe.aConstraints.weighty = 0; |
---|
965 | | -// oe.aConstraints.gridx = 0; |
---|
966 | | -// oe.aConstraints.gridy = 0; |
---|
967 | | - SetupName(oe); |
---|
| 1297 | + //SetupName(oe); |
---|
968 | 1298 | |
---|
969 | | - if (!GroupEditor.allparams) |
---|
| 1299 | + namePanel = new cGridBag(); |
---|
| 1300 | + |
---|
| 1301 | + //if (copy.pinned) |
---|
| 1302 | + { |
---|
| 1303 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1304 | + pinButton.setSelected(copy.pinned); |
---|
| 1305 | + cGridBag t = new cGridBag(); |
---|
| 1306 | + t.preferredWidth = 2; |
---|
| 1307 | + t.add(pinButton); |
---|
| 1308 | + namePanel.add(t); |
---|
| 1309 | + |
---|
| 1310 | + pinButton.addItemListener(this); |
---|
| 1311 | + } |
---|
| 1312 | + |
---|
| 1313 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 1314 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
| 1315 | + oe.ctrlPanel.add(namePanel); |
---|
| 1316 | + |
---|
| 1317 | + oe.ctrlPanel.Return(); |
---|
| 1318 | + |
---|
| 1319 | + if (!allparams) |
---|
970 | 1320 | return; |
---|
971 | 1321 | |
---|
972 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
973 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
974 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1322 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1323 | + |
---|
| 1324 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1325 | + liveCB.setToolTipText("Animate object"); |
---|
| 1326 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1327 | + selectableCB.setToolTipText("Make object selectable"); |
---|
975 | 1328 | // Return(); |
---|
976 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
977 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
978 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
979 | | - Return(); |
---|
980 | | - resetButton = AddButton(oe, "Reset"); |
---|
981 | | - stepButton = AddButton(oe, "Step"); |
---|
| 1329 | + |
---|
| 1330 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1331 | + hideCB.setToolTipText("Hide object"); |
---|
| 1332 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 1333 | + markCB.setToolTipText("As animation target transform"); |
---|
| 1334 | + |
---|
| 1335 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
| 1336 | + |
---|
| 1337 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1338 | + |
---|
| 1339 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1340 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1341 | + |
---|
| 1342 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1343 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
| 1344 | + |
---|
| 1345 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1346 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1347 | + |
---|
| 1348 | + if (Globals.ADVANCED) |
---|
| 1349 | + { |
---|
| 1350 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1351 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1352 | + } |
---|
| 1353 | + |
---|
| 1354 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1355 | + oe.ctrlPanel.Return(); |
---|
| 1356 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1357 | + oe.ctrlPanel.Return(); |
---|
| 1358 | + |
---|
| 1359 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
| 1360 | + |
---|
| 1361 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1362 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1363 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1364 | + stepButton.setToolTipText("Step one frame"); |
---|
982 | 1365 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
983 | 1366 | // stepAllButton = AddButton(oe, "Step All"); |
---|
984 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
985 | 1367 | // Return(); |
---|
986 | | - slowerButton = AddButton(oe, "Slow"); |
---|
987 | | - fasterButton = AddButton(oe, "Fast"); |
---|
988 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1368 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1369 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1370 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1371 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1372 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1373 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
989 | 1374 | |
---|
990 | | - Return(); |
---|
| 1375 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
| 1376 | + oe.ctrlPanel.Return(); |
---|
991 | 1377 | |
---|
992 | | - normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
993 | | - Return(); |
---|
| 1378 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1379 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1380 | + //Return(); |
---|
| 1381 | + |
---|
| 1382 | + oe.ctrlPanel.Return(); |
---|
994 | 1383 | |
---|
995 | 1384 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
996 | 1385 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1085 | 1474 | oe.aConstraints.gridwidth = 1; |
---|
1086 | 1475 | /**/ |
---|
1087 | 1476 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1088 | | - Return(); |
---|
| 1477 | + oe.ctrlPanel.Return(); |
---|
1089 | 1478 | |
---|
1090 | 1479 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1091 | 1480 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1187 | 1576 | //JPanel worldPanel = |
---|
1188 | 1577 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1189 | 1578 | //worldPanel.setName("World"); |
---|
1190 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
1191 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1192 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1579 | + centralPanel = new cGridBag(); |
---|
| 1580 | + centralPanel.preferredWidth = 20; |
---|
| 1581 | + |
---|
| 1582 | + if (Globals.ADVANCED) |
---|
| 1583 | + { |
---|
| 1584 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1585 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1193 | 1586 | |
---|
1194 | 1587 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1195 | 1588 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1198 | 1591 | // cameraPanel.setDividerSize(9); |
---|
1199 | 1592 | cameraPanel.setResizeWeight(1.0); |
---|
1200 | 1593 | |
---|
| 1594 | + } |
---|
| 1595 | + |
---|
1201 | 1596 | centralPanel.add(cameraView); |
---|
| 1597 | + centralPanel.setFocusable(true); |
---|
1202 | 1598 | //frame.setJMenuBar(timelineMenubar); |
---|
1203 | 1599 | //centralPanel.add(timelinePanel); |
---|
1204 | 1600 | |
---|
.. | .. |
---|
1217 | 1613 | //frontView.object = copy; |
---|
1218 | 1614 | //sideView.object = copy; |
---|
1219 | 1615 | |
---|
1220 | | - XYZPanel = new JPanel(); |
---|
1221 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1616 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1617 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1222 | 1618 | |
---|
1223 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1224 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1225 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1619 | + XYZPanel.preferredWidth = 5; |
---|
| 1620 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1621 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1622 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1623 | + //XYZPanel.setName("XYZ"); |
---|
1226 | 1624 | |
---|
1227 | 1625 | /* |
---|
1228 | 1626 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1260 | 1658 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1261 | 1659 | //tmp.setName("Edit"); |
---|
1262 | 1660 | objectPanel.add(materialPanel); |
---|
1263 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1264 | | - north.setName("Edit"); |
---|
1265 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1266 | | - objectPanel.add(north); |
---|
1267 | | - objectPanel.add(infoPanel); |
---|
| 1661 | + objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1662 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1663 | + |
---|
| 1664 | + objectPanel.add(toolboxPanel); |
---|
| 1665 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1666 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
1268 | 1667 | |
---|
| 1668 | + objectPanel.add(skyboxPanel); |
---|
| 1669 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1670 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1671 | + |
---|
| 1672 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1673 | +// north.setName("Edit"); |
---|
| 1674 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1675 | +// objectPanel.add(north); |
---|
| 1676 | + objectPanel.add(editPanel); |
---|
| 1677 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1678 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
| 1679 | + |
---|
| 1680 | + objectPanel.add(XYZPanel); |
---|
| 1681 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1682 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
| 1683 | + |
---|
1269 | 1684 | /* |
---|
1270 | 1685 | aConstraints.gridx = 0; |
---|
1271 | 1686 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1273 | 1688 | aConstraints.gridy += 1; |
---|
1274 | 1689 | aConstraints.gridwidth = 1; |
---|
1275 | 1690 | mainPanel.add(objectPanel, aConstraints); |
---|
1276 | | - */ |
---|
| 1691 | + */ |
---|
1277 | 1692 | |
---|
1278 | 1693 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1279 | 1694 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1284 | 1699 | scrollpane.setWheelScrollingEnabled(true); |
---|
1285 | 1700 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1286 | 1701 | |
---|
1287 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1288 | | - scenePanel.add(scrollpane); |
---|
| 1702 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1703 | + scenePanel.preferredWidth = 5; |
---|
| 1704 | + |
---|
| 1705 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1706 | + tabbedPane.add(scrollpane); |
---|
1289 | 1707 | |
---|
1290 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
1291 | | - |
---|
1292 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1708 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1293 | 1709 | |
---|
1294 | 1710 | optionsPanel.setName("Options"); |
---|
1295 | | - scenePanel.add(optionsPanel); |
---|
| 1711 | + |
---|
| 1712 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1713 | + |
---|
| 1714 | + tabbedPane.add(optionsPanel); |
---|
| 1715 | + |
---|
| 1716 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1296 | 1717 | |
---|
| 1718 | + scenePanel.add(tabbedPane); |
---|
1297 | 1719 | |
---|
| 1720 | + //if (Globals.ADVANCED) |
---|
| 1721 | +// tabbedPane.add(infoPanel); |
---|
| 1722 | +// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1723 | +// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1724 | + |
---|
1298 | 1725 | /* |
---|
1299 | 1726 | cTree jTree = new cTree(null); |
---|
1300 | 1727 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1327 | 1754 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1328 | 1755 | //bigPanel.add(ctrlPanel); |
---|
1329 | 1756 | //bigPanel.add(gridPanel); |
---|
| 1757 | + /** |
---|
1330 | 1758 | bigThree = new JPanel(); |
---|
1331 | 1759 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1332 | 1760 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1350 | 1778 | // aConstraints.gridheight = 3; |
---|
1351 | 1779 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1352 | 1780 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1781 | + /**/ |
---|
1353 | 1782 | |
---|
| 1783 | + bigThree = new cGridBag(); |
---|
| 1784 | + bigThree.addComponent(scenePanel); |
---|
| 1785 | + bigThree.addComponent(centralPanel); |
---|
| 1786 | + //bigThree.addComponent(XYZPanel); |
---|
| 1787 | + |
---|
1354 | 1788 | // // SIDE EFFECT!!! |
---|
1355 | 1789 | // aConstraints.gridx = 0; |
---|
1356 | 1790 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1358 | 1792 | // aConstraints.gridheight = 1; |
---|
1359 | 1793 | |
---|
1360 | 1794 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1361 | | - framePanel.setContinuousLayout(true); |
---|
1362 | | - framePanel.setOneTouchExpandable(true); |
---|
1363 | | - framePanel.setDividerLocation(0.8); |
---|
| 1795 | + |
---|
| 1796 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1797 | + new java.beans.PropertyChangeListener() |
---|
| 1798 | + { |
---|
| 1799 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1800 | + { |
---|
| 1801 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1802 | + { |
---|
| 1803 | + if (radio.layout != expandedLayout) |
---|
| 1804 | + { |
---|
| 1805 | + radio.layout = expandedLayout; |
---|
| 1806 | + radio.layout.doClick(); |
---|
| 1807 | + } |
---|
| 1808 | + } |
---|
| 1809 | + } |
---|
| 1810 | + }); |
---|
| 1811 | + |
---|
| 1812 | + framePanel.setContinuousLayout(false); |
---|
| 1813 | + framePanel.setOneTouchExpandable(false); |
---|
| 1814 | + //.setDividerLocation(0.8); |
---|
1364 | 1815 | //framePanel.setDividerSize(15); |
---|
1365 | 1816 | //framePanel.setResizeWeight(0.15); |
---|
1366 | 1817 | framePanel.setName("Frame"); |
---|
1367 | 1818 | |
---|
1368 | 1819 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1369 | 1820 | /**/ |
---|
1370 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1821 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1371 | 1822 | //worldPane.add(bigPanel); |
---|
1372 | 1823 | //worldPane.add(worldPanel); |
---|
1373 | 1824 | /**/ |
---|
.. | .. |
---|
1377 | 1828 | |
---|
1378 | 1829 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1379 | 1830 | |
---|
1380 | | - frame.setSize(1024, 768); |
---|
1381 | | - frame.show(); |
---|
1382 | | - |
---|
| 1831 | + frame.setSize(1280, 860); |
---|
| 1832 | + |
---|
| 1833 | + cameraView.requestFocusInWindow(); |
---|
| 1834 | + |
---|
1383 | 1835 | gridPanel.setDividerLocation(1.0); |
---|
| 1836 | + |
---|
| 1837 | + frame.validate(); |
---|
| 1838 | + |
---|
| 1839 | + frame.setVisible(true); |
---|
1384 | 1840 | |
---|
1385 | 1841 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1386 | 1842 | frame.addWindowListener(new WindowAdapter() |
---|
1387 | 1843 | { |
---|
1388 | | - |
---|
1389 | 1844 | public void windowClosing(WindowEvent e) |
---|
1390 | 1845 | { |
---|
1391 | 1846 | Close(); |
---|
.. | .. |
---|
1393 | 1848 | }); |
---|
1394 | 1849 | } |
---|
1395 | 1850 | |
---|
| 1851 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1852 | + { |
---|
| 1853 | + } |
---|
| 1854 | + |
---|
1396 | 1855 | JTree GetTree() |
---|
1397 | 1856 | { |
---|
1398 | 1857 | return objEditor.jTree; |
---|
.. | .. |
---|
1404 | 1863 | ctrlPanel.removeAll(); |
---|
1405 | 1864 | } |
---|
1406 | 1865 | |
---|
1407 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1866 | + void SetupMaterial(cGridBag materialpanel) |
---|
1408 | 1867 | { |
---|
1409 | | - aConstraints.weighty = 0; |
---|
1410 | | - //aConstraints.weightx = 1; |
---|
1411 | | - /* |
---|
| 1868 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1869 | + |
---|
| 1870 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1871 | + skin.setToolTipText("Skin"); |
---|
| 1872 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1873 | + { |
---|
| 1874 | + public void mouseClicked(MouseEvent e) |
---|
| 1875 | + { |
---|
| 1876 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1877 | + cMaterial material = object.material; |
---|
| 1878 | + |
---|
| 1879 | + // Skin |
---|
| 1880 | + colorField.setFloat(material.color); |
---|
| 1881 | + saturationField.setFloat(material.modulation); |
---|
| 1882 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1883 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1884 | + diffusenessField.setFloat(material.factor); |
---|
| 1885 | + shininessField.setFloat(material.shininess); |
---|
| 1886 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1887 | + diffuseField.setFloat(material.diffuse); |
---|
| 1888 | + specularField.setFloat(material.specular); |
---|
| 1889 | + |
---|
| 1890 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1891 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1892 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1893 | + |
---|
| 1894 | + materialtouched = true; |
---|
| 1895 | + applySelf(); |
---|
| 1896 | + } |
---|
| 1897 | + }); |
---|
| 1898 | + presetpanel.add(skin); |
---|
| 1899 | + |
---|
| 1900 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1901 | + lambert.setToolTipText("Diffuse"); |
---|
| 1902 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1903 | + { |
---|
| 1904 | + public void mouseClicked(MouseEvent e) |
---|
| 1905 | + { |
---|
| 1906 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1907 | + cMaterial material = object.material; |
---|
| 1908 | + |
---|
| 1909 | + diffusenessField.setFloat(material.factor); |
---|
| 1910 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1911 | + |
---|
| 1912 | + materialtouched = true; |
---|
| 1913 | + applySelf(); |
---|
| 1914 | + } |
---|
| 1915 | + }); |
---|
| 1916 | + presetpanel.add(lambert); |
---|
| 1917 | + |
---|
| 1918 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1919 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1920 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1921 | + { |
---|
| 1922 | + public void mouseClicked(MouseEvent e) |
---|
| 1923 | + { |
---|
| 1924 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1925 | + cMaterial material = object.material; |
---|
| 1926 | + |
---|
| 1927 | + diffusenessField.setFloat(material.factor); |
---|
| 1928 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1929 | + |
---|
| 1930 | + materialtouched = true; |
---|
| 1931 | + applySelf(); |
---|
| 1932 | + } |
---|
| 1933 | + }); |
---|
| 1934 | + presetpanel.add(diffuse2); |
---|
| 1935 | + |
---|
| 1936 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1937 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1938 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1939 | + { |
---|
| 1940 | + public void mouseClicked(MouseEvent e) |
---|
| 1941 | + { |
---|
| 1942 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1943 | + cMaterial material = object.material; |
---|
| 1944 | + |
---|
| 1945 | + diffusenessField.setFloat(material.factor); |
---|
| 1946 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1947 | + |
---|
| 1948 | + materialtouched = true; |
---|
| 1949 | + applySelf(); |
---|
| 1950 | + } |
---|
| 1951 | + }); |
---|
| 1952 | + presetpanel.add(diffusemoon); |
---|
| 1953 | + |
---|
| 1954 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1955 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1956 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1957 | + { |
---|
| 1958 | + public void mouseClicked(MouseEvent e) |
---|
| 1959 | + { |
---|
| 1960 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1961 | + cMaterial material = object.material; |
---|
| 1962 | + |
---|
| 1963 | + diffusenessField.setFloat(material.factor); |
---|
| 1964 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1965 | + |
---|
| 1966 | + materialtouched = true; |
---|
| 1967 | + applySelf(); |
---|
| 1968 | + } |
---|
| 1969 | + }); |
---|
| 1970 | + presetpanel.add(diffusemoon2); |
---|
| 1971 | + |
---|
| 1972 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1973 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1974 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1975 | + { |
---|
| 1976 | + public void mouseClicked(MouseEvent e) |
---|
| 1977 | + { |
---|
| 1978 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1979 | + cMaterial material = object.material; |
---|
| 1980 | + |
---|
| 1981 | + diffusenessField.setFloat(material.factor); |
---|
| 1982 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1983 | + |
---|
| 1984 | + materialtouched = true; |
---|
| 1985 | + applySelf(); |
---|
| 1986 | + } |
---|
| 1987 | + }); |
---|
| 1988 | + presetpanel.add(diffusemoon3); |
---|
| 1989 | + |
---|
| 1990 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1991 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 1992 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 1993 | + { |
---|
| 1994 | + public void mouseClicked(MouseEvent e) |
---|
| 1995 | + { |
---|
| 1996 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 1997 | + cMaterial material = object.material; |
---|
| 1998 | + |
---|
| 1999 | + sheenField.setFloat(material.sheen); |
---|
| 2000 | + |
---|
| 2001 | + materialtouched = true; |
---|
| 2002 | + applySelf(); |
---|
| 2003 | + } |
---|
| 2004 | + }); |
---|
| 2005 | + presetpanel.add(diffusesheen); |
---|
| 2006 | + |
---|
| 2007 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2008 | + rough.setToolTipText("Rough metal"); |
---|
| 2009 | + rough.addMouseListener(new MouseAdapter() |
---|
| 2010 | + { |
---|
| 2011 | + public void mouseClicked(MouseEvent e) |
---|
| 2012 | + { |
---|
| 2013 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 2014 | + cMaterial material = object.material; |
---|
| 2015 | + |
---|
| 2016 | + shininessField.setFloat(material.shininess); |
---|
| 2017 | + velvetField.setFloat(material.velvet); |
---|
| 2018 | + |
---|
| 2019 | + materialtouched = true; |
---|
| 2020 | + applySelf(); |
---|
| 2021 | + } |
---|
| 2022 | + }); |
---|
| 2023 | + presetpanel.add(rough); |
---|
| 2024 | + |
---|
| 2025 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2026 | + rough2.setToolTipText("Medium metal"); |
---|
| 2027 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 2028 | + { |
---|
| 2029 | + public void mouseClicked(MouseEvent e) |
---|
| 2030 | + { |
---|
| 2031 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2032 | + cMaterial material = object.material; |
---|
| 2033 | + |
---|
| 2034 | + shininessField.setFloat(material.shininess); |
---|
| 2035 | + lightareaField.setFloat(material.lightarea); |
---|
| 2036 | + |
---|
| 2037 | + materialtouched = true; |
---|
| 2038 | + applySelf(); |
---|
| 2039 | + } |
---|
| 2040 | + }); |
---|
| 2041 | + presetpanel.add(rough2); |
---|
| 2042 | + |
---|
| 2043 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2044 | + shini0.setToolTipText("Shiny"); |
---|
| 2045 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2046 | + { |
---|
| 2047 | + public void mouseClicked(MouseEvent e) |
---|
| 2048 | + { |
---|
| 2049 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2050 | + cMaterial material = object.material; |
---|
| 2051 | + |
---|
| 2052 | + shininessField.setFloat(material.shininess); |
---|
| 2053 | + lightareaField.setFloat(material.lightarea); |
---|
| 2054 | + |
---|
| 2055 | + materialtouched = true; |
---|
| 2056 | + applySelf(); |
---|
| 2057 | + } |
---|
| 2058 | + }); |
---|
| 2059 | + presetpanel.add(shini0); |
---|
| 2060 | + |
---|
| 2061 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2062 | + shini1.setToolTipText("Shiny2"); |
---|
| 2063 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2064 | + { |
---|
| 2065 | + public void mouseClicked(MouseEvent e) |
---|
| 2066 | + { |
---|
| 2067 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2068 | + cMaterial material = object.material; |
---|
| 2069 | + |
---|
| 2070 | + shininessField.setFloat(material.shininess); |
---|
| 2071 | + lightareaField.setFloat(material.lightarea); |
---|
| 2072 | + |
---|
| 2073 | + materialtouched = true; |
---|
| 2074 | + applySelf(); |
---|
| 2075 | + } |
---|
| 2076 | + }); |
---|
| 2077 | + presetpanel.add(shini1); |
---|
| 2078 | + |
---|
| 2079 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2080 | + shini2.setToolTipText("Shiny3"); |
---|
| 2081 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2082 | + { |
---|
| 2083 | + public void mouseClicked(MouseEvent e) |
---|
| 2084 | + { |
---|
| 2085 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2086 | + cMaterial material = object.material; |
---|
| 2087 | + |
---|
| 2088 | + shininessField.setFloat(material.shininess); |
---|
| 2089 | + lightareaField.setFloat(material.lightarea); |
---|
| 2090 | + |
---|
| 2091 | + materialtouched = true; |
---|
| 2092 | + applySelf(); |
---|
| 2093 | + } |
---|
| 2094 | + }); |
---|
| 2095 | + presetpanel.add(shini2); |
---|
| 2096 | + |
---|
| 2097 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2098 | + aniso.setToolTipText("AnisoU"); |
---|
| 2099 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2100 | + { |
---|
| 2101 | + public void mouseClicked(MouseEvent e) |
---|
| 2102 | + { |
---|
| 2103 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2104 | + cMaterial material = object.material; |
---|
| 2105 | + |
---|
| 2106 | + anisoField.setFloat(material.aniso); |
---|
| 2107 | + anisoVField.setFloat(material.anisoV); |
---|
| 2108 | + |
---|
| 2109 | + materialtouched = true; |
---|
| 2110 | + applySelf(); |
---|
| 2111 | + } |
---|
| 2112 | + }); |
---|
| 2113 | + presetpanel.add(aniso); |
---|
| 2114 | + |
---|
| 2115 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2116 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2117 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2118 | + { |
---|
| 2119 | + public void mouseClicked(MouseEvent e) |
---|
| 2120 | + { |
---|
| 2121 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2122 | + cMaterial material = object.material; |
---|
| 2123 | + |
---|
| 2124 | + anisoField.setFloat(material.aniso); |
---|
| 2125 | + anisoVField.setFloat(material.anisoV); |
---|
| 2126 | + |
---|
| 2127 | + materialtouched = true; |
---|
| 2128 | + applySelf(); |
---|
| 2129 | + } |
---|
| 2130 | + }); |
---|
| 2131 | + presetpanel.add(aniso2); |
---|
| 2132 | + |
---|
| 2133 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2134 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2135 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2136 | + { |
---|
| 2137 | + public void mouseClicked(MouseEvent e) |
---|
| 2138 | + { |
---|
| 2139 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2140 | + cMaterial material = object.material; |
---|
| 2141 | + |
---|
| 2142 | + anisoField.setFloat(material.aniso); |
---|
| 2143 | + anisoVField.setFloat(material.anisoV); |
---|
| 2144 | + |
---|
| 2145 | + materialtouched = true; |
---|
| 2146 | + applySelf(); |
---|
| 2147 | + } |
---|
| 2148 | + }); |
---|
| 2149 | + presetpanel.add(aniso3); |
---|
| 2150 | + |
---|
| 2151 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2152 | + velvet0.setToolTipText("Velvet"); |
---|
| 2153 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2154 | + { |
---|
| 2155 | + public void mouseClicked(MouseEvent e) |
---|
| 2156 | + { |
---|
| 2157 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2158 | + cMaterial material = object.material; |
---|
| 2159 | + |
---|
| 2160 | + diffusenessField.setFloat(material.factor); |
---|
| 2161 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2162 | + sheenField.setFloat(material.sheen); |
---|
| 2163 | + shininessField.setFloat(material.shininess); |
---|
| 2164 | + velvetField.setFloat(material.velvet); |
---|
| 2165 | + shiftField.setFloat(material.shift); |
---|
| 2166 | + |
---|
| 2167 | + materialtouched = true; |
---|
| 2168 | + applySelf(); |
---|
| 2169 | + } |
---|
| 2170 | + }); |
---|
| 2171 | + presetpanel.add(velvet0); |
---|
| 2172 | + |
---|
| 2173 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2174 | + bump0.setToolTipText("Bump texture"); |
---|
| 2175 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2176 | + { |
---|
| 2177 | + public void mouseClicked(MouseEvent e) |
---|
| 2178 | + { |
---|
| 2179 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2180 | + cMaterial material = object.material; |
---|
| 2181 | + |
---|
| 2182 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2183 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2184 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2185 | + |
---|
| 2186 | + materialtouched = true; |
---|
| 2187 | + applySelf(); |
---|
| 2188 | + } |
---|
| 2189 | + }); |
---|
| 2190 | + presetpanel.add(bump0); |
---|
| 2191 | + |
---|
| 2192 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF); |
---|
| 2193 | + borderShader.setToolTipText("Border fade"); |
---|
| 2194 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2195 | + { |
---|
| 2196 | + public void mouseClicked(MouseEvent e) |
---|
| 2197 | + { |
---|
| 2198 | + borderfadeField.setFloat(0.5); |
---|
| 2199 | + opacityField.setFloat(0.6); |
---|
| 2200 | + |
---|
| 2201 | + materialtouched = true; |
---|
| 2202 | + applySelf(); |
---|
| 2203 | + } |
---|
| 2204 | + }); |
---|
| 2205 | + presetpanel.add(borderShader); |
---|
| 2206 | + |
---|
| 2207 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2208 | + halo.setToolTipText("Halo"); |
---|
| 2209 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2210 | + { |
---|
| 2211 | + public void mouseClicked(MouseEvent e) |
---|
| 2212 | + { |
---|
| 2213 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2214 | + cMaterial material = object.material; |
---|
| 2215 | + |
---|
| 2216 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2217 | + |
---|
| 2218 | + materialtouched = true; |
---|
| 2219 | + applySelf(); |
---|
| 2220 | + } |
---|
| 2221 | + }); |
---|
| 2222 | + presetpanel.add(halo); |
---|
| 2223 | + |
---|
| 2224 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2225 | + candle.setToolTipText("Candle"); |
---|
| 2226 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2227 | + { |
---|
| 2228 | + public void mouseClicked(MouseEvent e) |
---|
| 2229 | + { |
---|
| 2230 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2231 | + cMaterial material = object.material; |
---|
| 2232 | + |
---|
| 2233 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2234 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2235 | + ambientField.setFloat(material.ambient); |
---|
| 2236 | + specularField.setFloat(material.specular); |
---|
| 2237 | + lightareaField.setFloat(material.lightarea); |
---|
| 2238 | + shininessField.setFloat(material.shininess); |
---|
| 2239 | + |
---|
| 2240 | + materialtouched = true; |
---|
| 2241 | + applySelf(); |
---|
| 2242 | + } |
---|
| 2243 | + }); |
---|
| 2244 | + presetpanel.add(candle); |
---|
| 2245 | + |
---|
| 2246 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2247 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2248 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2249 | + { |
---|
| 2250 | + public void mouseClicked(MouseEvent e) |
---|
| 2251 | + { |
---|
| 2252 | + diffuseField.setFloat(0.001); |
---|
| 2253 | + ambientField.setFloat(0.001); |
---|
| 2254 | + cameraField.setFloat(0.001); |
---|
| 2255 | + specularField.setFloat(0.001); |
---|
| 2256 | + fakedepthField.setFloat(0.001); |
---|
| 2257 | + opacityField.setFloat(0.6); |
---|
| 2258 | + |
---|
| 2259 | + materialtouched = true; |
---|
| 2260 | + applySelf(); |
---|
| 2261 | + } |
---|
| 2262 | + }); |
---|
| 2263 | + presetpanel.add(shadowShader); |
---|
| 2264 | + |
---|
| 2265 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2266 | + |
---|
| 2267 | + presetpanel.preferredWidth = 1; |
---|
| 2268 | + |
---|
| 2269 | + materialpanel.add(presetpanel); |
---|
| 2270 | + materialpanel.add(panel); |
---|
| 2271 | + |
---|
| 2272 | + panel.preferredWidth = 8; |
---|
| 2273 | + |
---|
| 2274 | + /* |
---|
1412 | 2275 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1413 | 2276 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1414 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1415 | | - aConstraints.gridx += 1; |
---|
1416 | | - */ |
---|
| 2277 | + */ |
---|
1417 | 2278 | |
---|
1418 | | - aConstraints.gridwidth = 1; |
---|
1419 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1420 | | - aConstraints.gridx += 1; |
---|
1421 | | - aConstraints.weighty = 0; |
---|
1422 | | - aConstraints.gridwidth = 1; |
---|
| 2279 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 2280 | + |
---|
| 2281 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2282 | + createMaterialButton.setToolTipText("Create material"); |
---|
1423 | 2283 | |
---|
1424 | 2284 | /* |
---|
1425 | 2285 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1426 | | - aConstraints.gridx += 1; |
---|
1427 | | - aConstraints.weighty = 0; |
---|
1428 | | - aConstraints.gridwidth = 1; |
---|
1429 | 2286 | */ |
---|
1430 | 2287 | |
---|
1431 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1432 | | - aConstraints.gridx += 1; |
---|
| 2288 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2289 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 2290 | + |
---|
| 2291 | + if (Globals.ADVANCED) |
---|
| 2292 | + { |
---|
| 2293 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2294 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 2295 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 2296 | + } |
---|
1433 | 2297 | |
---|
1434 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1435 | | - |
---|
1436 | | - aConstraints.gridx += 1; |
---|
1437 | | - |
---|
1438 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1439 | | - |
---|
1440 | | - aConstraints.gridx += 1; |
---|
1441 | | - |
---|
1442 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1443 | | - |
---|
1444 | | - aConstraints.gridx = 0; |
---|
1445 | | - aConstraints.gridy += 1; |
---|
1446 | | - aConstraints.weighty = 0; |
---|
1447 | | - aConstraints.gridwidth = 1; |
---|
| 2298 | + editBar.preferredHeight = 15; |
---|
| 2299 | + |
---|
| 2300 | + panel.add(editBar); |
---|
| 2301 | + |
---|
1448 | 2302 | /**/ |
---|
1449 | 2303 | //aConstraints.weighty = 0; |
---|
1450 | 2304 | ////aConstraints.weightx = 1; |
---|
1451 | 2305 | //aConstraints.weighty = 1; |
---|
1452 | 2306 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1453 | 2307 | //aConstraints.gridx += 1; |
---|
1454 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1455 | | - aConstraints.weighty = 0; |
---|
1456 | | - aConstraints.gridx = 0; |
---|
1457 | | - aConstraints.gridy += 1; |
---|
1458 | | - aConstraints.gridwidth = 1; |
---|
| 2308 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1459 | 2309 | |
---|
1460 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1461 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1462 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1463 | | - aConstraints.gridx += 1; |
---|
1464 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1465 | | - //aConstraints.weightx = 0; |
---|
1466 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1467 | | - aConstraints.gridx = 0; |
---|
1468 | | - aConstraints.gridy += 1; |
---|
1469 | | - aConstraints.gridwidth = 1; |
---|
| 2310 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
1470 | 2311 | |
---|
1471 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1472 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1473 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1474 | | - aConstraints.gridx += 1; |
---|
1475 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1476 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1477 | | - aConstraints.gridx = 0; |
---|
1478 | | - aConstraints.gridy += 1; |
---|
1479 | | - aConstraints.gridwidth = 1; |
---|
| 2312 | + cGridBag huepanel = new cGridBag(); |
---|
| 2313 | + cGridBag huelabel = new cGridBag(); |
---|
| 2314 | + skin = GetLabel("icons/hue.png", false); |
---|
| 2315 | + skin.fit = true; |
---|
| 2316 | + huelabel.add(skin); |
---|
| 2317 | + huelabel.preferredWidth = 20; |
---|
| 2318 | + huepanel.add(new cGridBag()); // Label |
---|
| 2319 | + huepanel.add(huelabel); // Field/slider |
---|
| 2320 | + |
---|
| 2321 | + huepanel.preferredHeight = 7; |
---|
1480 | 2322 | |
---|
1481 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1482 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1483 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1484 | | - aConstraints.gridx += 1; |
---|
1485 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1486 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1487 | | - aConstraints.gridx = 0; |
---|
1488 | | - aConstraints.gridy += 1; |
---|
1489 | | - aConstraints.gridwidth = 1; |
---|
| 2323 | + colorSection.add(huepanel); |
---|
| 2324 | + |
---|
| 2325 | + cGridBag color = new cGridBag(); |
---|
| 2326 | + |
---|
| 2327 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2328 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2329 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1490 | 2330 | |
---|
1491 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1492 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1493 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1494 | | - aConstraints.gridx += 1; |
---|
1495 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1496 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1497 | | - aConstraints.gridx = 0; |
---|
1498 | | - aConstraints.gridy += 1; |
---|
1499 | | - aConstraints.gridwidth = 1; |
---|
| 2331 | + //colorField.preferredWidth = 200; |
---|
| 2332 | + colorSection.add(color); |
---|
1500 | 2333 | |
---|
1501 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1502 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1503 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1504 | | - aConstraints.gridx += 1; |
---|
1505 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1506 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1507 | | - aConstraints.gridx = 0; |
---|
1508 | | - aConstraints.gridy += 1; |
---|
1509 | | - aConstraints.gridwidth = 1; |
---|
| 2334 | + cGridBag modulation = new cGridBag(); |
---|
| 2335 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 2336 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2337 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2338 | + colorSection.add(modulation); |
---|
1510 | 2339 | |
---|
1511 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1512 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1513 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1514 | | - aConstraints.gridx += 1; |
---|
1515 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1516 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1517 | | - aConstraints.gridx = 0; |
---|
1518 | | - aConstraints.gridy += 1; |
---|
1519 | | - aConstraints.gridwidth = 1; |
---|
| 2340 | + cGridBag opacity = new cGridBag(); |
---|
| 2341 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2342 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2343 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2344 | + colorSection.add(opacity); |
---|
1520 | 2345 | |
---|
1521 | | - //aConstraints.weighty = 1; |
---|
1522 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1523 | | - //aConstraints.gridx += 1; |
---|
1524 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1525 | | - aConstraints.weighty = 0; |
---|
1526 | | - aConstraints.gridx = 0; |
---|
1527 | | - aConstraints.gridy += 1; |
---|
1528 | | - aConstraints.gridwidth = 1; |
---|
| 2346 | + colorSection.add(GetSeparator()); |
---|
| 2347 | + |
---|
| 2348 | + cGridBag texture = new cGridBag(); |
---|
| 2349 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 2350 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2351 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2352 | + colorSection.add(texture); |
---|
1529 | 2353 | |
---|
1530 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1531 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1532 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1533 | | - aConstraints.gridx += 1; |
---|
1534 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1535 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1536 | | - aConstraints.gridx = 0; |
---|
1537 | | - aConstraints.gridy += 1; |
---|
1538 | | - aConstraints.gridwidth = 1; |
---|
| 2354 | + panel.add(GetSeparator()); |
---|
| 2355 | + |
---|
| 2356 | + panel.add(colorSection); |
---|
| 2357 | + |
---|
| 2358 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2359 | + |
---|
| 2360 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 2361 | + |
---|
| 2362 | + cGridBag diffuse = new cGridBag(); |
---|
| 2363 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 2364 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2365 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2366 | + diffuseSection.add(diffuse); |
---|
1539 | 2367 | |
---|
1540 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1541 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1542 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1543 | | - aConstraints.gridx += 1; |
---|
1544 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1545 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1546 | | - aConstraints.gridx = 0; |
---|
1547 | | - aConstraints.gridy += 1; |
---|
1548 | | - aConstraints.gridwidth = 1; |
---|
| 2368 | + cGridBag diffuseness = new cGridBag(); |
---|
| 2369 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 2370 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2371 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2372 | + diffuseSection.add(diffuseness); |
---|
1549 | 2373 | |
---|
1550 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1551 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1552 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1553 | | - aConstraints.gridx += 1; |
---|
1554 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1555 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1556 | | - aConstraints.gridx = 0; |
---|
1557 | | - aConstraints.gridy += 1; |
---|
1558 | | - aConstraints.gridwidth = 1; |
---|
| 2374 | + cGridBag selfshadow = new cGridBag(); |
---|
| 2375 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 2376 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2377 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2378 | + diffuseSection.add(selfshadow); |
---|
1559 | 2379 | |
---|
1560 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1561 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1562 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1563 | | - aConstraints.gridx += 1; |
---|
1564 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1565 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1566 | | - aConstraints.gridx = 0; |
---|
1567 | | - aConstraints.gridy += 1; |
---|
1568 | | - aConstraints.gridwidth = 1; |
---|
| 2380 | + cGridBag sheen = new cGridBag(); |
---|
| 2381 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 2382 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2383 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2384 | + diffuseSection.add(sheen); |
---|
1569 | 2385 | |
---|
1570 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1571 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1572 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1573 | | - aConstraints.gridx += 1; |
---|
1574 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1575 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1576 | | - aConstraints.gridx = 0; |
---|
1577 | | - aConstraints.gridy += 1; |
---|
1578 | | - aConstraints.gridwidth = 1; |
---|
| 2386 | + cGridBag subsurface = new cGridBag(); |
---|
| 2387 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 2388 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2389 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2390 | + diffuseSection.add(subsurface); |
---|
1579 | 2391 | |
---|
1580 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1581 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1582 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1583 | | - aConstraints.gridx += 1; |
---|
1584 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1585 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1586 | | - aConstraints.gridx = 0; |
---|
1587 | | - aConstraints.gridy += 1; |
---|
1588 | | - aConstraints.gridwidth = 1; |
---|
| 2392 | + cGridBag shadow = new cGridBag(); |
---|
| 2393 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 2394 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2395 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2396 | + diffuseSection.add(shadow); |
---|
1589 | 2397 | |
---|
1590 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1591 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1592 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1593 | | - aConstraints.gridx += 1; |
---|
1594 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1595 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1596 | | - aConstraints.gridx = 0; |
---|
1597 | | - aConstraints.gridy += 1; |
---|
1598 | | - aConstraints.gridwidth = 1; |
---|
| 2398 | + cGridBag fakedepth = new cGridBag(); |
---|
| 2399 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 2400 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2401 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2402 | + diffuseSection.add(fakedepth); |
---|
1599 | 2403 | |
---|
1600 | | - //aConstraints.weighty = 1; |
---|
1601 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1602 | | - //aConstraints.gridx += 1; |
---|
1603 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1604 | | - aConstraints.weighty = 0; |
---|
1605 | | - aConstraints.gridx = 0; |
---|
1606 | | - aConstraints.gridy += 1; |
---|
1607 | | - aConstraints.gridwidth = 1; |
---|
| 2404 | + cGridBag shadowbias = new cGridBag(); |
---|
| 2405 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 2406 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2407 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2408 | + diffuseSection.add(shadowbias); |
---|
1608 | 2409 | |
---|
1609 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1610 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1611 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1612 | | - aConstraints.gridx += 1; |
---|
1613 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1614 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1615 | | - aConstraints.gridx = 0; |
---|
1616 | | - aConstraints.gridy += 1; |
---|
1617 | | - aConstraints.gridwidth = 1; |
---|
| 2410 | + panel.add(GetSeparator()); |
---|
| 2411 | + |
---|
| 2412 | + panel.add(diffuseSection); |
---|
| 2413 | + |
---|
| 2414 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2415 | + |
---|
| 2416 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1618 | 2417 | |
---|
1619 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1620 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1621 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1622 | | - aConstraints.gridx += 1; |
---|
1623 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1624 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1625 | | - aConstraints.gridx = 0; |
---|
1626 | | - aConstraints.gridy += 1; |
---|
1627 | | - aConstraints.gridwidth = 1; |
---|
| 2418 | + cGridBag specular = new cGridBag(); |
---|
| 2419 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 2420 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2421 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2422 | + specularSection.add(specular); |
---|
1628 | 2423 | |
---|
1629 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1630 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1631 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1632 | | - aConstraints.gridx += 1; |
---|
1633 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1634 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1635 | | - aConstraints.gridx = 0; |
---|
1636 | | - aConstraints.gridy += 1; |
---|
1637 | | - aConstraints.gridwidth = 1; |
---|
| 2424 | + cGridBag lightarea = new cGridBag(); |
---|
| 2425 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 2426 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2427 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2428 | + specularSection.add(lightarea); |
---|
1638 | 2429 | |
---|
1639 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1640 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1641 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1642 | | - aConstraints.gridx += 1; |
---|
1643 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1644 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1645 | | - aConstraints.gridx = 0; |
---|
1646 | | - aConstraints.gridy += 1; |
---|
1647 | | - aConstraints.gridwidth = 1; |
---|
| 2430 | + cGridBag shininess = new cGridBag(); |
---|
| 2431 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 2432 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2433 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2434 | + specularSection.add(shininess); |
---|
1648 | 2435 | |
---|
1649 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1650 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1651 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1652 | | - aConstraints.gridx += 1; |
---|
1653 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1654 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1655 | | - aConstraints.gridx = 0; |
---|
1656 | | - aConstraints.gridy += 1; |
---|
1657 | | - aConstraints.gridwidth = 1; |
---|
| 2436 | + cGridBag metalness = new cGridBag(); |
---|
| 2437 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 2438 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2439 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2440 | + specularSection.add(metalness); |
---|
1658 | 2441 | |
---|
1659 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1660 | | - Return(); |
---|
| 2442 | + cGridBag velvet = new cGridBag(); |
---|
| 2443 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 2444 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2445 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2446 | + specularSection.add(velvet); |
---|
| 2447 | + |
---|
| 2448 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 2449 | + //Return(); |
---|
1661 | 2450 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1662 | 2451 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1663 | 2452 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1668 | 2457 | // aConstraints.gridy += 1; |
---|
1669 | 2458 | // aConstraints.gridwidth = 1; |
---|
1670 | 2459 | |
---|
1671 | | - //aConstraints.weighty = 1; |
---|
1672 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1673 | | - //aConstraints.gridx += 1; |
---|
1674 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1675 | | - aConstraints.weighty = 0; |
---|
1676 | | - aConstraints.gridx = 0; |
---|
1677 | | - aConstraints.gridy += 1; |
---|
1678 | | - aConstraints.gridwidth = 1; |
---|
| 2460 | + cGridBag anisoU = new cGridBag(); |
---|
| 2461 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 2462 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2463 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2464 | + specularSection.add(anisoU); |
---|
1679 | 2465 | |
---|
1680 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1681 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1682 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1683 | | - aConstraints.gridx += 1; |
---|
1684 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1685 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1686 | | - aConstraints.gridx = 0; |
---|
1687 | | - aConstraints.gridy += 1; |
---|
1688 | | - aConstraints.gridwidth = 1; |
---|
| 2466 | + cGridBag anisoV = new cGridBag(); |
---|
| 2467 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 2468 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2469 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2470 | + specularSection.add(anisoV); |
---|
1689 | 2471 | |
---|
1690 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1691 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1692 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1693 | | - aConstraints.gridx += 1; |
---|
1694 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1695 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1696 | | - aConstraints.gridx = 0; |
---|
1697 | | - aConstraints.gridy += 1; |
---|
1698 | | - aConstraints.gridwidth = 1; |
---|
1699 | 2472 | |
---|
1700 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1701 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1702 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1703 | | - aConstraints.gridx += 1; |
---|
1704 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1705 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1706 | | - aConstraints.gridx = 0; |
---|
1707 | | - aConstraints.gridy += 1; |
---|
1708 | | - aConstraints.gridwidth = 1; |
---|
| 2473 | + panel.add(GetSeparator()); |
---|
| 2474 | + |
---|
| 2475 | + panel.add(specularSection); |
---|
| 2476 | + |
---|
| 2477 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2478 | + |
---|
| 2479 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1709 | 2480 | |
---|
1710 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1711 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1712 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1713 | | - aConstraints.gridx += 1; |
---|
1714 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1715 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1716 | | - aConstraints.gridx = 0; |
---|
1717 | | - aConstraints.gridy += 1; |
---|
1718 | | - aConstraints.gridwidth = 1; |
---|
1719 | | - aConstraints.weighty = 0; |
---|
| 2481 | + cGridBag camera = new cGridBag(); |
---|
| 2482 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 2483 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2484 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2485 | + colorSection.add(camera); |
---|
1720 | 2486 | |
---|
1721 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1722 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1723 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1724 | | - aConstraints.gridx += 1; |
---|
1725 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1726 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1727 | | - aConstraints.gridx = 0; |
---|
1728 | | - aConstraints.gridy += 1; |
---|
1729 | | - aConstraints.gridwidth = 1; |
---|
| 2487 | + cGridBag ambient = new cGridBag(); |
---|
| 2488 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 2489 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2490 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2491 | + colorSection.add(ambient); |
---|
1730 | 2492 | |
---|
1731 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1732 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1733 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1734 | | - aConstraints.gridx += 1; |
---|
1735 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1736 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1737 | | - aConstraints.gridx = 0; |
---|
1738 | | - aConstraints.gridy += 1; |
---|
1739 | | - aConstraints.gridwidth = 1; |
---|
| 2493 | + cGridBag backlit = new cGridBag(); |
---|
| 2494 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 2495 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2496 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2497 | + colorSection.add(backlit); |
---|
1740 | 2498 | |
---|
1741 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1742 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1743 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1744 | | - aConstraints.gridx += 1; |
---|
1745 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1746 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1747 | | - aConstraints.gridx = 0; |
---|
1748 | | - aConstraints.gridy += 1; |
---|
1749 | | - aConstraints.gridwidth = 1; |
---|
| 2499 | + //panel.add(new JSeparator()); |
---|
| 2500 | + |
---|
| 2501 | + //panel.add(globalSection); |
---|
| 2502 | + |
---|
| 2503 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2504 | + |
---|
| 2505 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1750 | 2506 | |
---|
1751 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1752 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1753 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1754 | | - aConstraints.gridx += 1; |
---|
1755 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1756 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1757 | | - aConstraints.gridx = 0; |
---|
1758 | | - aConstraints.gridy += 1; |
---|
1759 | | - aConstraints.gridwidth = 1; |
---|
| 2507 | + cGridBag bump = new cGridBag(); |
---|
| 2508 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 2509 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2510 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2511 | + textureSection.add(bump); |
---|
1760 | 2512 | |
---|
1761 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1762 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1763 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1764 | | - aConstraints.gridx += 1; |
---|
1765 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1766 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1767 | | - aConstraints.gridx = 0; |
---|
1768 | | - aConstraints.gridy += 1; |
---|
1769 | | - aConstraints.gridwidth = 1; |
---|
| 2513 | + cGridBag noise = new cGridBag(); |
---|
| 2514 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 2515 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2516 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 2517 | + textureSection.add(noise); |
---|
1770 | 2518 | |
---|
1771 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1772 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1773 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1774 | | - aConstraints.gridx += 1; |
---|
1775 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1776 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1777 | | - aConstraints.gridx = 0; |
---|
1778 | | - aConstraints.gridy += 1; |
---|
1779 | | - aConstraints.gridwidth = 1; |
---|
| 2519 | + cGridBag power = new cGridBag(); |
---|
| 2520 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 2521 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2522 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 2523 | + textureSection.add(power); |
---|
1780 | 2524 | |
---|
1781 | | - //aConstraints.weighty = 1; |
---|
1782 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1783 | | - //aConstraints.gridx += 1; |
---|
1784 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1785 | | - aConstraints.weighty = 0; |
---|
| 2525 | + cGridBag borderfade = new cGridBag(); |
---|
| 2526 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 2527 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2528 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2529 | + textureSection.add(borderfade); |
---|
1786 | 2530 | |
---|
1787 | | - aConstraints.gridx = 0; |
---|
1788 | | - aConstraints.gridy = 0; |
---|
1789 | | - aConstraints.gridwidth = 1; |
---|
| 2531 | + cGridBag fog = new cGridBag(); |
---|
| 2532 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 2533 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2534 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 2535 | + textureSection.add(fog); |
---|
| 2536 | + |
---|
| 2537 | + cGridBag opacityPower = new cGridBag(); |
---|
| 2538 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 2539 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2540 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 2541 | + textureSection.add(opacityPower); |
---|
| 2542 | + |
---|
| 2543 | + panel.add(GetSeparator()); |
---|
| 2544 | + |
---|
| 2545 | + panel.add(textureSection); |
---|
| 2546 | + |
---|
| 2547 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1790 | 2548 | |
---|
1791 | 2549 | SetMaterial(copy); // .GetMaterial()); |
---|
1792 | 2550 | |
---|
1793 | | - colorField.addChangeListener(this); |
---|
1794 | | - modulationField.addChangeListener(this); |
---|
| 2551 | + //colorField.addChangeListener(this); |
---|
| 2552 | +// modulationField.addChangeListener(this); |
---|
1795 | 2553 | metalnessField.addChangeListener(this); |
---|
1796 | 2554 | diffuseField.addChangeListener(this); |
---|
1797 | 2555 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1821 | 2579 | opacityPowerField.addChangeListener(this); |
---|
1822 | 2580 | /**/ |
---|
1823 | 2581 | |
---|
1824 | | - resetSlidersButton.addActionListener(this); |
---|
1825 | 2582 | clearMaterialButton.addActionListener(this); |
---|
1826 | 2583 | createMaterialButton.addActionListener(this); |
---|
1827 | | - |
---|
1828 | | - propagateToggle.addItemListener(this); |
---|
1829 | | - multiplyToggle.addItemListener(this); |
---|
| 2584 | + |
---|
| 2585 | + if (Globals.ADVANCED) |
---|
| 2586 | + { |
---|
| 2587 | + resetSlidersButton.addActionListener(this); |
---|
| 2588 | + propagateToggle.addItemListener(this); |
---|
| 2589 | + multiplyToggle.addItemListener(this); |
---|
| 2590 | + } |
---|
1830 | 2591 | } |
---|
1831 | 2592 | |
---|
1832 | 2593 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1844 | 2605 | // 3D models |
---|
1845 | 2606 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1846 | 2607 | { |
---|
1847 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1848 | | - LoadFile(filename, lastConverter); |
---|
| 2608 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2609 | + //LoadFile(filename, lastConverter); |
---|
| 2610 | + LoadObjFile(filename); // New 3ds loader |
---|
1849 | 2611 | continue; |
---|
1850 | 2612 | } |
---|
1851 | 2613 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
1997 | 2759 | |
---|
1998 | 2760 | //? flashIt = false; |
---|
1999 | 2761 | CameraPane pane = (CameraPane) cameraView; |
---|
2000 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2762 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
2001 | 2763 | pane.clickEnd(location.x, location.y, 0, true); |
---|
2002 | 2764 | |
---|
2003 | 2765 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2046 | 2808 | e2.printStackTrace(); |
---|
2047 | 2809 | } |
---|
2048 | 2810 | } |
---|
| 2811 | + |
---|
2049 | 2812 | LoadJMEThread loadThread; |
---|
2050 | 2813 | |
---|
2051 | 2814 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2103 | 2866 | //LoadFile0(filename, converter); |
---|
2104 | 2867 | } |
---|
2105 | 2868 | } |
---|
| 2869 | + |
---|
2106 | 2870 | LoadOBJThread loadObjThread; |
---|
2107 | 2871 | |
---|
2108 | 2872 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2181 | 2945 | |
---|
2182 | 2946 | void LoadObjFile(String fullname) |
---|
2183 | 2947 | { |
---|
2184 | | - /* |
---|
| 2948 | + System.out.println("Loading " + fullname); |
---|
| 2949 | + /**/ |
---|
2185 | 2950 | //lastFilename = fullname; |
---|
2186 | 2951 | if(loadObjThread == null) |
---|
2187 | 2952 | { |
---|
2188 | | - loadObjThread = new LoadOBJThread(); |
---|
2189 | | - loadObjThread.start(); |
---|
| 2953 | + loadObjThread = new LoadOBJThread(); |
---|
| 2954 | + loadObjThread.start(); |
---|
2190 | 2955 | } |
---|
2191 | 2956 | |
---|
2192 | 2957 | loadObjThread.add(fullname); |
---|
2193 | | - */ |
---|
| 2958 | + /**/ |
---|
2194 | 2959 | |
---|
2195 | | - System.out.println("Loading " + fullname); |
---|
2196 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2960 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2197 | 2961 | } |
---|
2198 | 2962 | |
---|
2199 | 2963 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2454 | 3218 | |
---|
2455 | 3219 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2456 | 3220 | { |
---|
2457 | | - if (GrafreeD.standAlone) |
---|
| 3221 | + if (Grafreed.standAlone) |
---|
2458 | 3222 | { |
---|
2459 | 3223 | /**/ |
---|
2460 | 3224 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2461 | | - browser.show(); |
---|
| 3225 | + browser.setVisible(true); |
---|
2462 | 3226 | String filename = browser.getFile(); |
---|
2463 | 3227 | if (filename != null && filename.length() > 0) |
---|
2464 | 3228 | { |
---|
.. | .. |
---|
2569 | 3333 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2570 | 3334 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2571 | 3335 | } |
---|
| 3336 | + |
---|
2572 | 3337 | //cJME.count++; |
---|
2573 | 3338 | //cJME.count %= 12; |
---|
2574 | 3339 | if (gc) |
---|
.. | .. |
---|
2603 | 3368 | } |
---|
2604 | 3369 | if (input == null) |
---|
2605 | 3370 | { |
---|
| 3371 | + new Exception().printStackTrace(); |
---|
2606 | 3372 | System.exit(0); |
---|
2607 | 3373 | } |
---|
2608 | 3374 | |
---|
.. | .. |
---|
2751 | 3517 | } |
---|
2752 | 3518 | } |
---|
2753 | 3519 | } |
---|
| 3520 | + |
---|
2754 | 3521 | cFileSystemPane FSPane; |
---|
2755 | 3522 | |
---|
2756 | 3523 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2760 | 3527 | |
---|
2761 | 3528 | freezematerial = true; |
---|
2762 | 3529 | colorField.setFloat(mat.color); |
---|
2763 | | - modulationField.setFloat(mat.modulation); |
---|
| 3530 | + saturationField.setFloat(mat.modulation); |
---|
2764 | 3531 | metalnessField.setFloat(mat.metalness); |
---|
2765 | 3532 | diffuseField.setFloat(mat.diffuse); |
---|
2766 | 3533 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
2804 | 3571 | } |
---|
2805 | 3572 | } |
---|
2806 | 3573 | } |
---|
| 3574 | + |
---|
2807 | 3575 | freezematerial = false; |
---|
2808 | 3576 | } |
---|
2809 | 3577 | |
---|
2810 | 3578 | void SetMaterial(Object3D object) |
---|
2811 | 3579 | { |
---|
| 3580 | + latestObject = object; |
---|
| 3581 | + |
---|
2812 | 3582 | cMaterial mat = object.material; |
---|
2813 | 3583 | |
---|
2814 | 3584 | if (mat == null) |
---|
.. | .. |
---|
2817 | 3587 | return; |
---|
2818 | 3588 | } |
---|
2819 | 3589 | |
---|
2820 | | - multiplyToggle.setSelected(mat.multiply); |
---|
2821 | | - |
---|
2822 | | - assert (object.projectedVertices != null); |
---|
2823 | | - |
---|
2824 | | - if (object.projectedVertices.length <= 2) |
---|
2825 | | - { |
---|
2826 | | - // Side effect... |
---|
2827 | | - Object3D.cVector2[] keep = object.projectedVertices; |
---|
2828 | | - object.projectedVertices = new Object3D.cVector2[3]; |
---|
2829 | | - for (int i = 0; i < 3; i++) |
---|
2830 | | - { |
---|
2831 | | - if (i < keep.length) |
---|
2832 | | - { |
---|
2833 | | - object.projectedVertices[i] = keep[i]; |
---|
2834 | | - } else |
---|
2835 | | - { |
---|
2836 | | - object.projectedVertices[i] = new Object3D.cVector2(); |
---|
2837 | | - } |
---|
2838 | | - /* |
---|
2839 | | - if(keep.length == 0) |
---|
2840 | | - object.projectedVertices[0] = new Object3D.cVector2(); |
---|
2841 | | - else |
---|
2842 | | - object.projectedVertices[0] = keep[0]; |
---|
2843 | | - object.projectedVertices[1] = new Object3D.cVector2(); |
---|
2844 | | - */ |
---|
2845 | | - } |
---|
2846 | | - } |
---|
| 3590 | + if (multiplyToggle != null) |
---|
| 3591 | + multiplyToggle.setSelected(mat.multiply); |
---|
| 3592 | + |
---|
| 3593 | + AllocProjectedVertices(object); |
---|
2847 | 3594 | |
---|
2848 | 3595 | SetMaterial(mat, object.projectedVertices); |
---|
2849 | 3596 | } |
---|
.. | .. |
---|
2919 | 3666 | // } |
---|
2920 | 3667 | |
---|
2921 | 3668 | /**/ |
---|
2922 | | - if (deselect) |
---|
| 3669 | + if (deselect || child == null) |
---|
2923 | 3670 | { |
---|
2924 | 3671 | //group.deselectAll(); |
---|
2925 | 3672 | //freeze = true; |
---|
2926 | 3673 | GetTree().clearSelection(); |
---|
2927 | 3674 | //freeze = false; |
---|
| 3675 | + |
---|
| 3676 | + if (child == null) |
---|
| 3677 | + { |
---|
| 3678 | + return; |
---|
| 3679 | + } |
---|
2928 | 3680 | } |
---|
2929 | 3681 | |
---|
2930 | 3682 | //group.addSelectee(child); |
---|
.. | .. |
---|
2958 | 3710 | public void itemStateChanged(ItemEvent event) |
---|
2959 | 3711 | { |
---|
2960 | 3712 | // System.out.println("Propagate = " + propagate); |
---|
| 3713 | + if (event.getSource() == pinButton) |
---|
| 3714 | + { |
---|
| 3715 | + copy.pinned ^= true; |
---|
| 3716 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3717 | + { |
---|
| 3718 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3719 | + copy.CloseUI(); |
---|
| 3720 | + //copy.editWindow.refreshContents(); |
---|
| 3721 | + } |
---|
| 3722 | + } |
---|
| 3723 | + else |
---|
2961 | 3724 | if (event.getSource() == propagateToggle) |
---|
2962 | 3725 | { |
---|
2963 | 3726 | propagate ^= true; |
---|
.. | .. |
---|
2993 | 3756 | cameraView.ToggleDL(); |
---|
2994 | 3757 | cameraView.repaint(); |
---|
2995 | 3758 | return; |
---|
2996 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3759 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2997 | 3760 | { |
---|
2998 | 3761 | cameraView.ToggleTexture(); |
---|
2999 | 3762 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
3032 | 3795 | frame.validate(); |
---|
3033 | 3796 | |
---|
3034 | 3797 | return; |
---|
3035 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3798 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
3036 | 3799 | { |
---|
3037 | | - cameraView.ToggleRandom(); |
---|
| 3800 | + cameraView.ToggleSwitch(); |
---|
3038 | 3801 | cameraView.repaint(); |
---|
3039 | 3802 | return; |
---|
3040 | 3803 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3062 | 3825 | } else if (event.getSource() == liveCB) |
---|
3063 | 3826 | { |
---|
3064 | 3827 | copy.live ^= true; |
---|
| 3828 | + objEditor.refreshContents(true); // To show item colors |
---|
| 3829 | + return; |
---|
| 3830 | + } else if (event.getSource() == selectableCB) |
---|
| 3831 | + { |
---|
| 3832 | + copy.dontselect ^= true; |
---|
3065 | 3833 | return; |
---|
3066 | 3834 | } else if (event.getSource() == hideCB) |
---|
3067 | 3835 | { |
---|
3068 | 3836 | copy.hide ^= true; |
---|
3069 | 3837 | copy.Touch(); // display list issue |
---|
3070 | | - objEditor.refreshContents(); |
---|
| 3838 | + objEditor.refreshContents(true); // To show item colors |
---|
3071 | 3839 | return; |
---|
3072 | 3840 | } else if (event.getSource() == link2masterCB) |
---|
3073 | 3841 | { |
---|
.. | .. |
---|
3077 | 3845 | if (event.getSource() == randomCB) |
---|
3078 | 3846 | { |
---|
3079 | 3847 | copy.random ^= true; |
---|
| 3848 | + objEditor.refreshContents(); |
---|
3080 | 3849 | return; |
---|
3081 | 3850 | } |
---|
3082 | 3851 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3100 | 3869 | |
---|
3101 | 3870 | public void actionPerformed(ActionEvent event) |
---|
3102 | 3871 | { |
---|
| 3872 | + Object source = event.getSource(); |
---|
3103 | 3873 | // SCRIPT DIALOG |
---|
3104 | | - if (event.getSource() == okbutton) |
---|
| 3874 | + if (source == okbutton) |
---|
3105 | 3875 | { |
---|
3106 | 3876 | textpanel.setVisible(false); |
---|
3107 | 3877 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3113 | 3883 | textarea = null; |
---|
3114 | 3884 | textpanel = null; |
---|
3115 | 3885 | } |
---|
3116 | | - if (event.getSource() == cancelbutton) |
---|
| 3886 | + if (source == cancelbutton) |
---|
3117 | 3887 | { |
---|
3118 | 3888 | textpanel.setVisible(false); |
---|
3119 | 3889 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3125 | 3895 | //applySelf(); |
---|
3126 | 3896 | //client.refreshEditWindow(); |
---|
3127 | 3897 | //refreshContents(); |
---|
3128 | | - if (event.getSource() == nameField) |
---|
| 3898 | + if (source == nameField) |
---|
3129 | 3899 | { |
---|
3130 | 3900 | //System.out.println("ObjEditor " + event); |
---|
3131 | 3901 | applySelf0(true); |
---|
3132 | 3902 | //parent.applySelf(); |
---|
3133 | 3903 | objEditor.refreshContents(); |
---|
3134 | | - } else if (event.getSource() == resetButton) |
---|
| 3904 | + } else if (source == resetButton) |
---|
3135 | 3905 | { |
---|
3136 | 3906 | CameraPane.fullreset = true; |
---|
3137 | 3907 | copy.Reset(); // ResetMeshes(); |
---|
3138 | 3908 | copy.Touch(); |
---|
3139 | 3909 | objEditor.refreshContents(); |
---|
3140 | | - } else if (event.getSource() == stepItem) |
---|
| 3910 | + } else if (source == stepItem) |
---|
3141 | 3911 | { |
---|
3142 | 3912 | //cameraView.ONESTEP = true; |
---|
3143 | 3913 | Globals.ONESTEP = true; |
---|
3144 | 3914 | cameraView.repaint(); |
---|
3145 | 3915 | return; |
---|
3146 | | - } else if (event.getSource() == stepButton) |
---|
| 3916 | + } else if (source == stepButton) |
---|
3147 | 3917 | { |
---|
3148 | 3918 | copy.Step(); |
---|
3149 | 3919 | copy.Touch(); |
---|
3150 | 3920 | objEditor.refreshContents(); |
---|
3151 | | - } else if (event.getSource() == slowerButton) |
---|
| 3921 | + } else if (source == slowerButton) |
---|
3152 | 3922 | { |
---|
3153 | 3923 | copy.Slower(); |
---|
3154 | 3924 | copy.Touch(); |
---|
3155 | 3925 | objEditor.refreshContents(); |
---|
3156 | | - } else if (event.getSource() == fasterButton) |
---|
| 3926 | + } else if (source == fasterButton) |
---|
3157 | 3927 | { |
---|
3158 | 3928 | copy.Faster(); |
---|
3159 | 3929 | copy.Touch(); |
---|
3160 | 3930 | objEditor.refreshContents(); |
---|
3161 | | - } else if (event.getSource() == remarkButton) |
---|
| 3931 | + } else if (source == remarkButton) |
---|
3162 | 3932 | { |
---|
3163 | 3933 | copy.Remark(); |
---|
3164 | 3934 | copy.Touch(); |
---|
3165 | 3935 | objEditor.refreshContents(); |
---|
3166 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3936 | + } else if (source == stepAllButton) |
---|
3167 | 3937 | { |
---|
3168 | 3938 | copy.StepAll(); |
---|
3169 | 3939 | copy.Touch(); |
---|
3170 | 3940 | objEditor.refreshContents(); |
---|
3171 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3941 | + } else if (source == resetAllButton) |
---|
3172 | 3942 | { |
---|
3173 | 3943 | //CameraPane.fullreset = true; |
---|
3174 | 3944 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3201 | 3971 | // Close(); |
---|
3202 | 3972 | // } |
---|
3203 | 3973 | // else |
---|
3204 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3974 | + if (source == resetSlidersButton) |
---|
3205 | 3975 | { |
---|
3206 | 3976 | ResetSliders(); |
---|
3207 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3977 | + } else if (source == clearMaterialButton) |
---|
3208 | 3978 | { |
---|
3209 | 3979 | ClearMaterial(); |
---|
3210 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3980 | + } else if (source == createMaterialButton) |
---|
3211 | 3981 | { |
---|
3212 | 3982 | CreateMaterial(); |
---|
3213 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3983 | + } else if (source == clearPanelButton) |
---|
3214 | 3984 | { |
---|
3215 | 3985 | copy.ClearUI(); |
---|
3216 | 3986 | refreshContents(true); |
---|
3217 | | - } /* |
---|
3218 | | - } |
---|
3219 | | - |
---|
3220 | | - public boolean action(Event event, Object arg) |
---|
3221 | | - { |
---|
3222 | | - */ else if (event.getSource() == closeItem) |
---|
| 3987 | + } else if (source == importGFDItem) |
---|
| 3988 | + { |
---|
| 3989 | + ImportGFD(); |
---|
| 3990 | + } else |
---|
| 3991 | + if (source == importVRMLX3DItem) |
---|
| 3992 | + { |
---|
| 3993 | + ImportVRMLX3D(); |
---|
| 3994 | + } else |
---|
| 3995 | + if (source == import3DSItem) |
---|
| 3996 | + { |
---|
| 3997 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3998 | + } else |
---|
| 3999 | + if (source == importOBJItem) |
---|
| 4000 | + { |
---|
| 4001 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 4002 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 4003 | + browser.setVisible(true); |
---|
| 4004 | + String filename = browser.getFile(); |
---|
| 4005 | + if (filename != null && filename.length() > 0) |
---|
| 4006 | + { |
---|
| 4007 | + String fullname = browser.getDirectory() + filename; |
---|
| 4008 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 4009 | + } |
---|
| 4010 | + } else |
---|
| 4011 | + if (source == closeItem) |
---|
3223 | 4012 | { |
---|
3224 | 4013 | Close(); |
---|
3225 | 4014 | //return true; |
---|
3226 | | - } else if (event.getSource() == loadItem) |
---|
| 4015 | + } else if (source == openItem) |
---|
3227 | 4016 | { |
---|
3228 | | - load(); |
---|
| 4017 | + Open(); |
---|
3229 | 4018 | //return true; |
---|
3230 | | - } else if (event.getSource() == saveItem) |
---|
| 4019 | + } else if (source == newItem) |
---|
| 4020 | + { |
---|
| 4021 | + New(); |
---|
| 4022 | + } else if (source == saveItem) |
---|
3231 | 4023 | { |
---|
3232 | 4024 | save(); |
---|
3233 | 4025 | //return true; |
---|
3234 | | - } else if (event.getSource() == saveAsItem) |
---|
| 4026 | + } else if (source == saveAsItem) |
---|
3235 | 4027 | { |
---|
3236 | 4028 | saveAs(); |
---|
3237 | 4029 | //return true; |
---|
3238 | | - } else if (event.getSource() == reexportItem) |
---|
| 4030 | + } else if (source == reexportItem) |
---|
3239 | 4031 | { |
---|
3240 | 4032 | reexport(); |
---|
3241 | 4033 | //return true; |
---|
3242 | | - } else if (event.getSource() == exportAsItem) |
---|
| 4034 | + } else if (source == exportAsItem) |
---|
3243 | 4035 | { |
---|
3244 | 4036 | export(); |
---|
3245 | 4037 | //return true; |
---|
3246 | | - } else if (event.getSource() == povItem) |
---|
| 4038 | + } else if (source == povItem) |
---|
3247 | 4039 | { |
---|
3248 | 4040 | generatePOV(); |
---|
3249 | 4041 | //return true; |
---|
3250 | | - } else if (event.getSource() == zBufferItem) |
---|
| 4042 | + } else if (event.getSource() == archiveItem) |
---|
| 4043 | + { |
---|
| 4044 | + cTools.Archive(frame); |
---|
| 4045 | + return; |
---|
| 4046 | + } else if (source == zBufferItem) |
---|
3251 | 4047 | { |
---|
3252 | 4048 | try |
---|
3253 | 4049 | { |
---|
.. | .. |
---|
3269 | 4065 | cameraView.repaint(); |
---|
3270 | 4066 | //return true; |
---|
3271 | 4067 | } |
---|
3272 | | - */ else if (event.getSource() == editCameraItem) |
---|
3273 | | - { |
---|
3274 | | - cameraView.ProtectCamera(); |
---|
3275 | | - cameraView.repaint(); |
---|
3276 | | - return; |
---|
3277 | | - } else if (event.getSource() == revertCameraItem) |
---|
3278 | | - { |
---|
3279 | | - cameraView.RevertCamera(); |
---|
3280 | | - cameraView.repaint(); |
---|
3281 | | - return; |
---|
3282 | | -// } else if (event.getSource() == textureButton) |
---|
3283 | | -// { |
---|
3284 | | -// return; // true; |
---|
3285 | | - } else // combos... |
---|
3286 | | - if (event.getSource() == texresMenu) |
---|
| 4068 | + */ else // combos... |
---|
| 4069 | + if (source == texresMenu) |
---|
3287 | 4070 | { |
---|
3288 | 4071 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3289 | 4072 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3295 | 4078 | } |
---|
3296 | 4079 | } |
---|
3297 | 4080 | |
---|
| 4081 | + void New() |
---|
| 4082 | + { |
---|
| 4083 | + while (copy.Size() > 1) |
---|
| 4084 | + { |
---|
| 4085 | + copy.remove(1); |
---|
| 4086 | + } |
---|
| 4087 | + |
---|
| 4088 | + ResetModel(); |
---|
| 4089 | + objEditor.refreshContents(); |
---|
| 4090 | + } |
---|
| 4091 | + |
---|
| 4092 | + static public byte[] Compress(Object3D o) |
---|
| 4093 | + { |
---|
| 4094 | + // Slower to actually compress. |
---|
| 4095 | + try |
---|
| 4096 | + { |
---|
| 4097 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4098 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 4099 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
| 4100 | + |
---|
| 4101 | + Object3D parent = o.parent; |
---|
| 4102 | + o.parent = null; |
---|
| 4103 | + |
---|
| 4104 | + out.writeObject(o); |
---|
| 4105 | + |
---|
| 4106 | + o.parent = parent; |
---|
| 4107 | + |
---|
| 4108 | + out.flush(); |
---|
| 4109 | + |
---|
| 4110 | + baos //zstream |
---|
| 4111 | + .close(); |
---|
| 4112 | + out.close(); |
---|
| 4113 | + |
---|
| 4114 | + byte[] bytes = baos.toByteArray(); |
---|
| 4115 | + |
---|
| 4116 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 4117 | + return bytes; |
---|
| 4118 | + } catch (Exception e) |
---|
| 4119 | + { |
---|
| 4120 | + System.err.println(e); |
---|
| 4121 | + return null; |
---|
| 4122 | + } |
---|
| 4123 | + } |
---|
| 4124 | + |
---|
| 4125 | + static public Object Uncompress(byte[] bytes) |
---|
| 4126 | + { |
---|
| 4127 | + System.out.println("restore #bytes = " + bytes.length); |
---|
| 4128 | + try |
---|
| 4129 | + { |
---|
| 4130 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4131 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 4132 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
| 4133 | + Object obj = in.readObject(); |
---|
| 4134 | + |
---|
| 4135 | + bais //istream |
---|
| 4136 | + .close(); |
---|
| 4137 | + in.close(); |
---|
| 4138 | + |
---|
| 4139 | + return obj; |
---|
| 4140 | + } catch (Exception e) |
---|
| 4141 | + { |
---|
| 4142 | + System.err.println(e); |
---|
| 4143 | + return null; |
---|
| 4144 | + } |
---|
| 4145 | + } |
---|
| 4146 | + |
---|
| 4147 | + static public Object clone(Object o) |
---|
| 4148 | + { |
---|
| 4149 | + try |
---|
| 4150 | + { |
---|
| 4151 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4152 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 4153 | + |
---|
| 4154 | + out.writeObject(o); |
---|
| 4155 | + |
---|
| 4156 | + out.flush(); |
---|
| 4157 | + out.close(); |
---|
| 4158 | + |
---|
| 4159 | + byte[] bytes = baos.toByteArray(); |
---|
| 4160 | + |
---|
| 4161 | + System.out.println("clone = " + bytes.length); |
---|
| 4162 | + |
---|
| 4163 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4164 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 4165 | + Object obj = in.readObject(); |
---|
| 4166 | + in.close(); |
---|
| 4167 | + |
---|
| 4168 | + return obj; |
---|
| 4169 | + } catch (Exception e) |
---|
| 4170 | + { |
---|
| 4171 | + System.err.println(e); |
---|
| 4172 | + return null; |
---|
| 4173 | + } |
---|
| 4174 | + } |
---|
| 4175 | + |
---|
| 4176 | + cRadio GetCurrentTab() |
---|
| 4177 | + { |
---|
| 4178 | + cRadio ab; |
---|
| 4179 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4180 | + { |
---|
| 4181 | + ab = (cRadio)e.nextElement(); |
---|
| 4182 | + if(ab.GetObject() == copy) |
---|
| 4183 | + { |
---|
| 4184 | + return ab; |
---|
| 4185 | + } |
---|
| 4186 | + } |
---|
| 4187 | + |
---|
| 4188 | + return null; |
---|
| 4189 | + } |
---|
| 4190 | + |
---|
| 4191 | + |
---|
| 4192 | + public void Save() |
---|
| 4193 | + { |
---|
| 4194 | + //Save(true); |
---|
| 4195 | + Replace(); |
---|
| 4196 | + SetVersionStates(); |
---|
| 4197 | + } |
---|
| 4198 | + |
---|
| 4199 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 4200 | + { |
---|
| 4201 | + if (compress.length != name.length) |
---|
| 4202 | + { |
---|
| 4203 | + return false; |
---|
| 4204 | + } |
---|
| 4205 | + |
---|
| 4206 | + for (int i=compress.length; --i>=0;) |
---|
| 4207 | + { |
---|
| 4208 | + if (compress[i] != name[i]) |
---|
| 4209 | + return false; |
---|
| 4210 | + } |
---|
| 4211 | + |
---|
| 4212 | + return true; |
---|
| 4213 | + } |
---|
| 4214 | + |
---|
| 4215 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 4216 | + |
---|
| 4217 | + void DeleteVersion() |
---|
| 4218 | + { |
---|
| 4219 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4220 | + { |
---|
| 4221 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4222 | + } |
---|
| 4223 | + |
---|
| 4224 | + CopyChanged(); |
---|
| 4225 | + |
---|
| 4226 | + SetVersionStates(); |
---|
| 4227 | + } |
---|
| 4228 | + |
---|
| 4229 | + public boolean Save(boolean user) |
---|
| 4230 | + { |
---|
| 4231 | + System.err.println("Save"); |
---|
| 4232 | + Replace(); |
---|
| 4233 | + |
---|
| 4234 | + //cRadio tab = GetCurrentTab(); |
---|
| 4235 | + |
---|
| 4236 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
| 4237 | + |
---|
| 4238 | + boolean thesame = false; |
---|
| 4239 | + |
---|
| 4240 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4241 | +// { |
---|
| 4242 | +// thesame = true; |
---|
| 4243 | +// } |
---|
| 4244 | + |
---|
| 4245 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 4246 | + if (!thesame) |
---|
| 4247 | + { |
---|
| 4248 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4249 | + { |
---|
| 4250 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4251 | + } |
---|
| 4252 | + |
---|
| 4253 | + //tab.user[tab.versionindex] = user; |
---|
| 4254 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 4255 | + |
---|
| 4256 | + copy.versionlist[++copy.versionindex] = compress; |
---|
| 4257 | + |
---|
| 4258 | + // if (increment) |
---|
| 4259 | + // tab.versionindex++; |
---|
| 4260 | + } |
---|
| 4261 | + |
---|
| 4262 | + //copy.RestoreBigData(versiontable); |
---|
| 4263 | + |
---|
| 4264 | + //assert(hashtable.isEmpty()); |
---|
| 4265 | + |
---|
| 4266 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4267 | +// { |
---|
| 4268 | +// //tab.user[i] = false; |
---|
| 4269 | +// copy.versionlist[i] = null; |
---|
| 4270 | +// } |
---|
| 4271 | + |
---|
| 4272 | + SetVersionStates(); |
---|
| 4273 | + |
---|
| 4274 | + // test save |
---|
| 4275 | + if (false) |
---|
| 4276 | + { |
---|
| 4277 | + try |
---|
| 4278 | + { |
---|
| 4279 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
| 4280 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4281 | + |
---|
| 4282 | + p.writeObject(copy); |
---|
| 4283 | + |
---|
| 4284 | + p.flush(); |
---|
| 4285 | + |
---|
| 4286 | + ostream.close(); |
---|
| 4287 | + } catch (Exception e) |
---|
| 4288 | + { |
---|
| 4289 | + e.printStackTrace(); |
---|
| 4290 | + } |
---|
| 4291 | + } |
---|
| 4292 | + |
---|
| 4293 | + return !thesame; |
---|
| 4294 | + } |
---|
| 4295 | + |
---|
| 4296 | + boolean flashIt = true; |
---|
| 4297 | + |
---|
| 4298 | + void RefreshSelection() |
---|
| 4299 | + { |
---|
| 4300 | + Object3D selection = new Object3D(); |
---|
| 4301 | + |
---|
| 4302 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4303 | + { |
---|
| 4304 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4305 | + |
---|
| 4306 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4307 | + |
---|
| 4308 | + if (obj == null) |
---|
| 4309 | + { |
---|
| 4310 | + copy.selection.remove(i--); |
---|
| 4311 | + } |
---|
| 4312 | + else |
---|
| 4313 | + { |
---|
| 4314 | + selection.add(obj); |
---|
| 4315 | + copy.selection.setElementAt(obj, i); |
---|
| 4316 | + } |
---|
| 4317 | + } |
---|
| 4318 | + |
---|
| 4319 | + flashIt = false; |
---|
| 4320 | + GetTree().clearSelection(); |
---|
| 4321 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4322 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4323 | + flashIt = true; |
---|
| 4324 | + |
---|
| 4325 | + //refreshContents(false); |
---|
| 4326 | + } |
---|
| 4327 | + |
---|
| 4328 | + void CopyChanged() |
---|
| 4329 | + { |
---|
| 4330 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4331 | + |
---|
| 4332 | + SetVersionStates(); |
---|
| 4333 | + |
---|
| 4334 | + boolean temp = CameraPane.SWITCH; |
---|
| 4335 | + CameraPane.SWITCH = false; |
---|
| 4336 | + |
---|
| 4337 | + copy.ExtractBigData(versiontable); |
---|
| 4338 | + |
---|
| 4339 | + copy.clear(); |
---|
| 4340 | + |
---|
| 4341 | + copy.skyboxname = obj.skyboxname; |
---|
| 4342 | + copy.skyboxext = obj.skyboxext; |
---|
| 4343 | + |
---|
| 4344 | + for (int i=0; i<obj.Size(); i++) |
---|
| 4345 | + { |
---|
| 4346 | + copy.add(obj.get(i)); |
---|
| 4347 | + } |
---|
| 4348 | + |
---|
| 4349 | + copy.RestoreBigData(versiontable); |
---|
| 4350 | + |
---|
| 4351 | + CameraPane.SWITCH = temp; |
---|
| 4352 | + |
---|
| 4353 | + RefreshSelection(); |
---|
| 4354 | + //assert(hashtable.isEmpty()); |
---|
| 4355 | + |
---|
| 4356 | + copy.Touch(); |
---|
| 4357 | + |
---|
| 4358 | + ResetModel(); |
---|
| 4359 | + copy.HardTouch(); // recompile? |
---|
| 4360 | + |
---|
| 4361 | + cRadio ab; |
---|
| 4362 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4363 | + { |
---|
| 4364 | + ab = (cRadio)e.nextElement(); |
---|
| 4365 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 4366 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 4367 | + if (test != null) |
---|
| 4368 | + { |
---|
| 4369 | + test.editWindow = ab.object.editWindow; |
---|
| 4370 | + ab.object = test; |
---|
| 4371 | + } |
---|
| 4372 | + } |
---|
| 4373 | + |
---|
| 4374 | + refreshContents(true); |
---|
| 4375 | + } |
---|
| 4376 | + |
---|
| 4377 | + cButton previousVersionButton; |
---|
| 4378 | + cButton restoreButton; |
---|
| 4379 | + cButton replaceButton; |
---|
| 4380 | + cButton nextVersionButton; |
---|
| 4381 | + cButton saveVersionButton; |
---|
| 4382 | + cButton deleteVersionButton; |
---|
| 4383 | + |
---|
| 4384 | + boolean muteSlider; |
---|
| 4385 | + |
---|
| 4386 | + int VersionCount() |
---|
| 4387 | + { |
---|
| 4388 | + int count = 0; |
---|
| 4389 | + |
---|
| 4390 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 4391 | + { |
---|
| 4392 | + if (copy.versionlist[i] != null) |
---|
| 4393 | + count++; |
---|
| 4394 | + } |
---|
| 4395 | + |
---|
| 4396 | + return count; |
---|
| 4397 | + } |
---|
| 4398 | + |
---|
| 4399 | + void SetVersionStates() |
---|
| 4400 | + { |
---|
| 4401 | + //if (true) |
---|
| 4402 | + // return; |
---|
| 4403 | + |
---|
| 4404 | + //cRadio tab = GetCurrentTab(); |
---|
| 4405 | + |
---|
| 4406 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4407 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4408 | + |
---|
| 4409 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4410 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4411 | + |
---|
| 4412 | + deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
| 4413 | + copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4414 | + |
---|
| 4415 | + muteSlider = true; |
---|
| 4416 | + versionSlider.setMinimum(0); |
---|
| 4417 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4418 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4419 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
| 4420 | + muteSlider = false; |
---|
| 4421 | + } |
---|
| 4422 | + |
---|
| 4423 | + public boolean PreviousVersion() |
---|
| 4424 | + { |
---|
| 4425 | + // Option? |
---|
| 4426 | + Replace(); |
---|
| 4427 | + |
---|
| 4428 | + System.err.println("Undo"); |
---|
| 4429 | + |
---|
| 4430 | + //cRadio tab = GetCurrentTab(); |
---|
| 4431 | + |
---|
| 4432 | + if (copy.versionindex == 0) |
---|
| 4433 | + { |
---|
| 4434 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4435 | + return false; |
---|
| 4436 | + } |
---|
| 4437 | + |
---|
| 4438 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 4439 | +// { |
---|
| 4440 | +// if (Save(false)) |
---|
| 4441 | +// tab.versionindex -= 1; |
---|
| 4442 | +// else |
---|
| 4443 | +// { |
---|
| 4444 | +// if (tab.versionindex <= 0) |
---|
| 4445 | +// return false; |
---|
| 4446 | +// else |
---|
| 4447 | +// tab.versionindex -= 1; |
---|
| 4448 | +// } |
---|
| 4449 | +// } |
---|
| 4450 | + |
---|
| 4451 | + copy.versionindex -= 1; |
---|
| 4452 | + |
---|
| 4453 | + CopyChanged(); |
---|
| 4454 | + |
---|
| 4455 | + return true; |
---|
| 4456 | + } |
---|
| 4457 | + |
---|
| 4458 | + public boolean Restore() |
---|
| 4459 | + { |
---|
| 4460 | + System.err.println("Restore"); |
---|
| 4461 | + |
---|
| 4462 | + //cRadio tab = GetCurrentTab(); |
---|
| 4463 | + |
---|
| 4464 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4465 | + { |
---|
| 4466 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4467 | + return false; |
---|
| 4468 | + } |
---|
| 4469 | + |
---|
| 4470 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4471 | + CopyChanged(); |
---|
| 4472 | + |
---|
| 4473 | + return true; |
---|
| 4474 | + } |
---|
| 4475 | + |
---|
| 4476 | + public boolean Replace() |
---|
| 4477 | + { |
---|
| 4478 | + System.err.println("Replace"); |
---|
| 4479 | + |
---|
| 4480 | + //cRadio tab = GetCurrentTab(); |
---|
| 4481 | + |
---|
| 4482 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4483 | + { |
---|
| 4484 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4485 | + return false; |
---|
| 4486 | + } |
---|
| 4487 | + |
---|
| 4488 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
| 4489 | + |
---|
| 4490 | + return true; |
---|
| 4491 | + } |
---|
| 4492 | + |
---|
| 4493 | + public void NextVersion() |
---|
| 4494 | + { |
---|
| 4495 | + // Option? |
---|
| 4496 | + Replace(); |
---|
| 4497 | + |
---|
| 4498 | + //cRadio tab = GetCurrentTab(); |
---|
| 4499 | + |
---|
| 4500 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
| 4501 | + { |
---|
| 4502 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4503 | + return; |
---|
| 4504 | + } |
---|
| 4505 | + |
---|
| 4506 | + copy.versionindex += 1; |
---|
| 4507 | + |
---|
| 4508 | + CopyChanged(); |
---|
| 4509 | + |
---|
| 4510 | + //if (!tab.user[tab.versionindex]) |
---|
| 4511 | + // tab.graphs[tab.versionindex] = null; |
---|
| 4512 | + } |
---|
| 4513 | + |
---|
| 4514 | + void ImportGFD() |
---|
| 4515 | + { |
---|
| 4516 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
| 4517 | + browser.show(); |
---|
| 4518 | + String filename = browser.getFile(); |
---|
| 4519 | + if (filename != null && filename.length() > 0) |
---|
| 4520 | + { |
---|
| 4521 | + String fullname = browser.getDirectory() + filename; |
---|
| 4522 | + |
---|
| 4523 | + //Object3D readobj = |
---|
| 4524 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 4525 | + //makeSomething(readobj); |
---|
| 4526 | + } |
---|
| 4527 | + } |
---|
| 4528 | + |
---|
| 4529 | + void ImportVRMLX3D() |
---|
| 4530 | + { |
---|
| 4531 | + if (Grafreed.standAlone) |
---|
| 4532 | + { |
---|
| 4533 | + /**/ |
---|
| 4534 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 4535 | + browser.show(); |
---|
| 4536 | + String filename = browser.getFile(); |
---|
| 4537 | + if (filename != null && filename.length() > 0) |
---|
| 4538 | + { |
---|
| 4539 | + String fullname = browser.getDirectory() + filename; |
---|
| 4540 | + LoadVRMLX3D(fullname); |
---|
| 4541 | + } |
---|
| 4542 | + /**/ |
---|
| 4543 | + } |
---|
| 4544 | + } |
---|
| 4545 | + |
---|
3298 | 4546 | void ToggleAnimation() |
---|
3299 | 4547 | { |
---|
3300 | 4548 | if (!Globals.ANIMATION) |
---|
3301 | 4549 | { |
---|
3302 | 4550 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3303 | | - browser.show(); |
---|
| 4551 | + browser.setVisible(true); |
---|
3304 | 4552 | String filename = browser.getFile(); |
---|
3305 | 4553 | if (filename != null && filename.length() > 0) |
---|
3306 | 4554 | { |
---|
.. | .. |
---|
3310 | 4558 | |
---|
3311 | 4559 | Globals.ANIMATION ^= true; |
---|
3312 | 4560 | |
---|
3313 | | - GrafreeD.wav.cursor = 0; |
---|
3314 | | - GrafreeD.wav.loop = 0; |
---|
| 4561 | + Grafreed.wav.cursor = 0; |
---|
| 4562 | + Grafreed.wav.loop = 0; |
---|
3315 | 4563 | } |
---|
3316 | 4564 | } else |
---|
3317 | 4565 | { |
---|
.. | .. |
---|
3361 | 4609 | void CreateMaterial() |
---|
3362 | 4610 | { |
---|
3363 | 4611 | //copy.ClearMaterial(); // PATCH |
---|
3364 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 4612 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3365 | 4613 | if (copy.selection.size() > 0) |
---|
3366 | 4614 | //SetMaterial(copy); |
---|
3367 | 4615 | { |
---|
.. | .. |
---|
3412 | 4660 | assert false; |
---|
3413 | 4661 | } |
---|
3414 | 4662 | |
---|
3415 | | - void EditSelection() |
---|
| 4663 | + void EditSelection(boolean newWindow) |
---|
3416 | 4664 | { |
---|
3417 | 4665 | } |
---|
3418 | 4666 | |
---|
.. | .. |
---|
3420 | 4668 | { |
---|
3421 | 4669 | copy.ResetBlockLoop(); // temporary problem |
---|
3422 | 4670 | |
---|
3423 | | - boolean random = CameraPane.RANDOM; |
---|
3424 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 4671 | + boolean random = CameraPane.SWITCH; |
---|
| 4672 | + CameraPane.SWITCH = false; // parse everything |
---|
3425 | 4673 | copy.ResetDisplayList(); |
---|
3426 | 4674 | copy.HardTouch(); |
---|
3427 | | - CameraPane.RANDOM = random; |
---|
| 4675 | + CameraPane.SWITCH = random; |
---|
3428 | 4676 | } |
---|
3429 | 4677 | |
---|
3430 | 4678 | // public void applySelf() |
---|
.. | .. |
---|
3471 | 4719 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
3472 | 4720 | |
---|
3473 | 4721 | current.color = (float) colorField.getFloat(); |
---|
3474 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4722 | + current.modulation = (float) saturationField.getFloat(); |
---|
3475 | 4723 | current.metalness = (float) metalnessField.getFloat(); |
---|
3476 | 4724 | current.diffuse = (float) diffuseField.getFloat(); |
---|
3477 | 4725 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
3494 | 4742 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3495 | 4743 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3496 | 4744 | |
---|
3497 | | - if (!NumberSlider.frozen) |
---|
| 4745 | + if (!cNumberSlider.frozen) |
---|
3498 | 4746 | { |
---|
3499 | 4747 | //System.out.println("Propagate = " + propagate); |
---|
3500 | 4748 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 4749 | + |
---|
| 4750 | + if (copy.material != null) |
---|
| 4751 | + { |
---|
| 4752 | + cMaterial mat = copy.material; |
---|
| 4753 | + |
---|
| 4754 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4755 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4756 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4757 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4758 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4759 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4760 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4761 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4762 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4763 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4764 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4765 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4766 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4767 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4768 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4769 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4770 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4771 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4772 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4773 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4774 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4775 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4776 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4777 | + } |
---|
| 4778 | + |
---|
3501 | 4779 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3502 | 4780 | { |
---|
3503 | 4781 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3526 | 4804 | //copy.Touch(); |
---|
3527 | 4805 | } |
---|
3528 | 4806 | |
---|
| 4807 | + cNumberSlider versionSlider; |
---|
| 4808 | + |
---|
3529 | 4809 | public void stateChanged(ChangeEvent e) |
---|
3530 | 4810 | { |
---|
3531 | 4811 | // assert(false); |
---|
| 4812 | + if (e.getSource() == versionSlider) |
---|
| 4813 | + { |
---|
| 4814 | + if (muteSlider) |
---|
| 4815 | + return; |
---|
| 4816 | + |
---|
| 4817 | + Replace(); |
---|
| 4818 | + |
---|
| 4819 | + int version = versionSlider.getInteger(); |
---|
| 4820 | + |
---|
| 4821 | + if (version != -1 && copy.versionlist[version] != null) |
---|
| 4822 | + { |
---|
| 4823 | + copy.versionindex = version; |
---|
| 4824 | + CopyChanged(); |
---|
| 4825 | + } |
---|
| 4826 | + |
---|
| 4827 | + return; |
---|
| 4828 | + } |
---|
3532 | 4829 | |
---|
3533 | 4830 | if (freezematerial) |
---|
3534 | 4831 | { |
---|
.. | .. |
---|
3542 | 4839 | || e.getSource() == apertureField |
---|
3543 | 4840 | || e.getSource() == shadowblurField) |
---|
3544 | 4841 | { |
---|
| 4842 | + new Exception().printStackTrace(); |
---|
3545 | 4843 | System.exit(0); |
---|
3546 | 4844 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3547 | 4845 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3563 | 4861 | { |
---|
3564 | 4862 | //System.out.println("stateChanged = " + this); |
---|
3565 | 4863 | materialtouched = true; |
---|
| 4864 | + |
---|
| 4865 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4866 | + { |
---|
| 4867 | + saturationField.setFloat(1); |
---|
| 4868 | + } |
---|
| 4869 | + |
---|
3566 | 4870 | applySelf(); |
---|
3567 | 4871 | //System.out.println("this = " + this); |
---|
3568 | 4872 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
3612 | 4916 | } |
---|
3613 | 4917 | |
---|
3614 | 4918 | if (normalpushField != null) |
---|
3615 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 4919 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3616 | 4920 | } |
---|
3617 | 4921 | |
---|
3618 | 4922 | void SnapObject() |
---|
.. | .. |
---|
3862 | 5166 | { |
---|
3863 | 5167 | if (GetTree() != null) |
---|
3864 | 5168 | { |
---|
| 5169 | + GetTree().revalidate(); |
---|
3865 | 5170 | GetTree().repaint(); |
---|
3866 | 5171 | } |
---|
3867 | 5172 | |
---|
3868 | 5173 | radioPanel.revalidate(); |
---|
3869 | 5174 | radioPanel.repaint(); |
---|
3870 | | - ctrlPanel.revalidate(); // ? new |
---|
| 5175 | + ctrlPanel.validate(); // ? new |
---|
3871 | 5176 | ctrlPanel.repaint(); |
---|
3872 | 5177 | } |
---|
| 5178 | + |
---|
| 5179 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5180 | + SetVersionStates(); |
---|
3873 | 5181 | } |
---|
3874 | 5182 | |
---|
3875 | 5183 | static TweenManager tweenManager = new TweenManager(); |
---|
3876 | 5184 | |
---|
3877 | 5185 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3878 | 5186 | { |
---|
| 5187 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
| 5188 | + Save(); |
---|
3879 | 5189 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3880 | 5190 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3881 | 5191 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3962 | 5272 | { |
---|
3963 | 5273 | ResetModel(); |
---|
3964 | 5274 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 5275 | + |
---|
| 5276 | + if (thing.Size() == 0) |
---|
| 5277 | + { |
---|
| 5278 | + //EditSelection(false); |
---|
| 5279 | + } |
---|
| 5280 | + |
---|
3965 | 5281 | refreshContents(); |
---|
3966 | 5282 | } |
---|
3967 | 5283 | |
---|
.. | .. |
---|
4079 | 5395 | } |
---|
4080 | 5396 | } |
---|
4081 | 5397 | } |
---|
| 5398 | + |
---|
4082 | 5399 | LoadGFDThread loadGFDThread; |
---|
4083 | 5400 | |
---|
4084 | 5401 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4098 | 5415 | |
---|
4099 | 5416 | try |
---|
4100 | 5417 | { |
---|
| 5418 | + // Try compressed version first. |
---|
4101 | 5419 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4102 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5420 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 5421 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4103 | 5422 | |
---|
4104 | 5423 | readobj = (Object3D) p.readObject(); |
---|
4105 | 5424 | istream.close(); |
---|
.. | .. |
---|
4107 | 5426 | readobj.ResetDisplayList(); |
---|
4108 | 5427 | } catch (Exception e) |
---|
4109 | 5428 | { |
---|
4110 | | - e.printStackTrace(); |
---|
| 5429 | + if (!e.toString().contains("GZIP")) |
---|
| 5430 | + e.printStackTrace(); |
---|
| 5431 | + |
---|
| 5432 | + try |
---|
| 5433 | + { |
---|
| 5434 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 5435 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5436 | + |
---|
| 5437 | + readobj = (Object3D) p.readObject(); |
---|
| 5438 | + istream.close(); |
---|
| 5439 | + |
---|
| 5440 | + readobj.ResetDisplayList(); |
---|
| 5441 | + } catch (Exception e2) |
---|
| 5442 | + { |
---|
| 5443 | + e2.printStackTrace(); |
---|
| 5444 | + } |
---|
4111 | 5445 | } |
---|
4112 | 5446 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4113 | 5447 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4153 | 5487 | |
---|
4154 | 5488 | void LoadIt(Object obj) |
---|
4155 | 5489 | { |
---|
| 5490 | + if (obj == null) |
---|
| 5491 | + { |
---|
| 5492 | + // Invalid file |
---|
| 5493 | + return; |
---|
| 5494 | + } |
---|
| 5495 | + |
---|
4156 | 5496 | System.out.println("Loaded " + obj); |
---|
4157 | 5497 | //new Exception().printStackTrace(); |
---|
4158 | 5498 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4162 | 5502 | |
---|
4163 | 5503 | if (readobj != null) |
---|
4164 | 5504 | { |
---|
| 5505 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 5506 | + // Save(); |
---|
4165 | 5507 | try |
---|
4166 | 5508 | { |
---|
4167 | 5509 | //readobj.deepCopySelf(copy); |
---|
4168 | 5510 | copy.clear(); // june 2014 |
---|
| 5511 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5512 | + copy.skyboxext = readobj.skyboxext; |
---|
4169 | 5513 | for (int i = 0; i < readobj.size(); i++) |
---|
4170 | 5514 | { |
---|
4171 | 5515 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4206 | 5550 | } |
---|
4207 | 5551 | } catch (ClassCastException e) |
---|
4208 | 5552 | { |
---|
| 5553 | + e.printStackTrace(); |
---|
4209 | 5554 | assert (false); |
---|
4210 | 5555 | Composite c = (Composite) copy; |
---|
4211 | 5556 | c.children.clear(); |
---|
.. | .. |
---|
4216 | 5561 | c.addChild(csg); |
---|
4217 | 5562 | } |
---|
4218 | 5563 | |
---|
| 5564 | + copy.versionlist = readobj.versionlist; |
---|
| 5565 | + copy.versionindex = readobj.versionindex; |
---|
| 5566 | + |
---|
| 5567 | + if (copy.versionlist == null) |
---|
| 5568 | + { |
---|
| 5569 | + // Backward compatibility |
---|
| 5570 | + copy.versionlist = new Object3D[100]; |
---|
| 5571 | + copy.versionindex = -1; |
---|
| 5572 | + |
---|
| 5573 | + //Save(true); |
---|
| 5574 | + } |
---|
| 5575 | + |
---|
| 5576 | + //? SetUndoStates(); |
---|
| 5577 | + |
---|
4219 | 5578 | ResetModel(); |
---|
4220 | 5579 | copy.HardTouch(); // recompile? |
---|
4221 | 5580 | refreshContents(); |
---|
4222 | 5581 | } |
---|
4223 | 5582 | } |
---|
4224 | 5583 | |
---|
4225 | | - void load() // throws ClassNotFoundException |
---|
| 5584 | + void Open() // throws ClassNotFoundException |
---|
4226 | 5585 | { |
---|
4227 | | - if (GrafreeD.standAlone) |
---|
| 5586 | + if (Grafreed.standAlone) |
---|
4228 | 5587 | { |
---|
4229 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5588 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4230 | 5589 | browser.show(); |
---|
4231 | 5590 | String filename = browser.getFile(); |
---|
4232 | 5591 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4303 | 5662 | |
---|
4304 | 5663 | void save() |
---|
4305 | 5664 | { |
---|
| 5665 | + Replace(); |
---|
| 5666 | + |
---|
4306 | 5667 | if (lastname == null) |
---|
4307 | 5668 | { |
---|
4308 | 5669 | return; |
---|
.. | .. |
---|
4311 | 5672 | try |
---|
4312 | 5673 | { |
---|
4313 | 5674 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4314 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 5675 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5676 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4315 | 5677 | |
---|
4316 | 5678 | p.writeObject(copy); |
---|
4317 | 5679 | p.flush(); |
---|
4318 | 5680 | |
---|
| 5681 | + zstream.close(); |
---|
4319 | 5682 | ostream.close(); |
---|
4320 | 5683 | |
---|
4321 | 5684 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4323 | 5686 | //ps.print(buffer.toString()); |
---|
4324 | 5687 | } catch (IOException e) |
---|
4325 | 5688 | { |
---|
| 5689 | + e.printStackTrace(); |
---|
4326 | 5690 | } |
---|
4327 | 5691 | } |
---|
| 5692 | + |
---|
4328 | 5693 | String lastname; |
---|
4329 | 5694 | |
---|
4330 | 5695 | void saveAs() |
---|
4331 | 5696 | { |
---|
4332 | | - if (GrafreeD.standAlone) |
---|
| 5697 | + if (Grafreed.standAlone) |
---|
4333 | 5698 | { |
---|
4334 | 5699 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4335 | 5700 | browser.setVisible(true); |
---|
4336 | 5701 | String filename = browser.getFile(); |
---|
4337 | 5702 | if (filename != null && filename.length() > 0) |
---|
4338 | 5703 | { |
---|
| 5704 | + if (!filename.endsWith(".gfd")) |
---|
| 5705 | + filename += ".gfd"; |
---|
4339 | 5706 | lastname = browser.getDirectory() + filename; |
---|
4340 | 5707 | save(); |
---|
4341 | 5708 | } |
---|
.. | .. |
---|
4434 | 5801 | try |
---|
4435 | 5802 | { |
---|
4436 | 5803 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4437 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4438 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 5804 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5805 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4439 | 5806 | |
---|
4440 | 5807 | Object3D objectparent = obj.parent; |
---|
4441 | 5808 | obj.parent = null; |
---|
4442 | 5809 | |
---|
4443 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 5810 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4444 | 5811 | |
---|
4445 | 5812 | obj.parent = objectparent; |
---|
4446 | 5813 | |
---|
.. | .. |
---|
4452 | 5819 | p.writeObject(object); |
---|
4453 | 5820 | p.flush(); |
---|
4454 | 5821 | |
---|
| 5822 | + zstream.close(); |
---|
4455 | 5823 | ostream.close(); |
---|
4456 | | - // zstream.close(); |
---|
4457 | 5824 | |
---|
4458 | 5825 | // group.selection.get(0).parent = parent; |
---|
4459 | 5826 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4474 | 5841 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4475 | 5842 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4476 | 5843 | copy.generatePOV(buffer); |
---|
4477 | | - if (GrafreeD.standAlone) |
---|
| 5844 | + if (Grafreed.standAlone) |
---|
4478 | 5845 | { |
---|
4479 | 5846 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4480 | 5847 | browser.show(); |
---|
.. | .. |
---|
4500 | 5867 | Object3D client; |
---|
4501 | 5868 | Object3D copy; |
---|
4502 | 5869 | MenuBar menuBar; |
---|
4503 | | - Menu windowMenu; |
---|
4504 | | - MenuItem loadItem; |
---|
| 5870 | + Menu fileMenu; |
---|
| 5871 | + MenuItem newItem; |
---|
| 5872 | + MenuItem openItem; |
---|
4505 | 5873 | MenuItem saveItem; |
---|
4506 | 5874 | MenuItem saveAsItem; |
---|
4507 | 5875 | MenuItem exportAsItem; |
---|
4508 | 5876 | MenuItem reexportItem; |
---|
4509 | 5877 | MenuItem povItem; |
---|
4510 | 5878 | MenuItem closeItem; |
---|
4511 | | - Menu cameraMenu; |
---|
| 5879 | + |
---|
4512 | 5880 | CheckboxMenuItem zBufferItem; |
---|
4513 | 5881 | //MenuItem normalLensItem; |
---|
4514 | | - MenuItem editCameraItem; |
---|
4515 | | - MenuItem revertCameraItem; |
---|
4516 | | - CheckboxMenuItem toggleLiveItem; |
---|
4517 | 5882 | MenuItem stepItem; |
---|
| 5883 | + CheckboxMenuItem toggleLiveItem; |
---|
4518 | 5884 | CheckboxMenuItem toggleFullScreenItem; |
---|
4519 | 5885 | CheckboxMenuItem toggleTimelineItem; |
---|
4520 | 5886 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4523 | 5889 | CheckboxMenuItem toggleFootContactItem; |
---|
4524 | 5890 | CheckboxMenuItem toggleDLItem; |
---|
4525 | 5891 | CheckboxMenuItem toggleTextureItem; |
---|
4526 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 5892 | + CheckboxMenuItem toggleSwitchItem; |
---|
4527 | 5893 | CheckboxMenuItem toggleRootItem; |
---|
4528 | 5894 | CheckboxMenuItem animationItem; |
---|
| 5895 | + MenuItem archiveItem; |
---|
4529 | 5896 | CheckboxMenuItem toggleHandleItem; |
---|
4530 | 5897 | CheckboxMenuItem togglePaintItem; |
---|
4531 | 5898 | JSplitPane mainPanel; |
---|
4532 | 5899 | JScrollPane scrollpane; |
---|
| 5900 | + |
---|
4533 | 5901 | JPanel toolbarPanel; |
---|
4534 | | - JPanel treePanel; |
---|
| 5902 | + |
---|
| 5903 | + cGridBag treePanel; |
---|
| 5904 | + |
---|
4535 | 5905 | JPanel radioPanel; |
---|
4536 | 5906 | ButtonGroup buttonGroup; |
---|
4537 | | - JPanel ctrlPanel; |
---|
4538 | | - JPanel materialPanel; |
---|
| 5907 | + |
---|
| 5908 | + cGridBag toolboxPanel; |
---|
| 5909 | + cGridBag skyboxPanel; |
---|
| 5910 | + cGridBag materialPanel; |
---|
| 5911 | + cGridBag ctrlPanel; |
---|
| 5912 | + |
---|
4539 | 5913 | JScrollPane infoPanel; |
---|
4540 | | - JPanel optionsPanel; |
---|
| 5914 | + |
---|
| 5915 | + cGridBag optionsPanel; |
---|
| 5916 | + |
---|
4541 | 5917 | JTabbedPane objectPanel; |
---|
4542 | | - JPanel XYZPanel; |
---|
| 5918 | + boolean materialFlushed; |
---|
| 5919 | + Object3D latestObject; |
---|
| 5920 | + |
---|
| 5921 | + cGridBag XYZPanel; |
---|
| 5922 | + |
---|
4543 | 5923 | JSplitPane gridPanel; |
---|
4544 | 5924 | JSplitPane bigPanel; |
---|
4545 | | - JPanel bigThree; |
---|
4546 | | - JTabbedPane scenePanel; |
---|
4547 | | - JPanel centralPanel; |
---|
| 5925 | + |
---|
| 5926 | + cGridBag bigThree; |
---|
| 5927 | + cGridBag scenePanel; |
---|
| 5928 | + cGridBag centralPanel; |
---|
4548 | 5929 | JSplitPane cameraPanel; |
---|
4549 | 5930 | JPanel timelinePanel; |
---|
4550 | 5931 | JMenuBar timelineMenubar; |
---|
.. | .. |
---|
4597 | 5978 | // MATERIAL |
---|
4598 | 5979 | JLabel materialLabel; |
---|
4599 | 5980 | JLabel colorLabel; |
---|
4600 | | - NumberSlider colorField; |
---|
| 5981 | + cNumberSlider colorField; |
---|
4601 | 5982 | JLabel modulationLabel; |
---|
4602 | | - NumberSlider modulationField; |
---|
| 5983 | + cNumberSlider saturationField; |
---|
4603 | 5984 | JLabel metalnessLabel; |
---|
4604 | | - NumberSlider metalnessField; |
---|
| 5985 | + cNumberSlider metalnessField; |
---|
4605 | 5986 | JLabel diffuseLabel; |
---|
4606 | | - NumberSlider diffuseField; |
---|
| 5987 | + cNumberSlider diffuseField; |
---|
4607 | 5988 | JLabel specularLabel; |
---|
4608 | | - NumberSlider specularField; |
---|
| 5989 | + cNumberSlider specularField; |
---|
4609 | 5990 | JLabel shininessLabel; |
---|
4610 | | - NumberSlider shininessField; |
---|
| 5991 | + cNumberSlider shininessField; |
---|
4611 | 5992 | JLabel shiftLabel; |
---|
4612 | | - NumberSlider shiftField; |
---|
| 5993 | + cNumberSlider shiftField; |
---|
4613 | 5994 | JLabel ambientLabel; |
---|
4614 | | - NumberSlider ambientField; |
---|
| 5995 | + cNumberSlider ambientField; |
---|
4615 | 5996 | JLabel lightareaLabel; |
---|
4616 | | - NumberSlider lightareaField; |
---|
| 5997 | + cNumberSlider lightareaField; |
---|
4617 | 5998 | JLabel diffusenessLabel; |
---|
4618 | | - NumberSlider diffusenessField; |
---|
| 5999 | + cNumberSlider diffusenessField; |
---|
4619 | 6000 | JLabel velvetLabel; |
---|
4620 | | - NumberSlider velvetField; |
---|
| 6001 | + cNumberSlider velvetField; |
---|
4621 | 6002 | JLabel sheenLabel; |
---|
4622 | | - NumberSlider sheenField; |
---|
| 6003 | + cNumberSlider sheenField; |
---|
4623 | 6004 | JLabel subsurfaceLabel; |
---|
4624 | | - NumberSlider subsurfaceField; |
---|
| 6005 | + cNumberSlider subsurfaceField; |
---|
4625 | 6006 | //JLabel bumpLabel; |
---|
4626 | 6007 | //NumberSlider bumpField; |
---|
4627 | 6008 | JLabel backlitLabel; |
---|
4628 | | - NumberSlider backlitField; |
---|
| 6009 | + cNumberSlider backlitField; |
---|
4629 | 6010 | JLabel anisoLabel; |
---|
4630 | | - NumberSlider anisoField; |
---|
| 6011 | + cNumberSlider anisoField; |
---|
4631 | 6012 | JLabel anisoVLabel; |
---|
4632 | | - NumberSlider anisoVField; |
---|
| 6013 | + cNumberSlider anisoVField; |
---|
| 6014 | + |
---|
4633 | 6015 | JLabel cameraLabel; |
---|
4634 | | - NumberSlider cameraField; |
---|
| 6016 | + cNumberSlider cameraField; |
---|
4635 | 6017 | JLabel selfshadowLabel; |
---|
4636 | | - NumberSlider selfshadowField; |
---|
| 6018 | + cNumberSlider selfshadowField; |
---|
4637 | 6019 | JLabel shadowLabel; |
---|
4638 | | - NumberSlider shadowField; |
---|
| 6020 | + cNumberSlider shadowField; |
---|
4639 | 6021 | JLabel textureLabel; |
---|
4640 | | - NumberSlider textureField; |
---|
| 6022 | + cNumberSlider textureField; |
---|
4641 | 6023 | JLabel opacityLabel; |
---|
4642 | | - NumberSlider opacityField; |
---|
| 6024 | + cNumberSlider opacityField; |
---|
4643 | 6025 | JLabel fakedepthLabel; |
---|
4644 | | - NumberSlider fakedepthField; |
---|
| 6026 | + cNumberSlider fakedepthField; |
---|
4645 | 6027 | JLabel shadowbiasLabel; |
---|
4646 | | - NumberSlider shadowbiasField; |
---|
| 6028 | + cNumberSlider shadowbiasField; |
---|
| 6029 | + |
---|
4647 | 6030 | JLabel bumpLabel; |
---|
4648 | | - NumberSlider bumpField; |
---|
| 6031 | + cNumberSlider bumpField; |
---|
4649 | 6032 | JLabel noiseLabel; |
---|
4650 | | - NumberSlider noiseField; |
---|
| 6033 | + cNumberSlider noiseField; |
---|
4651 | 6034 | JLabel powerLabel; |
---|
4652 | | - NumberSlider powerField; |
---|
| 6035 | + cNumberSlider powerField; |
---|
4653 | 6036 | JLabel borderfadeLabel; |
---|
4654 | | - NumberSlider borderfadeField; |
---|
| 6037 | + cNumberSlider borderfadeField; |
---|
4655 | 6038 | JLabel fogLabel; |
---|
4656 | | - NumberSlider fogField; |
---|
| 6039 | + cNumberSlider fogField; |
---|
4657 | 6040 | JLabel opacityPowerLabel; |
---|
4658 | | - NumberSlider opacityPowerField; |
---|
4659 | | - JTree jTree; |
---|
| 6041 | + cNumberSlider opacityPowerField; |
---|
| 6042 | + cTree jTree; |
---|
4660 | 6043 | //ObjectUI parent; |
---|
4661 | 6044 | |
---|
4662 | | - NumberSlider normalpushField; |
---|
| 6045 | + cNumberSlider normalpushField; |
---|
| 6046 | + |
---|
| 6047 | + private MenuItem importGFDItem; |
---|
| 6048 | + private MenuItem importVRMLX3DItem; |
---|
| 6049 | + private MenuItem import3DSItem; |
---|
| 6050 | + private MenuItem importOBJItem; |
---|
4663 | 6051 | } |
---|