.. | .. |
---|
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 Composite CreateCameras() |
---|
| 76 | + { |
---|
| 77 | + Composite cams = new cTemplate(); |
---|
| 78 | + cams.name = "Cameras"; |
---|
| 79 | + copy.insertElementAt(cams, 0); |
---|
| 80 | + |
---|
| 81 | + cams.addChild(new Camera()); |
---|
| 82 | + cams.addChild(new Camera(1)); |
---|
| 83 | + cams.addChild(new Camera(2)); |
---|
| 84 | + cams.addChild(new Camera(3)); |
---|
| 85 | + cams.addChild(new Camera(4)); |
---|
| 86 | + |
---|
| 87 | + return cams; |
---|
| 88 | + } |
---|
| 89 | + |
---|
| 90 | + public cGridBag GetSeparator() |
---|
| 91 | + { |
---|
| 92 | + cGridBag separator = new cGridBag(); |
---|
| 93 | + separator.add(new JSeparator()); |
---|
| 94 | + separator.preferredHeight = 5; |
---|
| 95 | + return separator; |
---|
| 96 | + } |
---|
| 97 | + |
---|
| 98 | + cButton GetButton(String name, boolean border) |
---|
| 99 | + { |
---|
| 100 | + ImageIcon icon = GetIcon(name); |
---|
| 101 | + if (icon != null || name.contains("/")) |
---|
| 102 | + return new cButton(icon, border); |
---|
| 103 | + else |
---|
| 104 | + return new cButton(name, border); |
---|
| 105 | + } |
---|
| 106 | + |
---|
| 107 | + cLabel GetLabel(String name, boolean border) |
---|
| 108 | + { |
---|
| 109 | + //ImageIcon icon = GetIcon(name); |
---|
| 110 | + return new cLabel(GetImage(name), border); |
---|
| 111 | + } |
---|
| 112 | + |
---|
| 113 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 114 | + { |
---|
| 115 | + ImageIcon icon = GetIcon(name); |
---|
| 116 | + return new cToggleButton(icon, border); |
---|
| 117 | + } |
---|
| 118 | + |
---|
| 119 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 120 | + { |
---|
| 121 | + ImageIcon icon = GetIcon(name); |
---|
| 122 | + return new cCheckBox(icon, border); |
---|
| 123 | + } |
---|
| 124 | + |
---|
| 125 | + static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); |
---|
| 126 | + |
---|
| 127 | + static ImageIcon GetIcon(String name) |
---|
| 128 | + { |
---|
| 129 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 130 | + if (iconCache != null) |
---|
| 131 | + { |
---|
| 132 | + return iconCache; |
---|
| 133 | + } |
---|
| 134 | + |
---|
| 135 | + try |
---|
| 136 | + { |
---|
| 137 | + BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
| 138 | + |
---|
| 139 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 140 | +// { |
---|
| 141 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 142 | +// Graphics2D g = resized.createGraphics(); |
---|
| 143 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 144 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 145 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 146 | +// g.dispose(); |
---|
| 147 | +// |
---|
| 148 | +// image = resized; |
---|
| 149 | +// } |
---|
| 150 | + |
---|
| 151 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 152 | + |
---|
| 153 | + icons.put(name, icon); |
---|
| 154 | + |
---|
| 155 | + return icon; |
---|
| 156 | + } |
---|
| 157 | + catch (Exception e) |
---|
| 158 | + { |
---|
| 159 | + //icons.put(name, null); |
---|
| 160 | + return null; |
---|
| 161 | + } |
---|
| 162 | + } |
---|
| 163 | + |
---|
| 164 | + BufferedImage GetImage(String name) |
---|
| 165 | + { |
---|
| 166 | + try |
---|
| 167 | + { |
---|
| 168 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 169 | + |
---|
| 170 | + return image; |
---|
| 171 | + } |
---|
| 172 | + catch (Exception e) |
---|
| 173 | + { |
---|
| 174 | + return null; |
---|
| 175 | + } |
---|
| 176 | + } |
---|
36 | 177 | |
---|
37 | 178 | // SCRIPT |
---|
38 | 179 | |
---|
.. | .. |
---|
124 | 265 | void keyPressed(int key, int modifiers) |
---|
125 | 266 | { |
---|
126 | 267 | System.out.println("KEY PRESSED"); |
---|
127 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 268 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
128 | 269 | } |
---|
129 | 270 | */ |
---|
130 | 271 | |
---|
.. | .. |
---|
136 | 277 | public void closeUI() |
---|
137 | 278 | { |
---|
138 | 279 | //new Exception().printStackTrace(); |
---|
139 | | - System.out.println("this = " + this); |
---|
140 | | - System.out.println("objEditor = " + objEditor); |
---|
| 280 | +// System.out.println("this = " + this); |
---|
| 281 | +// System.out.println("objEditor = " + objEditor); |
---|
141 | 282 | //nameField.removeActionListener(this); |
---|
142 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 283 | +// objEditor.ctrlPanel.remove(nameField); |
---|
143 | 284 | |
---|
144 | | - if (!GroupEditor.allparams) |
---|
| 285 | + objEditor.ctrlPanel.remove(namePanel); |
---|
| 286 | + |
---|
| 287 | + if (!allparams) |
---|
145 | 288 | return; |
---|
146 | 289 | |
---|
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); |
---|
| 290 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 291 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 292 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 293 | +// |
---|
| 294 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 295 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 296 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 297 | +// |
---|
| 298 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 299 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 300 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 301 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 302 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 303 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 304 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 305 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 306 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 307 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
165 | 308 | |
---|
166 | | - Remove(normalpushField); |
---|
| 309 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 310 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 311 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
| 312 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 313 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 314 | + |
---|
| 315 | + //Remove(normalpushField); |
---|
167 | 316 | } |
---|
168 | 317 | |
---|
169 | 318 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
207 | 356 | client = inClient; |
---|
208 | 357 | copy = client; |
---|
209 | 358 | |
---|
| 359 | +// if (copy.versionlist == null) |
---|
| 360 | +// { |
---|
| 361 | +// copy.versionlist = new Object3D[100]; |
---|
| 362 | +// copy.versionindex = -1; |
---|
| 363 | +// |
---|
| 364 | +// callee.Save(true); |
---|
| 365 | +// } |
---|
| 366 | + |
---|
210 | 367 | // "this" is not called: SetupUI2(objEditor); |
---|
211 | 368 | } |
---|
212 | 369 | |
---|
.. | .. |
---|
220 | 377 | client = inClient; |
---|
221 | 378 | copy = client; |
---|
222 | 379 | |
---|
| 380 | + if (copy.versionlist == null) |
---|
| 381 | + { |
---|
| 382 | + copy.versionlist = new Object3D[100]; |
---|
| 383 | + copy.versionindex = -1; |
---|
| 384 | + |
---|
| 385 | +// Save(true); |
---|
| 386 | + } |
---|
| 387 | + |
---|
223 | 388 | SetupUI2(callee.GetEditor()); |
---|
224 | 389 | } |
---|
225 | 390 | |
---|
.. | .. |
---|
234 | 399 | //localCopy.parent = null; |
---|
235 | 400 | |
---|
236 | 401 | frame = new JFrame(); |
---|
| 402 | + frame.setUndecorated(false); |
---|
237 | 403 | objEditor = this; |
---|
238 | 404 | this.callee = callee; |
---|
239 | 405 | |
---|
240 | 406 | //parent = p; |
---|
241 | 407 | |
---|
242 | 408 | GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); |
---|
243 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 409 | + if (Globals.DEBUG) |
---|
| 410 | + System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
244 | 411 | //gd.setFullScreenWindow(this); |
---|
245 | 412 | //setResizable(false); |
---|
246 | 413 | //if (!isDisplayable()) |
---|
.. | .. |
---|
251 | 418 | copy = localCopy; |
---|
252 | 419 | copy.editWindow = this; |
---|
253 | 420 | |
---|
| 421 | +// if (copy.versionlist == null) |
---|
| 422 | +// { |
---|
| 423 | +// copy.versionlist = new Object3D[100]; |
---|
| 424 | +// copy.versionindex = -1; |
---|
| 425 | +// |
---|
| 426 | +// Save(true); |
---|
| 427 | +// } |
---|
| 428 | + |
---|
254 | 429 | SetupMenu(); |
---|
255 | 430 | |
---|
256 | 431 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
264 | 439 | return frame.action(event, obj); |
---|
265 | 440 | } |
---|
266 | 441 | |
---|
| 442 | + // Cannot work without static |
---|
| 443 | + static boolean allparams = true; |
---|
| 444 | + |
---|
| 445 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 446 | + |
---|
| 447 | + // This is to refresh the UI of the material panel. |
---|
| 448 | + boolean patchMaterial; |
---|
| 449 | + |
---|
267 | 450 | void SetupMenu() |
---|
268 | 451 | { |
---|
269 | 452 | 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...")); |
---|
| 453 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 454 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 455 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
| 456 | + |
---|
| 457 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 458 | + Menu menu = new Menu("Import"); |
---|
| 459 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 460 | + importOBJItem.addActionListener(this); |
---|
| 461 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 462 | + import3DSItem.addActionListener(this); |
---|
| 463 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 464 | + importVRMLX3DItem.addActionListener(this); |
---|
| 465 | + menu.add("-"); |
---|
| 466 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 467 | + importGFDItem.addActionListener(this); |
---|
| 468 | + fileMenu.add(menu); |
---|
| 469 | + fileMenu.add("-"); |
---|
| 470 | + |
---|
| 471 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 472 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
275 | 473 | //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("-"); |
---|
| 474 | + fileMenu.add("-"); |
---|
| 475 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 476 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 477 | + fileMenu.add("-"); |
---|
280 | 478 | if (client.parent != null) |
---|
281 | 479 | { |
---|
282 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 480 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
283 | 481 | } else |
---|
284 | 482 | { |
---|
285 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 483 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
286 | 484 | } |
---|
287 | 485 | |
---|
288 | | - loadItem.addActionListener(this); |
---|
| 486 | + newItem.addActionListener(this); |
---|
| 487 | + openItem.addActionListener(this); |
---|
289 | 488 | saveItem.addActionListener(this); |
---|
290 | 489 | saveAsItem.addActionListener(this); |
---|
291 | 490 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
293 | 492 | //povItem.addActionListener(this); |
---|
294 | 493 | closeItem.addActionListener(this); |
---|
295 | 494 | |
---|
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(CameraPane.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 | 495 | objectPanel = new JTabbedPane(); |
---|
| 496 | + |
---|
| 497 | + ChangeListener changeListener = new ChangeListener() |
---|
| 498 | + { |
---|
| 499 | + //String name; |
---|
| 500 | + |
---|
| 501 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 502 | + { |
---|
| 503 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 504 | +// { |
---|
| 505 | +// if (latestObject != null) |
---|
| 506 | +// { |
---|
| 507 | +// refreshContents(true); |
---|
| 508 | +// SetMaterial(latestObject); |
---|
| 509 | +// } |
---|
| 510 | +// |
---|
| 511 | +// materialFlushed = true; |
---|
| 512 | +// } |
---|
| 513 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 514 | +// { |
---|
| 515 | +// if (listUI.size() == 0) |
---|
| 516 | +// EditSelection(false); |
---|
| 517 | +// } |
---|
| 518 | + |
---|
| 519 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 520 | +// { |
---|
| 521 | +// name = copy.skyboxname; |
---|
| 522 | +// |
---|
| 523 | +// if (name == null) |
---|
| 524 | +// { |
---|
| 525 | +// name = ""; |
---|
| 526 | +// } |
---|
| 527 | +// |
---|
| 528 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 529 | +// copy.skyboxext = "jpg"; |
---|
| 530 | +// } |
---|
| 531 | +// else |
---|
| 532 | +// { |
---|
| 533 | +// if (name != null) |
---|
| 534 | +// { |
---|
| 535 | +// if (name.equals("")) |
---|
| 536 | +// { |
---|
| 537 | +// copy.skyboxname = null; |
---|
| 538 | +// copy.skyboxext = null; |
---|
| 539 | +// } |
---|
| 540 | +// else |
---|
| 541 | +// { |
---|
| 542 | +// copy.skyboxname = name; |
---|
| 543 | +// } |
---|
| 544 | +// } |
---|
| 545 | +// } |
---|
| 546 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 547 | + |
---|
| 548 | +// refreshContents(false); // To refresh Info tab |
---|
| 549 | + cameraView.repaint(); |
---|
| 550 | + } |
---|
| 551 | + }; |
---|
| 552 | + objectPanel.addChangeListener(changeListener); |
---|
| 553 | + |
---|
352 | 554 | toolbarPanel = new JPanel(); |
---|
353 | 555 | toolbarPanel.setName("Toolbar"); |
---|
354 | | - treePanel = new JPanel(); |
---|
| 556 | + |
---|
| 557 | + treePanel = new cGridBag(); |
---|
355 | 558 | treePanel.setName("Tree"); |
---|
356 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
357 | | - ctrlPanel.setName("Edit"); |
---|
358 | | - materialPanel = new JPanel(); |
---|
359 | | - materialPanel.setName("Material"); |
---|
| 559 | + |
---|
| 560 | + editPanel = new cGridBag().setVertical(true); |
---|
| 561 | + //editPanel.setName("Edit"); |
---|
| 562 | + |
---|
| 563 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
| 564 | + |
---|
| 565 | + editCommandsPanel = new cGridBag(); |
---|
| 566 | + editPanel.add(editCommandsPanel); |
---|
| 567 | + editPanel.add(ctrlPanel); |
---|
| 568 | + |
---|
| 569 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 570 | + //toolboxPanel.setName("Toolbox"); |
---|
| 571 | + |
---|
| 572 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 573 | + |
---|
| 574 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 575 | + //materialPanel.setName("Material"); |
---|
| 576 | + |
---|
360 | 577 | /*JTextPane*/ |
---|
361 | 578 | infoarea = createTextPane(); |
---|
| 579 | + doc = infoarea.getStyledDocument(); |
---|
| 580 | + |
---|
362 | 581 | infoarea.setEditable(true); |
---|
363 | 582 | SetText(); |
---|
| 583 | + |
---|
364 | 584 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
365 | 585 | // infoarea.setOpaque(false); |
---|
366 | 586 | // //infoarea.setForeground(textcolor); |
---|
367 | | - infoarea.setLineWrap(true); |
---|
368 | | - infoarea.setWrapStyleWord(true); |
---|
| 587 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 588 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
369 | 589 | 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"); |
---|
| 590 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
| 591 | + //infoPanel.setName("Info"); |
---|
372 | 592 | //infoPanel.setLayout(new BorderLayout()); |
---|
373 | 593 | //infoPanel.add(createTextPane()); |
---|
374 | 594 | |
---|
.. | .. |
---|
376 | 596 | mainPanel.setName("Main"); |
---|
377 | 597 | mainPanel.setContinuousLayout(true); |
---|
378 | 598 | mainPanel.setOneTouchExpandable(true); |
---|
379 | | - mainPanel.setDividerLocation(1.0); |
---|
380 | 599 | mainPanel.setDividerSize(9); |
---|
381 | | - mainPanel.setResizeWeight(0); |
---|
382 | | - |
---|
| 600 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 601 | + mainPanel.setResizeWeight(0.5); |
---|
| 602 | + |
---|
| 603 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 604 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 605 | + divider.setDividerSize(15); |
---|
| 606 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 607 | + |
---|
| 608 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 609 | + |
---|
383 | 610 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
384 | 611 | //mainPanel.setLayout(new GridBagLayout()); |
---|
385 | 612 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
386 | | - treePanel.setLayout(new GridBagLayout()); |
---|
387 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
388 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 613 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 614 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 615 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
389 | 616 | |
---|
390 | 617 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
391 | 618 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
424 | 651 | static String newline = "\n"; |
---|
425 | 652 | protected static final String buttonString = "JButton"; |
---|
426 | 653 | StyledDocument doc; |
---|
427 | | - JTextArea infoarea; |
---|
| 654 | + JTextPane infoarea; |
---|
428 | 655 | |
---|
429 | 656 | void ClearInfo() |
---|
430 | 657 | { |
---|
.. | .. |
---|
447 | 674 | e.printStackTrace(); |
---|
448 | 675 | } |
---|
449 | 676 | |
---|
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(); |
---|
| 677 | +// String selection = infoarea.getText(); |
---|
| 678 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 679 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 680 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
454 | 681 | //clipboard.setContents(data, data); |
---|
455 | 682 | } |
---|
456 | 683 | |
---|
.. | .. |
---|
473 | 700 | //SendInfo("Name:", "bold"); |
---|
474 | 701 | if (sel.GetTextures() != null || debug) |
---|
475 | 702 | { |
---|
476 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 703 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
477 | 704 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
478 | 705 | if (sel.Size() > 0) |
---|
479 | 706 | { |
---|
480 | 707 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
481 | 708 | } |
---|
482 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 709 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
483 | 710 | if (debug) |
---|
484 | 711 | { |
---|
485 | 712 | try |
---|
.. | .. |
---|
491 | 718 | } |
---|
492 | 719 | |
---|
493 | 720 | if (full) |
---|
494 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 721 | + { |
---|
| 722 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 723 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 724 | + } |
---|
495 | 725 | |
---|
496 | 726 | if (sel.bRep != null) |
---|
497 | 727 | { |
---|
.. | .. |
---|
518 | 748 | } |
---|
519 | 749 | if (sel.support != null) |
---|
520 | 750 | { |
---|
521 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 751 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
522 | 752 | } |
---|
523 | 753 | if (sel.scriptnode != null) |
---|
524 | 754 | { |
---|
.. | .. |
---|
589 | 819 | { |
---|
590 | 820 | CameraPane.pointflow = (PointFlow) sel; |
---|
591 | 821 | } |
---|
| 822 | + |
---|
| 823 | + si.SendInfo("_____________________", "regular"); |
---|
| 824 | + si.SendInfo("", "regular"); |
---|
592 | 825 | } |
---|
593 | 826 | } |
---|
594 | 827 | |
---|
.. | .. |
---|
604 | 837 | } |
---|
605 | 838 | } |
---|
606 | 839 | |
---|
| 840 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 841 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 842 | + |
---|
| 843 | + Rectangle keeprect; |
---|
| 844 | + cRadio radio; |
---|
| 845 | + |
---|
| 846 | +cButton keepButton; |
---|
| 847 | + cButton twoButton; // Full 3D |
---|
| 848 | + cButton sixButton; |
---|
| 849 | + cButton threeButton; |
---|
| 850 | + cButton sevenButton; |
---|
| 851 | + cButton fourButton; // full panel |
---|
| 852 | + cButton oneButton; // full XYZ |
---|
| 853 | + //cButton currentLayout; |
---|
| 854 | + |
---|
| 855 | + boolean maximized; |
---|
| 856 | + |
---|
| 857 | + cButton fullscreenLayout; |
---|
| 858 | + cButton expandedLayout; |
---|
| 859 | + |
---|
| 860 | + void Minimize() |
---|
| 861 | + { |
---|
| 862 | + frame.setState(Frame.ICONIFIED); |
---|
| 863 | + frame.validate(); |
---|
| 864 | + } |
---|
| 865 | + |
---|
| 866 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 867 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 868 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
| 869 | + void Maximize() |
---|
| 870 | + { |
---|
| 871 | + if (CameraPane.FULLSCREEN) |
---|
| 872 | + { |
---|
| 873 | + ToggleFullScreen(); |
---|
| 874 | + } |
---|
| 875 | + |
---|
| 876 | + if (maximized) |
---|
| 877 | + { |
---|
| 878 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 879 | + } |
---|
| 880 | + else |
---|
| 881 | + { |
---|
| 882 | + keeprect = frame.getBounds(); |
---|
| 883 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 884 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 885 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 886 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 887 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
| 888 | + } |
---|
| 889 | + |
---|
| 890 | + maximized ^= true; |
---|
| 891 | + |
---|
| 892 | + frame.validate(); |
---|
| 893 | + } |
---|
| 894 | + |
---|
| 895 | + cButton minButton; |
---|
| 896 | + cButton maxButton; |
---|
| 897 | + cButton fullButton; |
---|
| 898 | + cButton collapseButton; |
---|
| 899 | + cButton maximize3DButton; |
---|
| 900 | + |
---|
607 | 901 | void ToggleFullScreen() |
---|
608 | 902 | { |
---|
609 | | - if (CameraPane.FULLSCREEN) |
---|
| 903 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 904 | + |
---|
| 905 | + cameraView.ToggleFullScreen(); |
---|
| 906 | + |
---|
| 907 | + if (!CameraPane.FULLSCREEN) |
---|
610 | 908 | { |
---|
611 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
612 | | - framePanel.add(bigThree); |
---|
613 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 909 | + device.setFullScreenWindow(null); |
---|
| 910 | + frame.dispose(); |
---|
| 911 | + frame.setUndecorated(false); |
---|
| 912 | + frame.validate(); |
---|
| 913 | + frame.setVisible(true); |
---|
| 914 | + |
---|
| 915 | + //frame.setVisible(false); |
---|
| 916 | +// frame.removeNotify(); |
---|
| 917 | +// frame.setUndecorated(false); |
---|
| 918 | +// frame.addNotify(); |
---|
| 919 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 920 | + |
---|
| 921 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 922 | +// X framePanel.add(bigThree); |
---|
| 923 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 924 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
| 925 | + |
---|
| 926 | + //frame.setVisible(true); |
---|
| 927 | +// radio.layout = keepButton; |
---|
| 928 | + //theFrame = null; |
---|
| 929 | + keepButton = null; |
---|
| 930 | +// radio.layout.doClick(); |
---|
| 931 | + |
---|
614 | 932 | } else |
---|
615 | 933 | { |
---|
616 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
617 | | - framePanel.remove(bigThree); |
---|
618 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 934 | + keepButton = radio.layout; |
---|
| 935 | + //keeprect = frame.getBounds(); |
---|
| 936 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 937 | +// frame.getToolkit().getScreenSize().height); |
---|
| 938 | + //frame.setVisible(false); |
---|
| 939 | + |
---|
| 940 | + frame.dispose(); |
---|
| 941 | + frame.setUndecorated(true); |
---|
| 942 | + device.setFullScreenWindow(frame); |
---|
| 943 | + frame.validate(); |
---|
| 944 | + frame.setVisible(true); |
---|
| 945 | +// frame.removeNotify(); |
---|
| 946 | +// frame.setUndecorated(true); |
---|
| 947 | +// frame.addNotify(); |
---|
| 948 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 949 | +// X framePanel.remove(bigThree); |
---|
| 950 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 951 | +// framePanel.setDividerLocation(0); |
---|
| 952 | + |
---|
| 953 | +// radio.layout = fullscreenLayout; |
---|
| 954 | +// radio.layout.doClick(); |
---|
| 955 | + //frame.setVisible(true); |
---|
619 | 956 | } |
---|
620 | | - cameraView.ToggleFullScreen(); |
---|
| 957 | + frame.validate(); |
---|
| 958 | + |
---|
| 959 | + cameraView.requestFocusInWindow(); |
---|
621 | 960 | } |
---|
622 | 961 | |
---|
623 | | - private JTextArea createTextPane() |
---|
| 962 | + void CollapseToolbar() |
---|
| 963 | + { |
---|
| 964 | + framePanel.setDividerLocation(0); |
---|
| 965 | + //frame.validate(); |
---|
| 966 | + |
---|
| 967 | + cameraView.requestFocusInWindow(); |
---|
| 968 | + } |
---|
| 969 | + |
---|
| 970 | + private Object3D Duplicate(Object3D object) |
---|
624 | 971 | { |
---|
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 | | - }; |
---|
| 972 | + boolean temp = CameraPane.SWITCH; |
---|
| 973 | + CameraPane.SWITCH = false; |
---|
| 974 | + |
---|
| 975 | + if (Grafreed.grafreed.universe.versiontable == null) |
---|
| 976 | + Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 977 | + |
---|
| 978 | + object.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 979 | + // if (copy == client) |
---|
| 980 | + |
---|
| 981 | + Object3D versions[] = object.versionlist; |
---|
| 982 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe |
---|
| 983 | + object.versionlist = null; |
---|
| 984 | + object.versiontable = null; |
---|
| 985 | + |
---|
| 986 | + Object3D parent = object.parent; |
---|
| 987 | + object.parent = null; |
---|
| 988 | + |
---|
| 989 | + //byte[] compress = Compress(copy); |
---|
| 990 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
| 991 | + |
---|
| 992 | + object.parent = parent; |
---|
| 993 | + |
---|
| 994 | + object.versionlist = versions; |
---|
| 995 | + object.versiontable = versiontable; // if Grafreed.grafreed.universe |
---|
| 996 | + |
---|
| 997 | + object.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 998 | + |
---|
| 999 | + CameraPane.SWITCH = temp; |
---|
| 1000 | + |
---|
| 1001 | + return compress; |
---|
| 1002 | + } |
---|
640 | 1003 | |
---|
641 | | - String[] initStyles = |
---|
642 | | - { |
---|
643 | | - "regular", "italic", "bold", "small", "large", |
---|
644 | | - "regular", "button", "regular", "icon", |
---|
645 | | - "regular" |
---|
646 | | - }; |
---|
| 1004 | + private JTextPane createTextPane() |
---|
| 1005 | + { |
---|
| 1006 | +// TEXTAREA String[] initString = |
---|
| 1007 | +// { |
---|
| 1008 | +// "This is an editable JTextPane, ", //regular |
---|
| 1009 | +// "another ", //italic |
---|
| 1010 | +// "styled ", //bold |
---|
| 1011 | +// "text ", //small |
---|
| 1012 | +// "component, ", //large |
---|
| 1013 | +// "which supports embedded components..." + newline,//regular |
---|
| 1014 | +// " " + newline, //button |
---|
| 1015 | +// "...and embedded icons..." + newline, //regular |
---|
| 1016 | +// " ", //icon |
---|
| 1017 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 1018 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 1019 | +// + "cover methods for interacting with those objects." |
---|
| 1020 | +// }; |
---|
| 1021 | +// |
---|
| 1022 | +// String[] initStyles = |
---|
| 1023 | +// { |
---|
| 1024 | +// "regular", "italic", "bold", "small", "large", |
---|
| 1025 | +// "regular", "button", "regular", "icon", |
---|
| 1026 | +// "regular" |
---|
| 1027 | +// }; |
---|
| 1028 | +// |
---|
| 1029 | +// JTextPane textPane = new JTextPane(); |
---|
| 1030 | +// textPane.setEditable(true); |
---|
| 1031 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 1032 | +// addStylesToDocument(doc); |
---|
| 1033 | +// |
---|
| 1034 | +// try |
---|
| 1035 | +// { |
---|
| 1036 | +// for (int j = 0; j < 2; j++) |
---|
| 1037 | +// { |
---|
| 1038 | +// for (int i = 0; i < initString.length; i++) |
---|
| 1039 | +// { |
---|
| 1040 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 1041 | +// doc.getStyle(initStyles[i])); |
---|
| 1042 | +// } |
---|
| 1043 | +// } |
---|
| 1044 | +// } catch (BadLocationException ble) |
---|
| 1045 | +// { |
---|
| 1046 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 1047 | +// } |
---|
647 | 1048 | |
---|
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; |
---|
| 1049 | + return new JTextPane(); // textPane; |
---|
669 | 1050 | } |
---|
670 | 1051 | |
---|
671 | 1052 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
718 | 1099 | protected static ImageIcon createImageIcon(String path, |
---|
719 | 1100 | String description) |
---|
720 | 1101 | { |
---|
721 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 1102 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
722 | 1103 | if (imgURL != null) |
---|
723 | 1104 | { |
---|
724 | 1105 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
741 | 1122 | { |
---|
742 | 1123 | SetupMaterial(materialPanel); |
---|
743 | 1124 | } |
---|
| 1125 | + |
---|
744 | 1126 | //SetupName(); |
---|
745 | 1127 | //SetupViews(); |
---|
746 | 1128 | } |
---|
.. | .. |
---|
750 | 1132 | // NumberSlider vDivsField; |
---|
751 | 1133 | // JCheckBox endcaps; |
---|
752 | 1134 | JCheckBox liveCB; |
---|
| 1135 | + JCheckBox selectableCB; |
---|
753 | 1136 | JCheckBox hideCB; |
---|
754 | 1137 | JCheckBox link2masterCB; |
---|
755 | 1138 | JCheckBox markCB; |
---|
.. | .. |
---|
757 | 1140 | JCheckBox speedupCB; |
---|
758 | 1141 | JCheckBox rewindCB; |
---|
759 | 1142 | JCheckBox flipVCB; |
---|
| 1143 | + |
---|
| 1144 | + cCheckBox toggleTextureCB; |
---|
| 1145 | + cCheckBox toggleSwitchCB; |
---|
| 1146 | + |
---|
760 | 1147 | JComboBox texresMenu; |
---|
| 1148 | + |
---|
761 | 1149 | JButton resetButton; |
---|
762 | 1150 | JButton stepButton; |
---|
763 | 1151 | JButton stepAllButton; |
---|
.. | .. |
---|
765 | 1153 | JButton slowerButton; |
---|
766 | 1154 | JButton fasterButton; |
---|
767 | 1155 | JButton remarkButton; |
---|
| 1156 | + |
---|
| 1157 | + cGridBag editPanel; |
---|
| 1158 | + cGridBag editCommandsPanel; |
---|
| 1159 | + |
---|
| 1160 | + cGridBag namePanel; |
---|
| 1161 | + cGridBag setupPanel; |
---|
| 1162 | + cGridBag setupPanel2; |
---|
| 1163 | + cGridBag objectCommandsPanel; |
---|
| 1164 | + cGridBag pushPanel; |
---|
| 1165 | + cGridBag fillPanel; |
---|
768 | 1166 | |
---|
769 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 1167 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
770 | 1168 | { |
---|
771 | 1169 | JCheckBox cb; |
---|
772 | 1170 | |
---|
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); |
---|
| 1171 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
778 | 1172 | cb.addItemListener(this); |
---|
779 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
780 | | - oe.aConstraints.gridwidth = 1; |
---|
781 | | - oe.aConstraints.gridx += 1; |
---|
782 | 1173 | |
---|
783 | 1174 | return cb; |
---|
784 | 1175 | } |
---|
785 | 1176 | |
---|
786 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 1177 | + cButton AddButton(cGridBag panel, String label) |
---|
787 | 1178 | { |
---|
788 | 1179 | cButton cb; |
---|
789 | 1180 | |
---|
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); |
---|
| 1181 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
795 | 1182 | cb.addActionListener(this); |
---|
796 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
797 | | - oe.aConstraints.gridwidth = 1; |
---|
798 | | - oe.aConstraints.gridx += 1; |
---|
799 | 1183 | |
---|
800 | 1184 | return cb; |
---|
801 | 1185 | } |
---|
802 | 1186 | |
---|
803 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 1187 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
804 | 1188 | { |
---|
805 | 1189 | JComboBox combo; |
---|
806 | 1190 | |
---|
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; |
---|
| 1191 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
810 | 1192 | combo.addActionListener(this); |
---|
811 | 1193 | |
---|
812 | 1194 | return combo; |
---|
813 | 1195 | } |
---|
814 | 1196 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 1197 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
816 | 1198 | { |
---|
817 | | - NumberSlider combo; |
---|
| 1199 | + cGridBag control = new cGridBag(); |
---|
| 1200 | + |
---|
| 1201 | + cNumberSlider combo; |
---|
818 | 1202 | |
---|
819 | 1203 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 1204 | 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 | | - |
---|
| 1205 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1206 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 1207 | combo.setFloat(current); |
---|
833 | | - |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 1208 | + |
---|
| 1209 | + panel.add(control); |
---|
| 1210 | + |
---|
| 1211 | + return control; |
---|
839 | 1212 | } |
---|
840 | 1213 | |
---|
841 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 1214 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
842 | 1215 | { |
---|
843 | | - NumberSlider combo; |
---|
| 1216 | + cGridBag control = new cGridBag(); |
---|
| 1217 | + |
---|
| 1218 | + cNumberSlider combo; |
---|
844 | 1219 | |
---|
845 | 1220 | JLabel jlabel = new JLabel(label); |
---|
846 | | - |
---|
847 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
848 | 1221 | 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 | | - |
---|
| 1222 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1223 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
858 | 1224 | combo.setInteger(current); |
---|
859 | 1225 | |
---|
860 | | - combo.label = jlabel; |
---|
861 | | - |
---|
862 | | - combo.addChangeListener(this); |
---|
863 | | - |
---|
864 | | - return combo; |
---|
| 1226 | + panel.add(control); |
---|
| 1227 | + |
---|
| 1228 | + return control; |
---|
865 | 1229 | } |
---|
866 | 1230 | |
---|
867 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 1231 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
868 | 1232 | { |
---|
869 | 1233 | JTextArea text; |
---|
870 | 1234 | |
---|
871 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
872 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
873 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1235 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
874 | 1236 | text.addCaretListener(this); |
---|
875 | | - aConstraints.gridx += 1; |
---|
876 | | - aConstraints.gridwidth = 1; |
---|
877 | 1237 | |
---|
878 | 1238 | return text; |
---|
879 | 1239 | } |
---|
.. | .. |
---|
903 | 1263 | objEditor.ctrlPanel.remove(j); |
---|
904 | 1264 | } |
---|
905 | 1265 | |
---|
| 1266 | + void Remove(cNumberSlider j) |
---|
| 1267 | + { |
---|
| 1268 | + j.removeChangeListener(this); |
---|
| 1269 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 1270 | + objEditor.ctrlPanel.remove(j); |
---|
| 1271 | + } |
---|
| 1272 | + |
---|
906 | 1273 | /* |
---|
907 | 1274 | */ |
---|
908 | | - void Return() // ObjEditor oe) |
---|
| 1275 | + void Return0() // ObjEditor oe) |
---|
909 | 1276 | { |
---|
910 | 1277 | aConstraints.gridy += 1; |
---|
911 | 1278 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
960 | 1327 | |
---|
961 | 1328 | void SetupUI2(ObjEditor oe) |
---|
962 | 1329 | { |
---|
963 | | -// oe.aConstraints.weightx = 0; |
---|
964 | | -// oe.aConstraints.weighty = 0; |
---|
965 | | -// oe.aConstraints.gridx = 0; |
---|
966 | | -// oe.aConstraints.gridy = 0; |
---|
967 | | - SetupName(oe); |
---|
| 1330 | + //SetupName(oe); |
---|
968 | 1331 | |
---|
969 | | - if (!GroupEditor.allparams) |
---|
| 1332 | + namePanel = new cGridBag(); |
---|
| 1333 | + |
---|
| 1334 | + //if (copy.pinned) |
---|
| 1335 | + { |
---|
| 1336 | + pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF); |
---|
| 1337 | + pinButton.setSelected(copy.pinned); |
---|
| 1338 | + cGridBag t = new cGridBag(); |
---|
| 1339 | + t.preferredWidth = 2; |
---|
| 1340 | + t.add(pinButton); |
---|
| 1341 | + namePanel.add(t); |
---|
| 1342 | + |
---|
| 1343 | + pinButton.addItemListener(this); |
---|
| 1344 | + } |
---|
| 1345 | + |
---|
| 1346 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 1347 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
| 1348 | + oe.ctrlPanel.add(namePanel); |
---|
| 1349 | + |
---|
| 1350 | + oe.ctrlPanel.Return(); |
---|
| 1351 | + |
---|
| 1352 | + if (!allparams) |
---|
970 | 1353 | return; |
---|
971 | 1354 | |
---|
972 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
973 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
974 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1355 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1356 | + |
---|
| 1357 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1358 | + liveCB.setToolTipText("Animate object"); |
---|
| 1359 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1360 | + markCB.setToolTipText("Set target transform"); |
---|
| 1361 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1362 | + selectableCB.setToolTipText("Make object selectable"); |
---|
975 | 1363 | // 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"); |
---|
| 1364 | + |
---|
| 1365 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1366 | + hideCB.setToolTipText("Hide object"); |
---|
| 1367 | + |
---|
| 1368 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
| 1369 | + |
---|
| 1370 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1371 | + |
---|
| 1372 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1373 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1374 | + |
---|
| 1375 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1376 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
| 1377 | + |
---|
| 1378 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1379 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1380 | + |
---|
| 1381 | + if (Globals.ADVANCED) |
---|
| 1382 | + { |
---|
| 1383 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1384 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1385 | + } |
---|
| 1386 | + |
---|
| 1387 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1388 | + oe.ctrlPanel.Return(); |
---|
| 1389 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1390 | + oe.ctrlPanel.Return(); |
---|
| 1391 | + |
---|
| 1392 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
| 1393 | + |
---|
| 1394 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1395 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1396 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1397 | + stepButton.setToolTipText("Step one frame"); |
---|
982 | 1398 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
983 | 1399 | // stepAllButton = AddButton(oe, "Step All"); |
---|
984 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
985 | 1400 | // Return(); |
---|
986 | | - slowerButton = AddButton(oe, "Slow"); |
---|
987 | | - fasterButton = AddButton(oe, "Fast"); |
---|
988 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1401 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1402 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1403 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1404 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1405 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1406 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
989 | 1407 | |
---|
990 | | - Return(); |
---|
| 1408 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
| 1409 | + oe.ctrlPanel.Return(); |
---|
991 | 1410 | |
---|
992 | | - normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
993 | | - Return(); |
---|
| 1411 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1412 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1413 | + //Return(); |
---|
| 1414 | + |
---|
| 1415 | + oe.ctrlPanel.Return(); |
---|
994 | 1416 | |
---|
995 | 1417 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
996 | 1418 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1085 | 1507 | oe.aConstraints.gridwidth = 1; |
---|
1086 | 1508 | /**/ |
---|
1087 | 1509 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1088 | | - Return(); |
---|
| 1510 | + oe.ctrlPanel.Return(); |
---|
1089 | 1511 | |
---|
1090 | 1512 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1091 | 1513 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1143 | 1565 | |
---|
1144 | 1566 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1145 | 1567 | { |
---|
1146 | | - System.out.println("CREATE CAMERAS"); |
---|
1147 | | - cams = new cTemplate(); |
---|
1148 | | - cams.name = "Cameras"; |
---|
1149 | | - copy.insertElementAt(cams, 0); |
---|
1150 | | - //cams.parent = copy; |
---|
1151 | | - |
---|
1152 | | - cam = new Camera(); // LA.newVector(3, 2, 1)); |
---|
1153 | | - cams.addChild(cam); |
---|
1154 | | - cam = new Camera(1); |
---|
1155 | | - cams.addChild(cam); |
---|
1156 | | - cam = new Camera(2); |
---|
1157 | | - cams.addChild(cam); |
---|
1158 | | - cam = new Camera(3); |
---|
1159 | | - cams.addChild(cam); |
---|
1160 | | - cam = new Camera(4); // Light |
---|
1161 | | - cams.addChild(cam); |
---|
| 1568 | + if (Globals.DEBUG) |
---|
| 1569 | + System.out.println("CREATE CAMERAS"); |
---|
| 1570 | + cams = CreateCameras(); |
---|
1162 | 1571 | } else |
---|
1163 | 1572 | { |
---|
1164 | 1573 | cams = (cGroup) copy.get(0); |
---|
.. | .. |
---|
1187 | 1596 | //JPanel worldPanel = |
---|
1188 | 1597 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1189 | 1598 | //worldPanel.setName("World"); |
---|
1190 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
1191 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1192 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1599 | + centralPanel = new cGridBag(); |
---|
| 1600 | + centralPanel.preferredWidth = 20; |
---|
| 1601 | + |
---|
| 1602 | + if (Globals.ADVANCED) |
---|
| 1603 | + { |
---|
| 1604 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1605 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1193 | 1606 | |
---|
1194 | 1607 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1195 | 1608 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1198 | 1611 | // cameraPanel.setDividerSize(9); |
---|
1199 | 1612 | cameraPanel.setResizeWeight(1.0); |
---|
1200 | 1613 | |
---|
| 1614 | + } |
---|
| 1615 | + |
---|
1201 | 1616 | centralPanel.add(cameraView); |
---|
| 1617 | + centralPanel.setFocusable(true); |
---|
1202 | 1618 | //frame.setJMenuBar(timelineMenubar); |
---|
1203 | 1619 | //centralPanel.add(timelinePanel); |
---|
1204 | 1620 | |
---|
.. | .. |
---|
1217 | 1633 | //frontView.object = copy; |
---|
1218 | 1634 | //sideView.object = copy; |
---|
1219 | 1635 | |
---|
1220 | | - XYZPanel = new JPanel(); |
---|
1221 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1636 | + transformPanel = new cGridBag().setVertical(true); |
---|
| 1637 | + |
---|
| 1638 | + cGridBag resetTransformPanel = new cGridBag(); |
---|
| 1639 | + |
---|
| 1640 | + resetTransformPanel.preferredHeight = 2; |
---|
| 1641 | + |
---|
| 1642 | + cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF); |
---|
| 1643 | + resetTransform.setToolTipText("Reset Translation, Rotation and Scale"); |
---|
| 1644 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1645 | + { |
---|
| 1646 | + public void mouseClicked(MouseEvent e) |
---|
| 1647 | + { |
---|
| 1648 | + ResetTransform(); |
---|
| 1649 | + } |
---|
| 1650 | + }); |
---|
| 1651 | + resetTransformPanel.add(resetTransform); |
---|
| 1652 | + |
---|
| 1653 | + resetTransform = GetButton("T only", !Globals.NIMBUSLAF); |
---|
| 1654 | + resetTransform.setToolTipText("Reset Translation only"); |
---|
| 1655 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1656 | + { |
---|
| 1657 | + public void mouseClicked(MouseEvent e) |
---|
| 1658 | + { |
---|
| 1659 | + ResetTransform(1); |
---|
| 1660 | + } |
---|
| 1661 | + }); |
---|
| 1662 | + resetTransformPanel.add(resetTransform); |
---|
| 1663 | + |
---|
| 1664 | + resetTransform = GetButton("RS only", !Globals.NIMBUSLAF); |
---|
| 1665 | + resetTransform.setToolTipText("Reset Rotation and Scale only"); |
---|
| 1666 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1667 | + { |
---|
| 1668 | + public void mouseClicked(MouseEvent e) |
---|
| 1669 | + { |
---|
| 1670 | + ResetTransform(2); |
---|
| 1671 | + } |
---|
| 1672 | + }); |
---|
| 1673 | + resetTransformPanel.add(resetTransform); |
---|
| 1674 | + |
---|
| 1675 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1676 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1222 | 1677 | |
---|
1223 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1224 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1225 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1678 | + XYZPanel.preferredWidth = 5; |
---|
| 1679 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1680 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1681 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1682 | + //XYZPanel.setName("XYZ"); |
---|
1226 | 1683 | |
---|
| 1684 | + transformPanel.add(resetTransformPanel); |
---|
| 1685 | + transformPanel.add(XYZPanel); |
---|
| 1686 | + |
---|
1227 | 1687 | /* |
---|
1228 | 1688 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
1229 | 1689 | gridPanel.setLayout(new GridLayout(1, 2)); |
---|
.. | .. |
---|
1231 | 1691 | gridPanel.add(cameraView); |
---|
1232 | 1692 | gridPanel.add(XYZPanel); |
---|
1233 | 1693 | */ |
---|
1234 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1235 | | - gridPanel.setContinuousLayout(true); |
---|
1236 | | - gridPanel.setOneTouchExpandable(true); |
---|
1237 | | - gridPanel.setDividerLocation(1.0); |
---|
1238 | | - gridPanel.setDividerSize(9); |
---|
1239 | | - gridPanel.setResizeWeight(0.85); |
---|
| 1694 | +// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
| 1695 | +// gridPanel.setContinuousLayout(true); |
---|
| 1696 | +// gridPanel.setOneTouchExpandable(true); |
---|
| 1697 | +// gridPanel.setDividerLocation(1.0); |
---|
| 1698 | +// gridPanel.setDividerSize(9); |
---|
| 1699 | +// gridPanel.setResizeWeight(0.85); |
---|
1240 | 1700 | |
---|
1241 | 1701 | // aConstraints.weighty = 0; |
---|
1242 | 1702 | //System.out.println("THIS = " + this); |
---|
.. | .. |
---|
1259 | 1719 | |
---|
1260 | 1720 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1261 | 1721 | //tmp.setName("Edit"); |
---|
1262 | | - 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); |
---|
| 1722 | + objectPanel.add(skyboxPanel); |
---|
| 1723 | + objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg")); |
---|
| 1724 | + objectPanel.setToolTipTextAt(0, "Backgrounds"); |
---|
| 1725 | + |
---|
| 1726 | + objectPanel.add(toolboxPanel); |
---|
| 1727 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1728 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
1268 | 1729 | |
---|
| 1730 | + objectPanel.add(materialPanel); |
---|
| 1731 | + objectPanel.setIconAt(2, GetIcon("icons/material.png")); |
---|
| 1732 | + objectPanel.setToolTipTextAt(2, "Material"); |
---|
| 1733 | + |
---|
| 1734 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1735 | +// north.setName("Edit"); |
---|
| 1736 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1737 | +// objectPanel.add(north); |
---|
| 1738 | + objectPanel.add(editPanel); |
---|
| 1739 | + objectPanel.setIconAt(3, GetIcon("icons/writewhite.png")); |
---|
| 1740 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
| 1741 | + |
---|
| 1742 | + objectPanel.add(transformPanel); |
---|
| 1743 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1744 | + objectPanel.setToolTipTextAt(4, "TRS transform"); |
---|
| 1745 | + |
---|
| 1746 | + patchMaterial = true; |
---|
| 1747 | + cameraView.patchMaterial = this; |
---|
| 1748 | + objectPanel.setSelectedIndex(2); |
---|
| 1749 | + |
---|
1269 | 1750 | /* |
---|
1270 | 1751 | aConstraints.gridx = 0; |
---|
1271 | 1752 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1273 | 1754 | aConstraints.gridy += 1; |
---|
1274 | 1755 | aConstraints.gridwidth = 1; |
---|
1275 | 1756 | mainPanel.add(objectPanel, aConstraints); |
---|
1276 | | - */ |
---|
| 1757 | + */ |
---|
1277 | 1758 | |
---|
1278 | 1759 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1279 | 1760 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1284 | 1765 | scrollpane.setWheelScrollingEnabled(true); |
---|
1285 | 1766 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1286 | 1767 | |
---|
1287 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1288 | | - scenePanel.add(scrollpane); |
---|
| 1768 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1769 | + scenePanel.preferredWidth = 6; |
---|
| 1770 | + |
---|
| 1771 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1772 | + tabbedPane.add(scrollpane); |
---|
1289 | 1773 | |
---|
1290 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
1291 | | - |
---|
1292 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1774 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1293 | 1775 | |
---|
1294 | 1776 | optionsPanel.setName("Options"); |
---|
1295 | | - scenePanel.add(optionsPanel); |
---|
| 1777 | + |
---|
| 1778 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1779 | + |
---|
| 1780 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1296 | 1781 | |
---|
| 1782 | + tabbedPane.add(optionsPanel); |
---|
| 1783 | + |
---|
| 1784 | + scenePanel.add(tabbedPane); |
---|
| 1785 | + |
---|
| 1786 | + cGridBag creditsPanel = new cGridBag().setVertical(true); |
---|
| 1787 | + creditsPanel.setName("Credits"); |
---|
| 1788 | + |
---|
| 1789 | + cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
| 1790 | + creditsPanel.add(ogaLabel); |
---|
| 1791 | + |
---|
| 1792 | + cButton opengameartButton; |
---|
| 1793 | + creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
| 1794 | + opengameartButton.setToolTipText("https://opengameart.org"); |
---|
| 1795 | + |
---|
| 1796 | + opengameartButton.addMouseListener(new MouseAdapter() |
---|
| 1797 | + { |
---|
| 1798 | + public void mouseClicked(MouseEvent e) |
---|
| 1799 | + { |
---|
| 1800 | + try |
---|
| 1801 | + { |
---|
| 1802 | + Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/")); |
---|
| 1803 | + } catch (Exception e1) |
---|
| 1804 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1805 | + { |
---|
| 1806 | + e1.printStackTrace(); |
---|
| 1807 | + } |
---|
| 1808 | + } |
---|
| 1809 | + }); |
---|
| 1810 | + |
---|
| 1811 | + for (int i=10; --i>=0;) |
---|
| 1812 | + { |
---|
| 1813 | + creditsPanel.add(new cGridBag()); |
---|
| 1814 | + } |
---|
| 1815 | + |
---|
| 1816 | + tabbedPane.add(creditsPanel); |
---|
| 1817 | + tabbedPane.setToolTipTextAt(3, "Credits"); |
---|
| 1818 | + |
---|
| 1819 | + if (Globals.ADVANCED) |
---|
| 1820 | + { |
---|
| 1821 | + tabbedPane.add(infoPanel); |
---|
| 1822 | + tabbedPane.setIconAt(4, GetIcon("icons/info.png")); |
---|
| 1823 | + tabbedPane.setToolTipTextAt(4, "Information"); |
---|
| 1824 | + } |
---|
1297 | 1825 | |
---|
1298 | 1826 | /* |
---|
1299 | 1827 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1315 | 1843 | jtp.add(tree); |
---|
1316 | 1844 | */ |
---|
1317 | 1845 | |
---|
1318 | | - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
1319 | | - bigPanel.setContinuousLayout(true); |
---|
1320 | | - bigPanel.setOneTouchExpandable(true); |
---|
1321 | | - bigPanel.setDividerLocation(0.8); |
---|
1322 | | - bigPanel.setDividerSize(15); |
---|
1323 | | - bigPanel.setResizeWeight(0.15); |
---|
1324 | | - bigPanel.setName("Scene"); |
---|
| 1846 | +// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
| 1847 | +// bigPanel.setContinuousLayout(true); |
---|
| 1848 | +// bigPanel.setOneTouchExpandable(true); |
---|
| 1849 | +// bigPanel.setDividerLocation(0.8); |
---|
| 1850 | +// bigPanel.setDividerSize(15); |
---|
| 1851 | +// bigPanel.setResizeWeight(0.15); |
---|
| 1852 | +// bigPanel.setName("Scene"); |
---|
1325 | 1853 | |
---|
1326 | 1854 | //bigPanel.setLayout(new BorderLayout()); |
---|
1327 | 1855 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1328 | 1856 | //bigPanel.add(ctrlPanel); |
---|
1329 | 1857 | //bigPanel.add(gridPanel); |
---|
| 1858 | + /** |
---|
1330 | 1859 | bigThree = new JPanel(); |
---|
1331 | 1860 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1332 | 1861 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1350 | 1879 | // aConstraints.gridheight = 3; |
---|
1351 | 1880 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1352 | 1881 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1882 | + /**/ |
---|
1353 | 1883 | |
---|
| 1884 | + bigThree = new cGridBag(); |
---|
| 1885 | + bigThree.addComponent(scenePanel); |
---|
| 1886 | + bigThree.addComponent(centralPanel); |
---|
| 1887 | + //bigThree.addComponent(XYZPanel); |
---|
| 1888 | + |
---|
1354 | 1889 | // // SIDE EFFECT!!! |
---|
1355 | 1890 | // aConstraints.gridx = 0; |
---|
1356 | 1891 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1358 | 1893 | // aConstraints.gridheight = 1; |
---|
1359 | 1894 | |
---|
1360 | 1895 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1361 | | - framePanel.setContinuousLayout(true); |
---|
1362 | | - framePanel.setOneTouchExpandable(true); |
---|
1363 | | - framePanel.setDividerLocation(0.8); |
---|
| 1896 | + |
---|
| 1897 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1898 | + new java.beans.PropertyChangeListener() |
---|
| 1899 | + { |
---|
| 1900 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1901 | + { |
---|
| 1902 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1903 | + { |
---|
| 1904 | + if (radio.layout != expandedLayout) |
---|
| 1905 | + { |
---|
| 1906 | + radio.layout = expandedLayout; |
---|
| 1907 | + radio.layout.doClick(); |
---|
| 1908 | + } |
---|
| 1909 | + } |
---|
| 1910 | + } |
---|
| 1911 | + }); |
---|
| 1912 | + |
---|
| 1913 | + framePanel.setContinuousLayout(false); |
---|
| 1914 | + framePanel.setOneTouchExpandable(false); |
---|
| 1915 | + //.setDividerLocation(0.8); |
---|
1364 | 1916 | //framePanel.setDividerSize(15); |
---|
1365 | 1917 | //framePanel.setResizeWeight(0.15); |
---|
1366 | 1918 | framePanel.setName("Frame"); |
---|
1367 | 1919 | |
---|
1368 | 1920 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1369 | 1921 | /**/ |
---|
1370 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1922 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1371 | 1923 | //worldPane.add(bigPanel); |
---|
1372 | 1924 | //worldPane.add(worldPanel); |
---|
1373 | 1925 | /**/ |
---|
.. | .. |
---|
1377 | 1929 | |
---|
1378 | 1930 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1379 | 1931 | |
---|
1380 | | - frame.setSize(1024, 768); |
---|
1381 | | - frame.show(); |
---|
| 1932 | + frame.setSize(1280, 860); |
---|
| 1933 | + |
---|
| 1934 | + cameraView.requestFocusInWindow(); |
---|
| 1935 | + |
---|
| 1936 | +// gridPanel.setDividerLocation(1.0); |
---|
| 1937 | + |
---|
| 1938 | + frame.validate(); |
---|
1382 | 1939 | |
---|
1383 | | - gridPanel.setDividerLocation(1.0); |
---|
| 1940 | + frame.setVisible(true); |
---|
1384 | 1941 | |
---|
1385 | 1942 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1386 | 1943 | frame.addWindowListener(new WindowAdapter() |
---|
1387 | 1944 | { |
---|
1388 | | - |
---|
1389 | 1945 | public void windowClosing(WindowEvent e) |
---|
1390 | 1946 | { |
---|
1391 | 1947 | Close(); |
---|
.. | .. |
---|
1393 | 1949 | }); |
---|
1394 | 1950 | } |
---|
1395 | 1951 | |
---|
| 1952 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1953 | + { |
---|
| 1954 | + } |
---|
| 1955 | + |
---|
1396 | 1956 | JTree GetTree() |
---|
1397 | 1957 | { |
---|
1398 | 1958 | return objEditor.jTree; |
---|
.. | .. |
---|
1404 | 1964 | ctrlPanel.removeAll(); |
---|
1405 | 1965 | } |
---|
1406 | 1966 | |
---|
1407 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1967 | + void SetupMaterial(cGridBag materialpanel) |
---|
1408 | 1968 | { |
---|
1409 | | - aConstraints.weighty = 0; |
---|
1410 | | - //aConstraints.weightx = 1; |
---|
1411 | | - /* |
---|
| 1969 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1970 | + |
---|
| 1971 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF); |
---|
| 1972 | + skin.setToolTipText("Skin"); |
---|
| 1973 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1974 | + { |
---|
| 1975 | + public void mouseClicked(MouseEvent e) |
---|
| 1976 | + { |
---|
| 1977 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1978 | + cMaterial material = object.material; |
---|
| 1979 | + |
---|
| 1980 | + // Skin |
---|
| 1981 | + colorField.setFloat(material.color); |
---|
| 1982 | + float saturation = material.modulation; |
---|
| 1983 | + |
---|
| 1984 | + if (!cameraView.Skinshader) |
---|
| 1985 | + { |
---|
| 1986 | + saturation /= 1.5; |
---|
| 1987 | + } |
---|
| 1988 | + |
---|
| 1989 | + saturationField.setFloat(saturation); |
---|
| 1990 | + |
---|
| 1991 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1992 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1993 | + diffusenessField.setFloat(material.factor); |
---|
| 1994 | + shininessField.setFloat(material.shininess); |
---|
| 1995 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1996 | + diffuseField.setFloat(material.diffuse); |
---|
| 1997 | + specularField.setFloat(material.specular); |
---|
| 1998 | + |
---|
| 1999 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2000 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2001 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2002 | + |
---|
| 2003 | + materialtouched = true; |
---|
| 2004 | + applySelf(); |
---|
| 2005 | + } |
---|
| 2006 | + }); |
---|
| 2007 | + presetpanel.add(skin); |
---|
| 2008 | + |
---|
| 2009 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF); |
---|
| 2010 | + lambert.setToolTipText("Diffuse"); |
---|
| 2011 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 2012 | + { |
---|
| 2013 | + public void mouseClicked(MouseEvent e) |
---|
| 2014 | + { |
---|
| 2015 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 2016 | + cMaterial material = object.material; |
---|
| 2017 | + |
---|
| 2018 | + diffusenessField.setFloat(material.factor); |
---|
| 2019 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2020 | + |
---|
| 2021 | + materialtouched = true; |
---|
| 2022 | + applySelf(); |
---|
| 2023 | + } |
---|
| 2024 | + }); |
---|
| 2025 | + presetpanel.add(lambert); |
---|
| 2026 | + |
---|
| 2027 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF); |
---|
| 2028 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 2029 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 2030 | + { |
---|
| 2031 | + public void mouseClicked(MouseEvent e) |
---|
| 2032 | + { |
---|
| 2033 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 2034 | + cMaterial material = object.material; |
---|
| 2035 | + |
---|
| 2036 | + diffusenessField.setFloat(material.factor); |
---|
| 2037 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2038 | + |
---|
| 2039 | + materialtouched = true; |
---|
| 2040 | + applySelf(); |
---|
| 2041 | + } |
---|
| 2042 | + }); |
---|
| 2043 | + presetpanel.add(diffuse2); |
---|
| 2044 | + |
---|
| 2045 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF); |
---|
| 2046 | + diffusemoon.setToolTipText("Moon"); |
---|
| 2047 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 2048 | + { |
---|
| 2049 | + public void mouseClicked(MouseEvent e) |
---|
| 2050 | + { |
---|
| 2051 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 2052 | + cMaterial material = object.material; |
---|
| 2053 | + |
---|
| 2054 | + diffusenessField.setFloat(material.factor); |
---|
| 2055 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2056 | + |
---|
| 2057 | + materialtouched = true; |
---|
| 2058 | + applySelf(); |
---|
| 2059 | + } |
---|
| 2060 | + }); |
---|
| 2061 | + presetpanel.add(diffusemoon); |
---|
| 2062 | + |
---|
| 2063 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF); |
---|
| 2064 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 2065 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 2066 | + { |
---|
| 2067 | + public void mouseClicked(MouseEvent e) |
---|
| 2068 | + { |
---|
| 2069 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 2070 | + cMaterial material = object.material; |
---|
| 2071 | + |
---|
| 2072 | + diffusenessField.setFloat(material.factor); |
---|
| 2073 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2074 | + |
---|
| 2075 | + materialtouched = true; |
---|
| 2076 | + applySelf(); |
---|
| 2077 | + } |
---|
| 2078 | + }); |
---|
| 2079 | + presetpanel.add(diffusemoon2); |
---|
| 2080 | + |
---|
| 2081 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF); |
---|
| 2082 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 2083 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 2084 | + { |
---|
| 2085 | + public void mouseClicked(MouseEvent e) |
---|
| 2086 | + { |
---|
| 2087 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 2088 | + cMaterial material = object.material; |
---|
| 2089 | + |
---|
| 2090 | + diffusenessField.setFloat(material.factor); |
---|
| 2091 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2092 | + |
---|
| 2093 | + materialtouched = true; |
---|
| 2094 | + applySelf(); |
---|
| 2095 | + } |
---|
| 2096 | + }); |
---|
| 2097 | + presetpanel.add(diffusemoon3); |
---|
| 2098 | + |
---|
| 2099 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF); |
---|
| 2100 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 2101 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 2102 | + { |
---|
| 2103 | + public void mouseClicked(MouseEvent e) |
---|
| 2104 | + { |
---|
| 2105 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 2106 | + cMaterial material = object.material; |
---|
| 2107 | + |
---|
| 2108 | + sheenField.setFloat(material.sheen); |
---|
| 2109 | + |
---|
| 2110 | + materialtouched = true; |
---|
| 2111 | + applySelf(); |
---|
| 2112 | + } |
---|
| 2113 | + }); |
---|
| 2114 | + presetpanel.add(diffusesheen); |
---|
| 2115 | + |
---|
| 2116 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF); |
---|
| 2117 | + rough.setToolTipText("Rough metal"); |
---|
| 2118 | + rough.addMouseListener(new MouseAdapter() |
---|
| 2119 | + { |
---|
| 2120 | + public void mouseClicked(MouseEvent e) |
---|
| 2121 | + { |
---|
| 2122 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 2123 | + cMaterial material = object.material; |
---|
| 2124 | + |
---|
| 2125 | + shininessField.setFloat(material.shininess); |
---|
| 2126 | + velvetField.setFloat(material.velvet); |
---|
| 2127 | + |
---|
| 2128 | + materialtouched = true; |
---|
| 2129 | + applySelf(); |
---|
| 2130 | + } |
---|
| 2131 | + }); |
---|
| 2132 | + presetpanel.add(rough); |
---|
| 2133 | + |
---|
| 2134 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF); |
---|
| 2135 | + rough2.setToolTipText("Medium metal"); |
---|
| 2136 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 2137 | + { |
---|
| 2138 | + public void mouseClicked(MouseEvent e) |
---|
| 2139 | + { |
---|
| 2140 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2141 | + cMaterial material = object.material; |
---|
| 2142 | + |
---|
| 2143 | + shininessField.setFloat(material.shininess); |
---|
| 2144 | + lightareaField.setFloat(material.lightarea); |
---|
| 2145 | + |
---|
| 2146 | + materialtouched = true; |
---|
| 2147 | + applySelf(); |
---|
| 2148 | + } |
---|
| 2149 | + }); |
---|
| 2150 | + presetpanel.add(rough2); |
---|
| 2151 | + |
---|
| 2152 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF); |
---|
| 2153 | + shini0.setToolTipText("Shiny"); |
---|
| 2154 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2155 | + { |
---|
| 2156 | + public void mouseClicked(MouseEvent e) |
---|
| 2157 | + { |
---|
| 2158 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2159 | + cMaterial material = object.material; |
---|
| 2160 | + |
---|
| 2161 | + shininessField.setFloat(material.shininess); |
---|
| 2162 | + lightareaField.setFloat(material.lightarea); |
---|
| 2163 | + |
---|
| 2164 | + materialtouched = true; |
---|
| 2165 | + applySelf(); |
---|
| 2166 | + } |
---|
| 2167 | + }); |
---|
| 2168 | + presetpanel.add(shini0); |
---|
| 2169 | + |
---|
| 2170 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF); |
---|
| 2171 | + shini1.setToolTipText("Shiny2"); |
---|
| 2172 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2173 | + { |
---|
| 2174 | + public void mouseClicked(MouseEvent e) |
---|
| 2175 | + { |
---|
| 2176 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2177 | + cMaterial material = object.material; |
---|
| 2178 | + |
---|
| 2179 | + shininessField.setFloat(material.shininess); |
---|
| 2180 | + lightareaField.setFloat(material.lightarea); |
---|
| 2181 | + |
---|
| 2182 | + materialtouched = true; |
---|
| 2183 | + applySelf(); |
---|
| 2184 | + } |
---|
| 2185 | + }); |
---|
| 2186 | + presetpanel.add(shini1); |
---|
| 2187 | + |
---|
| 2188 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF); |
---|
| 2189 | + shini2.setToolTipText("Shiny3"); |
---|
| 2190 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2191 | + { |
---|
| 2192 | + public void mouseClicked(MouseEvent e) |
---|
| 2193 | + { |
---|
| 2194 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2195 | + cMaterial material = object.material; |
---|
| 2196 | + |
---|
| 2197 | + shininessField.setFloat(material.shininess); |
---|
| 2198 | + lightareaField.setFloat(material.lightarea); |
---|
| 2199 | + |
---|
| 2200 | + materialtouched = true; |
---|
| 2201 | + applySelf(); |
---|
| 2202 | + } |
---|
| 2203 | + }); |
---|
| 2204 | + presetpanel.add(shini2); |
---|
| 2205 | + |
---|
| 2206 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF); |
---|
| 2207 | + aniso.setToolTipText("AnisoU"); |
---|
| 2208 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2209 | + { |
---|
| 2210 | + public void mouseClicked(MouseEvent e) |
---|
| 2211 | + { |
---|
| 2212 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2213 | + cMaterial material = object.material; |
---|
| 2214 | + |
---|
| 2215 | + anisoField.setFloat(material.aniso); |
---|
| 2216 | + anisoVField.setFloat(material.anisoV); |
---|
| 2217 | + |
---|
| 2218 | + materialtouched = true; |
---|
| 2219 | + applySelf(); |
---|
| 2220 | + } |
---|
| 2221 | + }); |
---|
| 2222 | + presetpanel.add(aniso); |
---|
| 2223 | + |
---|
| 2224 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF); |
---|
| 2225 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2226 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2227 | + { |
---|
| 2228 | + public void mouseClicked(MouseEvent e) |
---|
| 2229 | + { |
---|
| 2230 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2231 | + cMaterial material = object.material; |
---|
| 2232 | + |
---|
| 2233 | + anisoField.setFloat(material.aniso); |
---|
| 2234 | + anisoVField.setFloat(material.anisoV); |
---|
| 2235 | + |
---|
| 2236 | + materialtouched = true; |
---|
| 2237 | + applySelf(); |
---|
| 2238 | + } |
---|
| 2239 | + }); |
---|
| 2240 | + presetpanel.add(aniso2); |
---|
| 2241 | + |
---|
| 2242 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF); |
---|
| 2243 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2244 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2245 | + { |
---|
| 2246 | + public void mouseClicked(MouseEvent e) |
---|
| 2247 | + { |
---|
| 2248 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2249 | + cMaterial material = object.material; |
---|
| 2250 | + |
---|
| 2251 | + anisoField.setFloat(material.aniso); |
---|
| 2252 | + anisoVField.setFloat(material.anisoV); |
---|
| 2253 | + |
---|
| 2254 | + materialtouched = true; |
---|
| 2255 | + applySelf(); |
---|
| 2256 | + } |
---|
| 2257 | + }); |
---|
| 2258 | + presetpanel.add(aniso3); |
---|
| 2259 | + |
---|
| 2260 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF); |
---|
| 2261 | + velvet0.setToolTipText("Velvet"); |
---|
| 2262 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2263 | + { |
---|
| 2264 | + public void mouseClicked(MouseEvent e) |
---|
| 2265 | + { |
---|
| 2266 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2267 | + cMaterial material = object.material; |
---|
| 2268 | + |
---|
| 2269 | + diffusenessField.setFloat(material.factor); |
---|
| 2270 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2271 | + sheenField.setFloat(material.sheen); |
---|
| 2272 | + shininessField.setFloat(material.shininess); |
---|
| 2273 | + velvetField.setFloat(material.velvet); |
---|
| 2274 | + shiftField.setFloat(material.shift); |
---|
| 2275 | + |
---|
| 2276 | + materialtouched = true; |
---|
| 2277 | + applySelf(); |
---|
| 2278 | + } |
---|
| 2279 | + }); |
---|
| 2280 | + presetpanel.add(velvet0); |
---|
| 2281 | + |
---|
| 2282 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF); |
---|
| 2283 | + bump0.setToolTipText("Bump texture"); |
---|
| 2284 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2285 | + { |
---|
| 2286 | + public void mouseClicked(MouseEvent e) |
---|
| 2287 | + { |
---|
| 2288 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2289 | + cMaterial material = object.material; |
---|
| 2290 | + |
---|
| 2291 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2292 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2293 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2294 | + |
---|
| 2295 | + materialtouched = true; |
---|
| 2296 | + applySelf(); |
---|
| 2297 | + } |
---|
| 2298 | + }); |
---|
| 2299 | + presetpanel.add(bump0); |
---|
| 2300 | + |
---|
| 2301 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF); |
---|
| 2302 | + borderShader.setToolTipText("Border fade"); |
---|
| 2303 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2304 | + { |
---|
| 2305 | + public void mouseClicked(MouseEvent e) |
---|
| 2306 | + { |
---|
| 2307 | + borderfadeField.setFloat(0.5); |
---|
| 2308 | + opacityField.setFloat(0.75); |
---|
| 2309 | + |
---|
| 2310 | + materialtouched = true; |
---|
| 2311 | + applySelf(); |
---|
| 2312 | + } |
---|
| 2313 | + }); |
---|
| 2314 | + presetpanel.add(borderShader); |
---|
| 2315 | + |
---|
| 2316 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF); |
---|
| 2317 | + halo.setToolTipText("Halo"); |
---|
| 2318 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2319 | + { |
---|
| 2320 | + public void mouseClicked(MouseEvent e) |
---|
| 2321 | + { |
---|
| 2322 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2323 | + cMaterial material = object.material; |
---|
| 2324 | + |
---|
| 2325 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2326 | + |
---|
| 2327 | + materialtouched = true; |
---|
| 2328 | + applySelf(); |
---|
| 2329 | + } |
---|
| 2330 | + }); |
---|
| 2331 | + presetpanel.add(halo); |
---|
| 2332 | + |
---|
| 2333 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF); |
---|
| 2334 | + candle.setToolTipText("Candle"); |
---|
| 2335 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2336 | + { |
---|
| 2337 | + public void mouseClicked(MouseEvent e) |
---|
| 2338 | + { |
---|
| 2339 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2340 | + cMaterial material = object.material; |
---|
| 2341 | + |
---|
| 2342 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2343 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2344 | + ambientField.setFloat(material.ambient); |
---|
| 2345 | + specularField.setFloat(material.specular); |
---|
| 2346 | + lightareaField.setFloat(material.lightarea); |
---|
| 2347 | + shininessField.setFloat(material.shininess); |
---|
| 2348 | + |
---|
| 2349 | + materialtouched = true; |
---|
| 2350 | + applySelf(); |
---|
| 2351 | + } |
---|
| 2352 | + }); |
---|
| 2353 | + presetpanel.add(candle); |
---|
| 2354 | + |
---|
| 2355 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF); |
---|
| 2356 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2357 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2358 | + { |
---|
| 2359 | + public void mouseClicked(MouseEvent e) |
---|
| 2360 | + { |
---|
| 2361 | + diffuseField.setFloat(0.001); |
---|
| 2362 | + ambientField.setFloat(0.001); |
---|
| 2363 | + cameraField.setFloat(0.001); |
---|
| 2364 | + specularField.setFloat(0.001); |
---|
| 2365 | + fakedepthField.setFloat(0.001); |
---|
| 2366 | + opacityField.setFloat(0.6); |
---|
| 2367 | + |
---|
| 2368 | + materialtouched = true; |
---|
| 2369 | + applySelf(); |
---|
| 2370 | + } |
---|
| 2371 | + }); |
---|
| 2372 | + presetpanel.add(shadowShader); |
---|
| 2373 | + |
---|
| 2374 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2375 | + |
---|
| 2376 | + presetpanel.preferredWidth = 1; |
---|
| 2377 | + |
---|
| 2378 | + materialpanel.add(presetpanel); |
---|
| 2379 | + materialpanel.add(panel); |
---|
| 2380 | + |
---|
| 2381 | + panel.preferredWidth = 8; |
---|
| 2382 | + |
---|
| 2383 | + /* |
---|
1412 | 2384 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1413 | 2385 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1414 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1415 | | - aConstraints.gridx += 1; |
---|
1416 | | - */ |
---|
| 2386 | + */ |
---|
1417 | 2387 | |
---|
1418 | | - aConstraints.gridwidth = 1; |
---|
1419 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1420 | | - aConstraints.gridx += 1; |
---|
1421 | | - aConstraints.weighty = 0; |
---|
1422 | | - aConstraints.gridwidth = 1; |
---|
| 2388 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 2389 | + |
---|
| 2390 | + editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
| 2391 | + createMaterialButton.setToolTipText("Create material"); |
---|
1423 | 2392 | |
---|
1424 | 2393 | /* |
---|
1425 | 2394 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1426 | | - aConstraints.gridx += 1; |
---|
1427 | | - aConstraints.weighty = 0; |
---|
1428 | | - aConstraints.gridwidth = 1; |
---|
1429 | 2395 | */ |
---|
1430 | 2396 | |
---|
1431 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1432 | | - aConstraints.gridx += 1; |
---|
| 2397 | + editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
| 2398 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 2399 | + |
---|
| 2400 | + if (Globals.ADVANCED) |
---|
| 2401 | + { |
---|
| 2402 | + editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
| 2403 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 2404 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 2405 | + } |
---|
1433 | 2406 | |
---|
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; |
---|
| 2407 | + editBar.preferredHeight = 15; |
---|
| 2408 | + |
---|
| 2409 | + panel.add(editBar); |
---|
| 2410 | + |
---|
1448 | 2411 | /**/ |
---|
1449 | 2412 | //aConstraints.weighty = 0; |
---|
1450 | 2413 | ////aConstraints.weightx = 1; |
---|
1451 | 2414 | //aConstraints.weighty = 1; |
---|
1452 | 2415 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1453 | 2416 | //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; |
---|
| 2417 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1459 | 2418 | |
---|
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; |
---|
| 2419 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
1470 | 2420 | |
---|
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; |
---|
| 2421 | + cGridBag huepanel = new cGridBag(); |
---|
| 2422 | + cGridBag huelabel = new cGridBag(); |
---|
| 2423 | + cLabel hue = GetLabel("icons/hue.png", false); |
---|
| 2424 | + hue.fit = true; |
---|
| 2425 | + |
---|
| 2426 | + hue.addMouseListener(new MouseAdapter() |
---|
| 2427 | + { |
---|
| 2428 | + public void mousePressed(MouseEvent e) |
---|
| 2429 | + { |
---|
| 2430 | + int x = e.getX(); |
---|
| 2431 | + |
---|
| 2432 | + colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth()); |
---|
| 2433 | + } |
---|
| 2434 | + }); |
---|
| 2435 | + |
---|
| 2436 | + huelabel.add(hue); |
---|
| 2437 | + huelabel.preferredWidth = 20; |
---|
| 2438 | + huepanel.add(new cGridBag()); // Label |
---|
| 2439 | + huepanel.add(huelabel); // Field/slider |
---|
| 2440 | + |
---|
| 2441 | + huepanel.preferredHeight = 7; |
---|
1480 | 2442 | |
---|
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; |
---|
| 2443 | + colorSection.add(huepanel); |
---|
| 2444 | + |
---|
| 2445 | + cGridBag color = new cGridBag(); |
---|
| 2446 | + |
---|
| 2447 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2448 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2449 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1490 | 2450 | |
---|
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; |
---|
| 2451 | + //colorField.preferredWidth = 200; |
---|
| 2452 | + colorSection.add(color); |
---|
1500 | 2453 | |
---|
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; |
---|
| 2454 | + cGridBag modulation = new cGridBag(); |
---|
| 2455 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 2456 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2457 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2458 | + colorSection.add(modulation); |
---|
1510 | 2459 | |
---|
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; |
---|
| 2460 | + cGridBag opacity = new cGridBag(); |
---|
| 2461 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2462 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2463 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2464 | + colorSection.add(opacity); |
---|
1520 | 2465 | |
---|
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; |
---|
| 2466 | + colorSection.add(GetSeparator()); |
---|
| 2467 | + |
---|
| 2468 | + cGridBag texture = new cGridBag(); |
---|
| 2469 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 2470 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2471 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2472 | + colorSection.add(texture); |
---|
1529 | 2473 | |
---|
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; |
---|
| 2474 | + panel.add(GetSeparator()); |
---|
| 2475 | + |
---|
| 2476 | + panel.add(colorSection); |
---|
| 2477 | + |
---|
| 2478 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2479 | + |
---|
| 2480 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 2481 | + |
---|
| 2482 | + cGridBag diffuse = new cGridBag(); |
---|
| 2483 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 2484 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2485 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2486 | + diffuseSection.add(diffuse); |
---|
1539 | 2487 | |
---|
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; |
---|
| 2488 | + cGridBag diffuseness = new cGridBag(); |
---|
| 2489 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 2490 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2491 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2492 | + diffuseSection.add(diffuseness); |
---|
1549 | 2493 | |
---|
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; |
---|
| 2494 | + cGridBag selfshadow = new cGridBag(); |
---|
| 2495 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 2496 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2497 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2498 | + diffuseSection.add(selfshadow); |
---|
1559 | 2499 | |
---|
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; |
---|
| 2500 | + cGridBag sheen = new cGridBag(); |
---|
| 2501 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 2502 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2503 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2504 | + diffuseSection.add(sheen); |
---|
1569 | 2505 | |
---|
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; |
---|
| 2506 | + cGridBag subsurface = new cGridBag(); |
---|
| 2507 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 2508 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2509 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2510 | + diffuseSection.add(subsurface); |
---|
1579 | 2511 | |
---|
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; |
---|
| 2512 | + cGridBag shadow = new cGridBag(); |
---|
| 2513 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 2514 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2515 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2516 | + diffuseSection.add(shadow); |
---|
1589 | 2517 | |
---|
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; |
---|
| 2518 | + cGridBag fakedepth = new cGridBag(); |
---|
| 2519 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 2520 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2521 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2522 | + diffuseSection.add(fakedepth); |
---|
1599 | 2523 | |
---|
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; |
---|
| 2524 | + cGridBag shadowbias = new cGridBag(); |
---|
| 2525 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 2526 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2527 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2528 | + diffuseSection.add(shadowbias); |
---|
1608 | 2529 | |
---|
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; |
---|
| 2530 | + panel.add(GetSeparator()); |
---|
| 2531 | + |
---|
| 2532 | + panel.add(diffuseSection); |
---|
| 2533 | + |
---|
| 2534 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2535 | + |
---|
| 2536 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1618 | 2537 | |
---|
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; |
---|
| 2538 | + cGridBag specular = new cGridBag(); |
---|
| 2539 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 2540 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2541 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2542 | + specularSection.add(specular); |
---|
1628 | 2543 | |
---|
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; |
---|
| 2544 | + cGridBag lightarea = new cGridBag(); |
---|
| 2545 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 2546 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2547 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2548 | + specularSection.add(lightarea); |
---|
1638 | 2549 | |
---|
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; |
---|
| 2550 | + cGridBag shininess = new cGridBag(); |
---|
| 2551 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 2552 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2553 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2554 | + specularSection.add(shininess); |
---|
1648 | 2555 | |
---|
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; |
---|
| 2556 | + cGridBag metalness = new cGridBag(); |
---|
| 2557 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 2558 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2559 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2560 | + specularSection.add(metalness); |
---|
1658 | 2561 | |
---|
1659 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1660 | | - Return(); |
---|
| 2562 | + cGridBag velvet = new cGridBag(); |
---|
| 2563 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 2564 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2565 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2566 | + specularSection.add(velvet); |
---|
| 2567 | + |
---|
| 2568 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 2569 | + //Return(); |
---|
1661 | 2570 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1662 | 2571 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1663 | 2572 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1668 | 2577 | // aConstraints.gridy += 1; |
---|
1669 | 2578 | // aConstraints.gridwidth = 1; |
---|
1670 | 2579 | |
---|
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; |
---|
| 2580 | + cGridBag anisoU = new cGridBag(); |
---|
| 2581 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 2582 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2583 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2584 | + specularSection.add(anisoU); |
---|
1679 | 2585 | |
---|
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; |
---|
| 2586 | + cGridBag anisoV = new cGridBag(); |
---|
| 2587 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 2588 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2589 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2590 | + specularSection.add(anisoV); |
---|
1689 | 2591 | |
---|
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 | 2592 | |
---|
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; |
---|
| 2593 | + panel.add(GetSeparator()); |
---|
| 2594 | + |
---|
| 2595 | + panel.add(specularSection); |
---|
| 2596 | + |
---|
| 2597 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2598 | + |
---|
| 2599 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1709 | 2600 | |
---|
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; |
---|
| 2601 | + cGridBag camera = new cGridBag(); |
---|
| 2602 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 2603 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2604 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2605 | + colorSection.add(camera); |
---|
1720 | 2606 | |
---|
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; |
---|
| 2607 | + cGridBag ambient = new cGridBag(); |
---|
| 2608 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 2609 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2610 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2611 | + colorSection.add(ambient); |
---|
1730 | 2612 | |
---|
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; |
---|
| 2613 | + cGridBag backlit = new cGridBag(); |
---|
| 2614 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 2615 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2616 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2617 | + colorSection.add(backlit); |
---|
1740 | 2618 | |
---|
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; |
---|
| 2619 | + //panel.add(new JSeparator()); |
---|
| 2620 | + |
---|
| 2621 | + //panel.add(globalSection); |
---|
| 2622 | + |
---|
| 2623 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2624 | + |
---|
| 2625 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1750 | 2626 | |
---|
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; |
---|
| 2627 | + cGridBag bump = new cGridBag(); |
---|
| 2628 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 2629 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2630 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2631 | + textureSection.add(bump); |
---|
1760 | 2632 | |
---|
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; |
---|
| 2633 | + cGridBag noise = new cGridBag(); |
---|
| 2634 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 2635 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2636 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 2637 | + textureSection.add(noise); |
---|
1770 | 2638 | |
---|
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; |
---|
| 2639 | + cGridBag power = new cGridBag(); |
---|
| 2640 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 2641 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2642 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 2643 | + textureSection.add(power); |
---|
1780 | 2644 | |
---|
1781 | | - //aConstraints.weighty = 1; |
---|
1782 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1783 | | - //aConstraints.gridx += 1; |
---|
1784 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1785 | | - aConstraints.weighty = 0; |
---|
| 2645 | + cGridBag borderfade = new cGridBag(); |
---|
| 2646 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 2647 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2648 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2649 | + textureSection.add(borderfade); |
---|
1786 | 2650 | |
---|
1787 | | - aConstraints.gridx = 0; |
---|
1788 | | - aConstraints.gridy = 0; |
---|
1789 | | - aConstraints.gridwidth = 1; |
---|
| 2651 | + cGridBag fog = new cGridBag(); |
---|
| 2652 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 2653 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2654 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 2655 | + textureSection.add(fog); |
---|
| 2656 | + |
---|
| 2657 | + cGridBag opacityPower = new cGridBag(); |
---|
| 2658 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 2659 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2660 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 2661 | + textureSection.add(opacityPower); |
---|
| 2662 | + |
---|
| 2663 | + panel.add(GetSeparator()); |
---|
| 2664 | + |
---|
| 2665 | + panel.add(textureSection); |
---|
| 2666 | + |
---|
| 2667 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1790 | 2668 | |
---|
1791 | 2669 | SetMaterial(copy); // .GetMaterial()); |
---|
1792 | 2670 | |
---|
1793 | | - colorField.addChangeListener(this); |
---|
1794 | | - modulationField.addChangeListener(this); |
---|
| 2671 | + //colorField.addChangeListener(this); |
---|
| 2672 | +// modulationField.addChangeListener(this); |
---|
1795 | 2673 | metalnessField.addChangeListener(this); |
---|
1796 | 2674 | diffuseField.addChangeListener(this); |
---|
1797 | 2675 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1821 | 2699 | opacityPowerField.addChangeListener(this); |
---|
1822 | 2700 | /**/ |
---|
1823 | 2701 | |
---|
1824 | | - resetSlidersButton.addActionListener(this); |
---|
1825 | 2702 | clearMaterialButton.addActionListener(this); |
---|
1826 | 2703 | createMaterialButton.addActionListener(this); |
---|
1827 | | - |
---|
1828 | | - propagateToggle.addItemListener(this); |
---|
1829 | | - multiplyToggle.addItemListener(this); |
---|
| 2704 | + |
---|
| 2705 | + if (Globals.ADVANCED) |
---|
| 2706 | + { |
---|
| 2707 | + resetSlidersButton.addActionListener(this); |
---|
| 2708 | + propagateToggle.addItemListener(this); |
---|
| 2709 | + multiplyToggle.addItemListener(this); |
---|
| 2710 | + } |
---|
1830 | 2711 | } |
---|
1831 | 2712 | |
---|
1832 | 2713 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1844 | 2725 | // 3D models |
---|
1845 | 2726 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1846 | 2727 | { |
---|
1847 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1848 | | - LoadFile(filename, lastConverter); |
---|
| 2728 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2729 | + //LoadFile(filename, lastConverter); |
---|
| 2730 | + LoadObjFile(filename); // New 3ds loader |
---|
1849 | 2731 | continue; |
---|
1850 | 2732 | } |
---|
1851 | 2733 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
1997 | 2879 | |
---|
1998 | 2880 | //? flashIt = false; |
---|
1999 | 2881 | CameraPane pane = (CameraPane) cameraView; |
---|
2000 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2882 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
2001 | 2883 | pane.clickEnd(location.x, location.y, 0, true); |
---|
2002 | 2884 | |
---|
2003 | 2885 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2046 | 2928 | e2.printStackTrace(); |
---|
2047 | 2929 | } |
---|
2048 | 2930 | } |
---|
| 2931 | + |
---|
2049 | 2932 | LoadJMEThread loadThread; |
---|
2050 | 2933 | |
---|
2051 | 2934 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2103 | 2986 | //LoadFile0(filename, converter); |
---|
2104 | 2987 | } |
---|
2105 | 2988 | } |
---|
| 2989 | + |
---|
2106 | 2990 | LoadOBJThread loadObjThread; |
---|
2107 | 2991 | |
---|
2108 | 2992 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2181 | 3065 | |
---|
2182 | 3066 | void LoadObjFile(String fullname) |
---|
2183 | 3067 | { |
---|
2184 | | - /* |
---|
| 3068 | + System.out.println("Loading " + fullname); |
---|
| 3069 | + /**/ |
---|
2185 | 3070 | //lastFilename = fullname; |
---|
2186 | 3071 | if(loadObjThread == null) |
---|
2187 | 3072 | { |
---|
2188 | | - loadObjThread = new LoadOBJThread(); |
---|
2189 | | - loadObjThread.start(); |
---|
| 3073 | + loadObjThread = new LoadOBJThread(); |
---|
| 3074 | + loadObjThread.start(); |
---|
2190 | 3075 | } |
---|
2191 | 3076 | |
---|
2192 | 3077 | loadObjThread.add(fullname); |
---|
2193 | | - */ |
---|
| 3078 | + /**/ |
---|
2194 | 3079 | |
---|
2195 | | - System.out.println("Loading " + fullname); |
---|
2196 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 3080 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2197 | 3081 | } |
---|
2198 | 3082 | |
---|
2199 | 3083 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2454 | 3338 | |
---|
2455 | 3339 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2456 | 3340 | { |
---|
2457 | | - if (GrafreeD.standAlone) |
---|
| 3341 | + if (Grafreed.standAlone) |
---|
2458 | 3342 | { |
---|
2459 | 3343 | /**/ |
---|
2460 | 3344 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2461 | | - browser.show(); |
---|
| 3345 | + browser.setVisible(true); |
---|
2462 | 3346 | String filename = browser.getFile(); |
---|
2463 | 3347 | if (filename != null && filename.length() > 0) |
---|
2464 | 3348 | { |
---|
.. | .. |
---|
2569 | 3453 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2570 | 3454 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2571 | 3455 | } |
---|
| 3456 | + |
---|
2572 | 3457 | //cJME.count++; |
---|
2573 | 3458 | //cJME.count %= 12; |
---|
2574 | 3459 | if (gc) |
---|
.. | .. |
---|
2603 | 3488 | } |
---|
2604 | 3489 | if (input == null) |
---|
2605 | 3490 | { |
---|
| 3491 | + new Exception().printStackTrace(); |
---|
2606 | 3492 | System.exit(0); |
---|
2607 | 3493 | } |
---|
2608 | 3494 | |
---|
.. | .. |
---|
2751 | 3637 | } |
---|
2752 | 3638 | } |
---|
2753 | 3639 | } |
---|
| 3640 | + |
---|
2754 | 3641 | cFileSystemPane FSPane; |
---|
2755 | 3642 | |
---|
2756 | 3643 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2760 | 3647 | |
---|
2761 | 3648 | freezematerial = true; |
---|
2762 | 3649 | colorField.setFloat(mat.color); |
---|
2763 | | - modulationField.setFloat(mat.modulation); |
---|
| 3650 | + saturationField.setFloat(mat.modulation); |
---|
2764 | 3651 | metalnessField.setFloat(mat.metalness); |
---|
2765 | 3652 | diffuseField.setFloat(mat.diffuse); |
---|
2766 | 3653 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
2804 | 3691 | } |
---|
2805 | 3692 | } |
---|
2806 | 3693 | } |
---|
| 3694 | + |
---|
2807 | 3695 | freezematerial = false; |
---|
2808 | 3696 | } |
---|
2809 | 3697 | |
---|
2810 | 3698 | void SetMaterial(Object3D object) |
---|
2811 | 3699 | { |
---|
| 3700 | + latestObject = object; |
---|
| 3701 | + |
---|
2812 | 3702 | cMaterial mat = object.material; |
---|
2813 | 3703 | |
---|
2814 | 3704 | if (mat == null) |
---|
.. | .. |
---|
2817 | 3707 | return; |
---|
2818 | 3708 | } |
---|
2819 | 3709 | |
---|
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 | | - } |
---|
| 3710 | + if (multiplyToggle != null) |
---|
| 3711 | + multiplyToggle.setSelected(mat.multiply); |
---|
| 3712 | + |
---|
| 3713 | + AllocProjectedVertices(object); |
---|
2847 | 3714 | |
---|
2848 | 3715 | SetMaterial(mat, object.projectedVertices); |
---|
2849 | 3716 | } |
---|
.. | .. |
---|
2919 | 3786 | // } |
---|
2920 | 3787 | |
---|
2921 | 3788 | /**/ |
---|
2922 | | - if (deselect) |
---|
| 3789 | + if (deselect || child == null) |
---|
2923 | 3790 | { |
---|
2924 | 3791 | //group.deselectAll(); |
---|
2925 | 3792 | //freeze = true; |
---|
2926 | 3793 | GetTree().clearSelection(); |
---|
2927 | 3794 | //freeze = false; |
---|
| 3795 | + |
---|
| 3796 | + if (child == null) |
---|
| 3797 | + { |
---|
| 3798 | + return; |
---|
| 3799 | + } |
---|
2928 | 3800 | } |
---|
2929 | 3801 | |
---|
2930 | 3802 | //group.addSelectee(child); |
---|
.. | .. |
---|
2958 | 3830 | public void itemStateChanged(ItemEvent event) |
---|
2959 | 3831 | { |
---|
2960 | 3832 | // System.out.println("Propagate = " + propagate); |
---|
| 3833 | + if (event.getSource() == pinButton) |
---|
| 3834 | + { |
---|
| 3835 | + copy.pinned ^= true; |
---|
| 3836 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3837 | + { |
---|
| 3838 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3839 | + copy.CloseUI(); |
---|
| 3840 | + //copy.editWindow.refreshContents(); |
---|
| 3841 | + } |
---|
| 3842 | + } |
---|
| 3843 | + else |
---|
2961 | 3844 | if (event.getSource() == propagateToggle) |
---|
2962 | 3845 | { |
---|
2963 | 3846 | propagate ^= true; |
---|
.. | .. |
---|
2993 | 3876 | cameraView.ToggleDL(); |
---|
2994 | 3877 | cameraView.repaint(); |
---|
2995 | 3878 | return; |
---|
2996 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3879 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2997 | 3880 | { |
---|
2998 | 3881 | cameraView.ToggleTexture(); |
---|
2999 | 3882 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
3032 | 3915 | frame.validate(); |
---|
3033 | 3916 | |
---|
3034 | 3917 | return; |
---|
3035 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3918 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
3036 | 3919 | { |
---|
3037 | | - cameraView.ToggleRandom(); |
---|
| 3920 | + cameraView.ToggleSwitch(); |
---|
3038 | 3921 | cameraView.repaint(); |
---|
3039 | 3922 | return; |
---|
3040 | 3923 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3062 | 3945 | } else if (event.getSource() == liveCB) |
---|
3063 | 3946 | { |
---|
3064 | 3947 | copy.live ^= true; |
---|
| 3948 | + objEditor.refreshContents(true); // To show item colors |
---|
| 3949 | + return; |
---|
| 3950 | + } else if (event.getSource() == selectableCB) |
---|
| 3951 | + { |
---|
| 3952 | + copy.dontselect ^= true; |
---|
3065 | 3953 | return; |
---|
3066 | 3954 | } else if (event.getSource() == hideCB) |
---|
3067 | 3955 | { |
---|
3068 | 3956 | copy.hide ^= true; |
---|
3069 | 3957 | copy.Touch(); // display list issue |
---|
3070 | | - objEditor.refreshContents(); |
---|
| 3958 | + objEditor.refreshContents(true); // To show item colors |
---|
3071 | 3959 | return; |
---|
3072 | 3960 | } else if (event.getSource() == link2masterCB) |
---|
3073 | 3961 | { |
---|
.. | .. |
---|
3077 | 3965 | if (event.getSource() == randomCB) |
---|
3078 | 3966 | { |
---|
3079 | 3967 | copy.random ^= true; |
---|
| 3968 | + objEditor.refreshContents(); |
---|
3080 | 3969 | return; |
---|
3081 | 3970 | } |
---|
3082 | 3971 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3100 | 3989 | |
---|
3101 | 3990 | public void actionPerformed(ActionEvent event) |
---|
3102 | 3991 | { |
---|
| 3992 | + Object source = event.getSource(); |
---|
3103 | 3993 | // SCRIPT DIALOG |
---|
3104 | | - if (event.getSource() == okbutton) |
---|
| 3994 | + if (source == okbutton) |
---|
3105 | 3995 | { |
---|
3106 | 3996 | textpanel.setVisible(false); |
---|
3107 | 3997 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3113 | 4003 | textarea = null; |
---|
3114 | 4004 | textpanel = null; |
---|
3115 | 4005 | } |
---|
3116 | | - if (event.getSource() == cancelbutton) |
---|
| 4006 | + if (source == cancelbutton) |
---|
3117 | 4007 | { |
---|
3118 | 4008 | textpanel.setVisible(false); |
---|
3119 | 4009 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3125 | 4015 | //applySelf(); |
---|
3126 | 4016 | //client.refreshEditWindow(); |
---|
3127 | 4017 | //refreshContents(); |
---|
3128 | | - if (event.getSource() == nameField) |
---|
| 4018 | + if (source == nameField) |
---|
3129 | 4019 | { |
---|
3130 | 4020 | //System.out.println("ObjEditor " + event); |
---|
3131 | 4021 | applySelf0(true); |
---|
3132 | 4022 | //parent.applySelf(); |
---|
3133 | | - objEditor.refreshContents(); |
---|
3134 | | - } else if (event.getSource() == resetButton) |
---|
| 4023 | + // conflicts with requestFocus objEditor.refreshContents(); |
---|
| 4024 | + } else if (source == resetButton) |
---|
3135 | 4025 | { |
---|
3136 | 4026 | CameraPane.fullreset = true; |
---|
3137 | 4027 | copy.Reset(); // ResetMeshes(); |
---|
3138 | 4028 | copy.Touch(); |
---|
3139 | 4029 | objEditor.refreshContents(); |
---|
3140 | | - } else if (event.getSource() == stepItem) |
---|
| 4030 | + } else if (source == stepItem) |
---|
3141 | 4031 | { |
---|
3142 | | - cameraView.ONESTEP = true; |
---|
| 4032 | + //cameraView.ONESTEP = true; |
---|
| 4033 | + Globals.ONESTEP = true; |
---|
3143 | 4034 | cameraView.repaint(); |
---|
3144 | 4035 | return; |
---|
3145 | | - } else if (event.getSource() == stepButton) |
---|
| 4036 | + } else if (source == stepButton) |
---|
3146 | 4037 | { |
---|
3147 | 4038 | copy.Step(); |
---|
3148 | 4039 | copy.Touch(); |
---|
3149 | 4040 | objEditor.refreshContents(); |
---|
3150 | | - } else if (event.getSource() == slowerButton) |
---|
| 4041 | + } else if (source == slowerButton) |
---|
3151 | 4042 | { |
---|
3152 | 4043 | copy.Slower(); |
---|
3153 | 4044 | copy.Touch(); |
---|
3154 | 4045 | objEditor.refreshContents(); |
---|
3155 | | - } else if (event.getSource() == fasterButton) |
---|
| 4046 | + } else if (source == fasterButton) |
---|
3156 | 4047 | { |
---|
3157 | 4048 | copy.Faster(); |
---|
3158 | 4049 | copy.Touch(); |
---|
3159 | 4050 | objEditor.refreshContents(); |
---|
3160 | | - } else if (event.getSource() == remarkButton) |
---|
| 4051 | + } else if (source == remarkButton) |
---|
3161 | 4052 | { |
---|
3162 | 4053 | copy.Remark(); |
---|
3163 | 4054 | copy.Touch(); |
---|
3164 | 4055 | objEditor.refreshContents(); |
---|
3165 | | - } else if (event.getSource() == stepAllButton) |
---|
| 4056 | + } else if (source == stepAllButton) |
---|
3166 | 4057 | { |
---|
3167 | 4058 | copy.StepAll(); |
---|
3168 | 4059 | copy.Touch(); |
---|
3169 | 4060 | objEditor.refreshContents(); |
---|
3170 | | - } else if (event.getSource() == resetAllButton) |
---|
| 4061 | + } else if (source == resetAllButton) |
---|
3171 | 4062 | { |
---|
3172 | 4063 | //CameraPane.fullreset = true; |
---|
3173 | 4064 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3200 | 4091 | // Close(); |
---|
3201 | 4092 | // } |
---|
3202 | 4093 | // else |
---|
3203 | | - if (event.getSource() == resetSlidersButton) |
---|
| 4094 | + if (source == resetSlidersButton) |
---|
3204 | 4095 | { |
---|
3205 | 4096 | ResetSliders(); |
---|
3206 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 4097 | + } else if (source == clearMaterialButton) |
---|
3207 | 4098 | { |
---|
3208 | 4099 | ClearMaterial(); |
---|
3209 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 4100 | + } else if (source == createMaterialButton) |
---|
3210 | 4101 | { |
---|
3211 | 4102 | CreateMaterial(); |
---|
3212 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 4103 | + } else if (source == clearPanelButton) |
---|
3213 | 4104 | { |
---|
3214 | 4105 | copy.ClearUI(); |
---|
3215 | 4106 | refreshContents(true); |
---|
3216 | | - } /* |
---|
3217 | | - } |
---|
3218 | | - |
---|
3219 | | - public boolean action(Event event, Object arg) |
---|
3220 | | - { |
---|
3221 | | - */ else if (event.getSource() == closeItem) |
---|
| 4107 | + } else if (source == importGFDItem) |
---|
| 4108 | + { |
---|
| 4109 | + ImportGFD(); |
---|
| 4110 | + } else |
---|
| 4111 | + if (source == importVRMLX3DItem) |
---|
| 4112 | + { |
---|
| 4113 | + ImportVRMLX3D(); |
---|
| 4114 | + } else |
---|
| 4115 | + if (source == import3DSItem) |
---|
| 4116 | + { |
---|
| 4117 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 4118 | + } else |
---|
| 4119 | + if (source == importOBJItem) |
---|
| 4120 | + { |
---|
| 4121 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 4122 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 4123 | + browser.setVisible(true); |
---|
| 4124 | + String filename = browser.getFile(); |
---|
| 4125 | + if (filename != null && filename.length() > 0) |
---|
| 4126 | + { |
---|
| 4127 | + String fullname = browser.getDirectory() + filename; |
---|
| 4128 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 4129 | + } |
---|
| 4130 | + } else |
---|
| 4131 | + if (source == closeItem) |
---|
3222 | 4132 | { |
---|
3223 | 4133 | Close(); |
---|
3224 | 4134 | //return true; |
---|
3225 | | - } else if (event.getSource() == loadItem) |
---|
| 4135 | + } else if (source == openItem) |
---|
3226 | 4136 | { |
---|
3227 | | - load(); |
---|
| 4137 | + Open(); |
---|
3228 | 4138 | //return true; |
---|
3229 | | - } else if (event.getSource() == saveItem) |
---|
| 4139 | + } else if (source == newItem) |
---|
| 4140 | + { |
---|
| 4141 | + New(); |
---|
| 4142 | + } else if (source == saveItem) |
---|
3230 | 4143 | { |
---|
3231 | 4144 | save(); |
---|
3232 | 4145 | //return true; |
---|
3233 | | - } else if (event.getSource() == saveAsItem) |
---|
| 4146 | + } else if (source == saveAsItem) |
---|
3234 | 4147 | { |
---|
3235 | 4148 | saveAs(); |
---|
3236 | 4149 | //return true; |
---|
3237 | | - } else if (event.getSource() == reexportItem) |
---|
| 4150 | + } else if (source == reexportItem) |
---|
3238 | 4151 | { |
---|
3239 | 4152 | reexport(); |
---|
3240 | 4153 | //return true; |
---|
3241 | | - } else if (event.getSource() == exportAsItem) |
---|
| 4154 | + } else if (source == exportAsItem) |
---|
3242 | 4155 | { |
---|
3243 | 4156 | export(); |
---|
3244 | 4157 | //return true; |
---|
3245 | | - } else if (event.getSource() == povItem) |
---|
| 4158 | + } else if (source == povItem) |
---|
3246 | 4159 | { |
---|
3247 | 4160 | generatePOV(); |
---|
3248 | 4161 | //return true; |
---|
3249 | | - } else if (event.getSource() == zBufferItem) |
---|
| 4162 | + } else if (event.getSource() == archiveItem) |
---|
| 4163 | + { |
---|
| 4164 | + cTools.Archive(frame); |
---|
| 4165 | + return; |
---|
| 4166 | + } else if (source == zBufferItem) |
---|
3250 | 4167 | { |
---|
3251 | 4168 | try |
---|
3252 | 4169 | { |
---|
.. | .. |
---|
3268 | 4185 | cameraView.repaint(); |
---|
3269 | 4186 | //return true; |
---|
3270 | 4187 | } |
---|
3271 | | - */ else if (event.getSource() == editCameraItem) |
---|
3272 | | - { |
---|
3273 | | - cameraView.ProtectCamera(); |
---|
3274 | | - cameraView.repaint(); |
---|
3275 | | - return; |
---|
3276 | | - } else if (event.getSource() == revertCameraItem) |
---|
3277 | | - { |
---|
3278 | | - cameraView.RevertCamera(); |
---|
3279 | | - cameraView.repaint(); |
---|
3280 | | - return; |
---|
3281 | | -// } else if (event.getSource() == textureButton) |
---|
3282 | | -// { |
---|
3283 | | -// return; // true; |
---|
3284 | | - } else // combos... |
---|
3285 | | - if (event.getSource() == texresMenu) |
---|
| 4188 | + */ else // combos... |
---|
| 4189 | + if (source == texresMenu) |
---|
3286 | 4190 | { |
---|
3287 | 4191 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3288 | 4192 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3294 | 4198 | } |
---|
3295 | 4199 | } |
---|
3296 | 4200 | |
---|
3297 | | - void ToggleAnimation() |
---|
| 4201 | + void New() |
---|
3298 | 4202 | { |
---|
3299 | | - if (!CameraPane.ANIMATION) |
---|
| 4203 | + while (copy.Size() > 0) |
---|
3300 | 4204 | { |
---|
3301 | | - FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 4205 | + copy.remove(0); |
---|
| 4206 | + } |
---|
| 4207 | + |
---|
| 4208 | + copy.selection.clear(); |
---|
| 4209 | + |
---|
| 4210 | + if (copy == Grafreed.grafreed.universe) |
---|
| 4211 | + { |
---|
| 4212 | + CreateCameras(); |
---|
| 4213 | + cameraView.SetCamera(GetCamera(copy, 0)); |
---|
| 4214 | + } |
---|
| 4215 | + ResetModel(); |
---|
| 4216 | + objEditor.refreshContents(); |
---|
| 4217 | + } |
---|
| 4218 | + |
---|
| 4219 | + static public byte[] Compress(Object3D o) |
---|
| 4220 | + { |
---|
| 4221 | + // Slower to actually compress. |
---|
| 4222 | + try |
---|
| 4223 | + { |
---|
| 4224 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4225 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 4226 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
| 4227 | + |
---|
| 4228 | + Object3D parent = o.parent; |
---|
| 4229 | + o.parent = null; |
---|
| 4230 | + |
---|
| 4231 | + out.writeObject(o); |
---|
| 4232 | + |
---|
| 4233 | + o.parent = parent; |
---|
| 4234 | + |
---|
| 4235 | + out.flush(); |
---|
| 4236 | + |
---|
| 4237 | + baos //zstream |
---|
| 4238 | + .close(); |
---|
| 4239 | + out.close(); |
---|
| 4240 | + |
---|
| 4241 | + byte[] bytes = baos.toByteArray(); |
---|
| 4242 | + |
---|
| 4243 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 4244 | + return bytes; |
---|
| 4245 | + } catch (Exception e) |
---|
| 4246 | + { |
---|
| 4247 | + System.err.println(e); |
---|
| 4248 | + return null; |
---|
| 4249 | + } |
---|
| 4250 | + } |
---|
| 4251 | + |
---|
| 4252 | + static public Object Uncompress(byte[] bytes) |
---|
| 4253 | + { |
---|
| 4254 | + System.out.println("restore #bytes = " + bytes.length); |
---|
| 4255 | + try |
---|
| 4256 | + { |
---|
| 4257 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4258 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 4259 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
| 4260 | + Object obj = in.readObject(); |
---|
| 4261 | + |
---|
| 4262 | + bais //istream |
---|
| 4263 | + .close(); |
---|
| 4264 | + in.close(); |
---|
| 4265 | + |
---|
| 4266 | + return obj; |
---|
| 4267 | + } catch (Exception e) |
---|
| 4268 | + { |
---|
| 4269 | + System.err.println(e); |
---|
| 4270 | + return null; |
---|
| 4271 | + } |
---|
| 4272 | + } |
---|
| 4273 | + |
---|
| 4274 | + static public Object clone(Object o) |
---|
| 4275 | + { |
---|
| 4276 | + try |
---|
| 4277 | + { |
---|
| 4278 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4279 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 4280 | + |
---|
| 4281 | + out.writeObject(o); |
---|
| 4282 | + |
---|
| 4283 | + out.flush(); |
---|
| 4284 | + out.close(); |
---|
| 4285 | + |
---|
| 4286 | + byte[] bytes = baos.toByteArray(); |
---|
| 4287 | + |
---|
| 4288 | + System.out.println("clone = " + bytes.length); |
---|
| 4289 | + |
---|
| 4290 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4291 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 4292 | + Object obj = in.readObject(); |
---|
| 4293 | + in.close(); |
---|
| 4294 | + |
---|
| 4295 | + return obj; |
---|
| 4296 | + } catch (Exception e) |
---|
| 4297 | + { |
---|
| 4298 | + System.err.println(e); |
---|
| 4299 | + return null; |
---|
| 4300 | + } |
---|
| 4301 | + } |
---|
| 4302 | + |
---|
| 4303 | + cRadio GetCurrentTab() |
---|
| 4304 | + { |
---|
| 4305 | + cRadio ab; |
---|
| 4306 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4307 | + { |
---|
| 4308 | + ab = (cRadio)e.nextElement(); |
---|
| 4309 | + if(ab.GetObject() == copy) |
---|
| 4310 | + { |
---|
| 4311 | + return ab; |
---|
| 4312 | + } |
---|
| 4313 | + } |
---|
| 4314 | + |
---|
| 4315 | + return null; |
---|
| 4316 | + } |
---|
| 4317 | + |
---|
| 4318 | + |
---|
| 4319 | + public void Save() |
---|
| 4320 | + { |
---|
| 4321 | + //Save(true); |
---|
| 4322 | + Replace(); |
---|
| 4323 | + SetVersionStates(); |
---|
| 4324 | + } |
---|
| 4325 | + |
---|
| 4326 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 4327 | + { |
---|
| 4328 | + if (compress.length != name.length) |
---|
| 4329 | + { |
---|
| 4330 | + return false; |
---|
| 4331 | + } |
---|
| 4332 | + |
---|
| 4333 | + for (int i=compress.length; --i>=0;) |
---|
| 4334 | + { |
---|
| 4335 | + if (compress[i] != name[i]) |
---|
| 4336 | + return false; |
---|
| 4337 | + } |
---|
| 4338 | + |
---|
| 4339 | + return true; |
---|
| 4340 | + } |
---|
| 4341 | + |
---|
| 4342 | + void DeleteVersion() |
---|
| 4343 | + { |
---|
| 4344 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4345 | + { |
---|
| 4346 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4347 | + } |
---|
| 4348 | + |
---|
| 4349 | + if (copy.versionlist[copy.versionindex] == null) |
---|
| 4350 | + copy.versionindex -= 1; |
---|
| 4351 | + |
---|
| 4352 | + if (copy.versionindex != -1) |
---|
| 4353 | + CopyChanged(); |
---|
| 4354 | + |
---|
| 4355 | + SetVersionStates(); |
---|
| 4356 | + } |
---|
| 4357 | + |
---|
| 4358 | + public boolean Save(boolean user) |
---|
| 4359 | + { |
---|
| 4360 | + System.err.println("Save"); |
---|
| 4361 | + Replace(); |
---|
| 4362 | + |
---|
| 4363 | + //cRadio tab = GetCurrentTab(); |
---|
| 4364 | + |
---|
| 4365 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
| 4366 | + |
---|
| 4367 | + boolean thesame = false; |
---|
| 4368 | + |
---|
| 4369 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4370 | +// { |
---|
| 4371 | +// thesame = true; |
---|
| 4372 | +// } |
---|
| 4373 | + |
---|
| 4374 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 4375 | + if (!thesame) |
---|
| 4376 | + { |
---|
| 4377 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4378 | + { |
---|
| 4379 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4380 | + } |
---|
| 4381 | + |
---|
| 4382 | + //tab.user[tab.versionindex] = user; |
---|
| 4383 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 4384 | + |
---|
| 4385 | + copy.versionlist[++copy.versionindex] = compress; |
---|
| 4386 | + |
---|
| 4387 | + // if (increment) |
---|
| 4388 | + // tab.versionindex++; |
---|
| 4389 | + } |
---|
| 4390 | + |
---|
| 4391 | + //copy.RestoreBigData(versiontable); |
---|
| 4392 | + |
---|
| 4393 | + //assert(hashtable.isEmpty()); |
---|
| 4394 | + |
---|
| 4395 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4396 | +// { |
---|
| 4397 | +// //tab.user[i] = false; |
---|
| 4398 | +// copy.versionlist[i] = null; |
---|
| 4399 | +// } |
---|
| 4400 | + |
---|
| 4401 | + SetVersionStates(); |
---|
| 4402 | + |
---|
| 4403 | + // test save |
---|
| 4404 | + if (false) |
---|
| 4405 | + { |
---|
| 4406 | + try |
---|
| 4407 | + { |
---|
| 4408 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
| 4409 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4410 | + |
---|
| 4411 | + p.writeObject(copy); |
---|
| 4412 | + |
---|
| 4413 | + p.flush(); |
---|
| 4414 | + |
---|
| 4415 | + ostream.close(); |
---|
| 4416 | + } catch (Exception e) |
---|
| 4417 | + { |
---|
| 4418 | + e.printStackTrace(); |
---|
| 4419 | + } |
---|
| 4420 | + } |
---|
| 4421 | + |
---|
| 4422 | + return !thesame; |
---|
| 4423 | + } |
---|
| 4424 | + |
---|
| 4425 | + boolean flashIt = true; |
---|
| 4426 | + |
---|
| 4427 | + void RefreshSelection() |
---|
| 4428 | + { |
---|
| 4429 | + Object3D selection = new Object3D(); |
---|
| 4430 | + |
---|
| 4431 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4432 | + { |
---|
| 4433 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4434 | + |
---|
| 4435 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4436 | + |
---|
| 4437 | + if (obj == null) |
---|
| 4438 | + { |
---|
| 4439 | + copy.selection.remove(i--); |
---|
| 4440 | + } |
---|
| 4441 | + else |
---|
| 4442 | + { |
---|
| 4443 | + selection.add(obj); |
---|
| 4444 | + copy.selection.setElementAt(obj, i); |
---|
| 4445 | + } |
---|
| 4446 | + } |
---|
| 4447 | + |
---|
| 4448 | + flashIt = false; |
---|
| 4449 | + GetTree().clearSelection(); |
---|
| 4450 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4451 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4452 | + flashIt = true; |
---|
| 4453 | + |
---|
| 4454 | + //refreshContents(false); |
---|
| 4455 | + } |
---|
| 4456 | + |
---|
| 4457 | + void CopyChanged() |
---|
| 4458 | + { |
---|
| 4459 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4460 | + |
---|
| 4461 | + SetVersionStates(); |
---|
| 4462 | + |
---|
| 4463 | + boolean temp = CameraPane.SWITCH; |
---|
| 4464 | + CameraPane.SWITCH = false; |
---|
| 4465 | + |
---|
| 4466 | + copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4467 | + |
---|
| 4468 | + copy.clear(); |
---|
| 4469 | + |
---|
| 4470 | + copy.skyboxname = obj.skyboxname; |
---|
| 4471 | + copy.skyboxext = obj.skyboxext; |
---|
| 4472 | + |
---|
| 4473 | + for (int i=0; i<obj.Size(); i++) |
---|
| 4474 | + { |
---|
| 4475 | + copy.add(obj.get(i)); |
---|
| 4476 | + } |
---|
| 4477 | + |
---|
| 4478 | + copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4479 | + |
---|
| 4480 | + CameraPane.SWITCH = temp; |
---|
| 4481 | + |
---|
| 4482 | + RefreshSelection(); |
---|
| 4483 | + //assert(hashtable.isEmpty()); |
---|
| 4484 | + |
---|
| 4485 | + copy.Touch(); |
---|
| 4486 | + |
---|
| 4487 | + ResetModel(); |
---|
| 4488 | + copy.HardTouch(); // recompile? |
---|
| 4489 | + |
---|
| 4490 | + cRadio ab; |
---|
| 4491 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4492 | + { |
---|
| 4493 | + ab = (cRadio)e.nextElement(); |
---|
| 4494 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 4495 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 4496 | + if (test != null) |
---|
| 4497 | + { |
---|
| 4498 | + test.editWindow = ab.object.editWindow; |
---|
| 4499 | + ab.object = test; |
---|
| 4500 | + } |
---|
| 4501 | + } |
---|
| 4502 | + |
---|
| 4503 | + refreshContents(true); |
---|
| 4504 | + } |
---|
| 4505 | + |
---|
| 4506 | + cButton previousVersionButton; |
---|
| 4507 | + cButton restoreButton; |
---|
| 4508 | + cButton replaceButton; |
---|
| 4509 | + cButton nextVersionButton; |
---|
| 4510 | + cButton saveVersionButton; |
---|
| 4511 | + cButton deleteVersionButton; |
---|
| 4512 | + |
---|
| 4513 | + boolean muteSlider; |
---|
| 4514 | + |
---|
| 4515 | + int VersionCount() |
---|
| 4516 | + { |
---|
| 4517 | + int count = 0; |
---|
| 4518 | + |
---|
| 4519 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 4520 | + { |
---|
| 4521 | + if (copy.versionlist[i] != null) |
---|
| 4522 | + count++; |
---|
| 4523 | + } |
---|
| 4524 | + |
---|
| 4525 | + return count; |
---|
| 4526 | + } |
---|
| 4527 | + |
---|
| 4528 | + public cGridBag versionSliderPane; |
---|
| 4529 | + |
---|
| 4530 | + void SetVersionStates() |
---|
| 4531 | + { |
---|
| 4532 | + //if (true) |
---|
| 4533 | + // return; |
---|
| 4534 | + |
---|
| 4535 | + //cRadio tab = GetCurrentTab(); |
---|
| 4536 | + |
---|
| 4537 | + if (copy.versionlist == null) |
---|
| 4538 | + { |
---|
| 4539 | + saveVersionButton.setEnabled(false); |
---|
| 4540 | + restoreButton.setEnabled(false); |
---|
| 4541 | + replaceButton.setEnabled(false); |
---|
| 4542 | + previousVersionButton.setEnabled(false); |
---|
| 4543 | + nextVersionButton.setEnabled(false); |
---|
| 4544 | + deleteVersionButton.setEnabled(false); |
---|
| 4545 | + versionSliderPane.setVisible(false); |
---|
| 4546 | + } |
---|
| 4547 | + else |
---|
| 4548 | + { |
---|
| 4549 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4550 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4551 | + |
---|
| 4552 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4553 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4554 | + |
---|
| 4555 | + deleteVersionButton.setEnabled(copy.versionindex != -1); |
---|
| 4556 | + //copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4557 | + |
---|
| 4558 | + muteSlider = true; |
---|
| 4559 | + versionSlider.setMinimum(0); |
---|
| 4560 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4561 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4562 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
| 4563 | + muteSlider = false; |
---|
| 4564 | + |
---|
| 4565 | + versionSliderPane.setVisible(true); |
---|
| 4566 | + } |
---|
| 4567 | + } |
---|
| 4568 | + |
---|
| 4569 | + public boolean PreviousVersion() |
---|
| 4570 | + { |
---|
| 4571 | + // Option? |
---|
| 4572 | + Replace(); |
---|
| 4573 | + |
---|
| 4574 | + System.err.println("Undo"); |
---|
| 4575 | + |
---|
| 4576 | + //cRadio tab = GetCurrentTab(); |
---|
| 4577 | + |
---|
| 4578 | + if (copy.versionindex == 0) |
---|
| 4579 | + { |
---|
| 4580 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4581 | + return false; |
---|
| 4582 | + } |
---|
| 4583 | + |
---|
| 4584 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 4585 | +// { |
---|
| 4586 | +// if (Save(false)) |
---|
| 4587 | +// tab.versionindex -= 1; |
---|
| 4588 | +// else |
---|
| 4589 | +// { |
---|
| 4590 | +// if (tab.versionindex <= 0) |
---|
| 4591 | +// return false; |
---|
| 4592 | +// else |
---|
| 4593 | +// tab.versionindex -= 1; |
---|
| 4594 | +// } |
---|
| 4595 | +// } |
---|
| 4596 | + |
---|
| 4597 | + copy.versionindex -= 1; |
---|
| 4598 | + |
---|
| 4599 | + CopyChanged(); |
---|
| 4600 | + |
---|
| 4601 | + return true; |
---|
| 4602 | + } |
---|
| 4603 | + |
---|
| 4604 | + public boolean Restore() |
---|
| 4605 | + { |
---|
| 4606 | + System.err.println("Restore"); |
---|
| 4607 | + |
---|
| 4608 | + //cRadio tab = GetCurrentTab(); |
---|
| 4609 | + |
---|
| 4610 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4611 | + { |
---|
| 4612 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4613 | + return false; |
---|
| 4614 | + } |
---|
| 4615 | + |
---|
| 4616 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4617 | + CopyChanged(); |
---|
| 4618 | + |
---|
| 4619 | + return true; |
---|
| 4620 | + } |
---|
| 4621 | + |
---|
| 4622 | + public boolean Replace() |
---|
| 4623 | + { |
---|
| 4624 | + //System.err.println("Replace"); |
---|
| 4625 | + |
---|
| 4626 | + //cRadio tab = GetCurrentTab(); |
---|
| 4627 | + |
---|
| 4628 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4629 | + { |
---|
| 4630 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4631 | + return false; |
---|
| 4632 | + } |
---|
| 4633 | + |
---|
| 4634 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
| 4635 | + |
---|
| 4636 | + return true; |
---|
| 4637 | + } |
---|
| 4638 | + |
---|
| 4639 | + public void NextVersion() |
---|
| 4640 | + { |
---|
| 4641 | + // Option? |
---|
| 4642 | + Replace(); |
---|
| 4643 | + |
---|
| 4644 | + //cRadio tab = GetCurrentTab(); |
---|
| 4645 | + |
---|
| 4646 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
| 4647 | + { |
---|
| 4648 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4649 | + return; |
---|
| 4650 | + } |
---|
| 4651 | + |
---|
| 4652 | + copy.versionindex += 1; |
---|
| 4653 | + |
---|
| 4654 | + CopyChanged(); |
---|
| 4655 | + |
---|
| 4656 | + //if (!tab.user[tab.versionindex]) |
---|
| 4657 | + // tab.graphs[tab.versionindex] = null; |
---|
| 4658 | + } |
---|
| 4659 | + |
---|
| 4660 | + void ImportGFD() |
---|
| 4661 | + { |
---|
| 4662 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
3302 | 4663 | browser.show(); |
---|
3303 | 4664 | String filename = browser.getFile(); |
---|
3304 | 4665 | if (filename != null && filename.length() > 0) |
---|
3305 | 4666 | { |
---|
3306 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 4667 | + String fullname = browser.getDirectory() + filename; |
---|
| 4668 | + |
---|
| 4669 | + //Object3D readobj = |
---|
| 4670 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 4671 | + //makeSomething(readobj); |
---|
| 4672 | + } |
---|
| 4673 | + } |
---|
| 4674 | + |
---|
| 4675 | + void ImportVRMLX3D() |
---|
| 4676 | + { |
---|
| 4677 | + if (Grafreed.standAlone) |
---|
| 4678 | + { |
---|
| 4679 | + /**/ |
---|
| 4680 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 4681 | + browser.show(); |
---|
| 4682 | + String filename = browser.getFile(); |
---|
| 4683 | + if (filename != null && filename.length() > 0) |
---|
| 4684 | + { |
---|
| 4685 | + String fullname = browser.getDirectory() + filename; |
---|
| 4686 | + LoadVRMLX3D(fullname); |
---|
| 4687 | + } |
---|
| 4688 | + /**/ |
---|
| 4689 | + } |
---|
| 4690 | + } |
---|
| 4691 | + |
---|
| 4692 | + void ToggleAnimation() |
---|
| 4693 | + { |
---|
| 4694 | + if (!Globals.ANIMATION) |
---|
| 4695 | + { |
---|
| 4696 | + FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 4697 | + browser.setVisible(true); |
---|
| 4698 | + String filename = browser.getFile(); |
---|
| 4699 | + if (filename != null && filename.length() > 0) |
---|
| 4700 | + { |
---|
| 4701 | + Globals.filename = browser.getDirectory() + filename; |
---|
3307 | 4702 | //CameraPane.framecount = 0; |
---|
3308 | | - CameraPane.imagecount = 0; |
---|
| 4703 | + Globals.imagecount = 0; |
---|
3309 | 4704 | |
---|
3310 | | - CameraPane.ANIMATION ^= true; |
---|
| 4705 | + Globals.ANIMATION ^= true; |
---|
3311 | 4706 | |
---|
3312 | | - GrafreeD.wav.cursor = 0; |
---|
3313 | | - GrafreeD.wav.loop = 0; |
---|
| 4707 | + Grafreed.wav.cursor = 0; |
---|
| 4708 | + Grafreed.wav.loop = 0; |
---|
3314 | 4709 | } |
---|
3315 | 4710 | } else |
---|
3316 | 4711 | { |
---|
3317 | | - CameraPane.ANIMATION ^= true; |
---|
| 4712 | + Globals.ANIMATION ^= true; |
---|
3318 | 4713 | } |
---|
3319 | 4714 | } |
---|
3320 | 4715 | |
---|
.. | .. |
---|
3360 | 4755 | void CreateMaterial() |
---|
3361 | 4756 | { |
---|
3362 | 4757 | //copy.ClearMaterial(); // PATCH |
---|
3363 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 4758 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3364 | 4759 | if (copy.selection.size() > 0) |
---|
3365 | 4760 | //SetMaterial(copy); |
---|
3366 | 4761 | { |
---|
.. | .. |
---|
3411 | 4806 | assert false; |
---|
3412 | 4807 | } |
---|
3413 | 4808 | |
---|
3414 | | - void EditSelection() |
---|
| 4809 | + void EditSelection(boolean newWindow) |
---|
3415 | 4810 | { |
---|
3416 | 4811 | } |
---|
3417 | 4812 | |
---|
.. | .. |
---|
3419 | 4814 | { |
---|
3420 | 4815 | copy.ResetBlockLoop(); // temporary problem |
---|
3421 | 4816 | |
---|
3422 | | - boolean random = CameraPane.RANDOM; |
---|
3423 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 4817 | + boolean random = CameraPane.SWITCH; |
---|
| 4818 | + CameraPane.SWITCH = false; // parse everything |
---|
3424 | 4819 | copy.ResetDisplayList(); |
---|
3425 | 4820 | copy.HardTouch(); |
---|
3426 | | - CameraPane.RANDOM = random; |
---|
| 4821 | + CameraPane.SWITCH = random; |
---|
3427 | 4822 | } |
---|
3428 | 4823 | |
---|
3429 | 4824 | // public void applySelf() |
---|
.. | .. |
---|
3453 | 4848 | // else |
---|
3454 | 4849 | // applySelf(true); |
---|
3455 | 4850 | // } |
---|
| 4851 | + |
---|
| 4852 | + boolean Equal(double a, double b) |
---|
| 4853 | + { |
---|
| 4854 | + return Math.abs(a - b) < 0.001; |
---|
| 4855 | + } |
---|
| 4856 | + |
---|
3456 | 4857 | void applySelf0(boolean name) |
---|
3457 | 4858 | { |
---|
3458 | 4859 | if (name) |
---|
.. | .. |
---|
3470 | 4871 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
3471 | 4872 | |
---|
3472 | 4873 | current.color = (float) colorField.getFloat(); |
---|
3473 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4874 | + current.modulation = (float) saturationField.getFloat(); |
---|
3474 | 4875 | current.metalness = (float) metalnessField.getFloat(); |
---|
3475 | 4876 | current.diffuse = (float) diffuseField.getFloat(); |
---|
3476 | 4877 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
3493 | 4894 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3494 | 4895 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3495 | 4896 | |
---|
3496 | | - if (!NumberSlider.frozen) |
---|
| 4897 | + if (!cNumberSlider.frozen) |
---|
3497 | 4898 | { |
---|
3498 | 4899 | //System.out.println("Propagate = " + propagate); |
---|
3499 | 4900 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 4901 | + |
---|
| 4902 | + if (copy.material != null) |
---|
| 4903 | + { |
---|
| 4904 | + cMaterial mat = copy.material; |
---|
| 4905 | + |
---|
| 4906 | + if (!Equal(colorField.getFloat(), mat.color)) |
---|
| 4907 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4908 | + if (!Equal(saturationField.getFloat(), mat.modulation)) |
---|
| 4909 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4910 | + if (!Equal(metalnessField.getFloat(), mat.metalness)) |
---|
| 4911 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4912 | + if (!Equal(diffuseField.getFloat(), mat.diffuse)) |
---|
| 4913 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4914 | + if (!Equal(specularField.getFloat(), mat.specular)) |
---|
| 4915 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4916 | + if (!Equal(shininessField.getFloat(), mat.shininess)) |
---|
| 4917 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4918 | + if (!Equal(shiftField.getFloat(), mat.shift)) |
---|
| 4919 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4920 | + if (!Equal(ambientField.getFloat(), mat.ambient)) |
---|
| 4921 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4922 | + if (!Equal(lightareaField.getFloat(), mat.lightarea)) |
---|
| 4923 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4924 | + if (!Equal(diffusenessField.getFloat(), mat.factor)) |
---|
| 4925 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4926 | + if (!Equal(velvetField.getFloat(), mat.velvet)) |
---|
| 4927 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4928 | + if (!Equal(sheenField.getFloat(), mat.sheen)) |
---|
| 4929 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4930 | + if (!Equal(subsurfaceField.getFloat(), mat.subsurface)) |
---|
| 4931 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4932 | + if (!Equal(backlitField.getFloat(), mat.bump)) |
---|
| 4933 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4934 | + if (!Equal(anisoField.getFloat(), mat.aniso)) |
---|
| 4935 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4936 | + if (!Equal(anisoVField.getFloat(), mat.anisoV)) |
---|
| 4937 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4938 | + if (!Equal(cameraField.getFloat(), mat.cameralight)) |
---|
| 4939 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4940 | + if (!Equal(selfshadowField.getFloat(), mat.diffuseness)) |
---|
| 4941 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4942 | + if (!Equal(shadowField.getFloat(), mat.shadow)) |
---|
| 4943 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4944 | + if (!Equal(textureField.getFloat(), mat.texture)) |
---|
| 4945 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4946 | + if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
| 4947 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4948 | + if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
| 4949 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4950 | + if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
| 4951 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4952 | + } |
---|
| 4953 | + |
---|
3500 | 4954 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3501 | 4955 | { |
---|
3502 | 4956 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3525 | 4979 | //copy.Touch(); |
---|
3526 | 4980 | } |
---|
3527 | 4981 | |
---|
| 4982 | + cNumberSlider versionSlider; |
---|
| 4983 | + |
---|
3528 | 4984 | public void stateChanged(ChangeEvent e) |
---|
3529 | 4985 | { |
---|
3530 | | - // assert(false); |
---|
| 4986 | + // assert(false); |
---|
| 4987 | + if (e.getSource() == versionSlider) |
---|
| 4988 | + { |
---|
| 4989 | + if (muteSlider) |
---|
| 4990 | + return; |
---|
| 4991 | + |
---|
| 4992 | + Replace(); |
---|
| 4993 | + |
---|
| 4994 | + int version = versionSlider.getInteger(); |
---|
| 4995 | + |
---|
| 4996 | + if (version != -1 && copy.versionlist[version] != null) |
---|
| 4997 | + { |
---|
| 4998 | + copy.versionindex = version; |
---|
| 4999 | + CopyChanged(); |
---|
| 5000 | + } |
---|
| 5001 | + |
---|
| 5002 | + return; |
---|
| 5003 | + } |
---|
3531 | 5004 | |
---|
3532 | 5005 | if (freezematerial) |
---|
3533 | 5006 | { |
---|
.. | .. |
---|
3541 | 5014 | || e.getSource() == apertureField |
---|
3542 | 5015 | || e.getSource() == shadowblurField) |
---|
3543 | 5016 | { |
---|
| 5017 | + new Exception().printStackTrace(); |
---|
3544 | 5018 | System.exit(0); |
---|
3545 | 5019 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3546 | 5020 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3562 | 5036 | { |
---|
3563 | 5037 | //System.out.println("stateChanged = " + this); |
---|
3564 | 5038 | materialtouched = true; |
---|
| 5039 | + |
---|
| 5040 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 5041 | + { |
---|
| 5042 | + saturationField.setFloat(1); |
---|
| 5043 | + } |
---|
| 5044 | + |
---|
3565 | 5045 | applySelf(); |
---|
3566 | 5046 | //System.out.println("this = " + this); |
---|
3567 | 5047 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
3611 | 5091 | } |
---|
3612 | 5092 | |
---|
3613 | 5093 | if (normalpushField != null) |
---|
3614 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 5094 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3615 | 5095 | } |
---|
3616 | 5096 | |
---|
3617 | 5097 | void SnapObject() |
---|
.. | .. |
---|
3861 | 5341 | { |
---|
3862 | 5342 | if (GetTree() != null) |
---|
3863 | 5343 | { |
---|
| 5344 | + GetTree().revalidate(); |
---|
3864 | 5345 | GetTree().repaint(); |
---|
3865 | 5346 | } |
---|
3866 | 5347 | |
---|
3867 | 5348 | radioPanel.revalidate(); |
---|
3868 | 5349 | radioPanel.repaint(); |
---|
3869 | | - ctrlPanel.revalidate(); // ? new |
---|
| 5350 | + ctrlPanel.validate(); // ? new |
---|
3870 | 5351 | ctrlPanel.repaint(); |
---|
3871 | 5352 | } |
---|
| 5353 | + |
---|
| 5354 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5355 | + SetVersionStates(); |
---|
| 5356 | + |
---|
| 5357 | + cameraView.requestFocusInWindow(); |
---|
3872 | 5358 | } |
---|
3873 | 5359 | |
---|
3874 | 5360 | static TweenManager tweenManager = new TweenManager(); |
---|
3875 | 5361 | |
---|
3876 | 5362 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3877 | 5363 | { |
---|
| 5364 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
| 5365 | + Save(); |
---|
3878 | 5366 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3879 | 5367 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3880 | 5368 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3898 | 5386 | // group = (Composite) group.get(0); |
---|
3899 | 5387 | // } |
---|
3900 | 5388 | |
---|
3901 | | - System.out.println("makeSomething of " + thing); |
---|
| 5389 | + //System.out.println("makeSomething of " + thing); |
---|
3902 | 5390 | |
---|
3903 | 5391 | /* |
---|
3904 | 5392 | if (deselect && jList != null) |
---|
.. | .. |
---|
3961 | 5449 | { |
---|
3962 | 5450 | ResetModel(); |
---|
3963 | 5451 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 5452 | + |
---|
| 5453 | + if (thing.Size() == 0) |
---|
| 5454 | + { |
---|
| 5455 | + //EditSelection(false); |
---|
| 5456 | + } |
---|
| 5457 | + |
---|
3964 | 5458 | refreshContents(); |
---|
3965 | 5459 | } |
---|
3966 | 5460 | |
---|
.. | .. |
---|
4078 | 5572 | } |
---|
4079 | 5573 | } |
---|
4080 | 5574 | } |
---|
| 5575 | + |
---|
4081 | 5576 | LoadGFDThread loadGFDThread; |
---|
4082 | 5577 | |
---|
4083 | 5578 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4097 | 5592 | |
---|
4098 | 5593 | try |
---|
4099 | 5594 | { |
---|
| 5595 | + // Try compressed version first. |
---|
4100 | 5596 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4101 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5597 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 5598 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4102 | 5599 | |
---|
4103 | 5600 | readobj = (Object3D) p.readObject(); |
---|
4104 | 5601 | istream.close(); |
---|
.. | .. |
---|
4106 | 5603 | readobj.ResetDisplayList(); |
---|
4107 | 5604 | } catch (Exception e) |
---|
4108 | 5605 | { |
---|
4109 | | - e.printStackTrace(); |
---|
| 5606 | + if (!e.toString().contains("GZIP")) |
---|
| 5607 | + e.printStackTrace(); |
---|
| 5608 | + |
---|
| 5609 | + try |
---|
| 5610 | + { |
---|
| 5611 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 5612 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5613 | + |
---|
| 5614 | + readobj = (Object3D) p.readObject(); |
---|
| 5615 | + istream.close(); |
---|
| 5616 | + |
---|
| 5617 | + readobj.ResetDisplayList(); |
---|
| 5618 | + } catch (Exception e2) |
---|
| 5619 | + { |
---|
| 5620 | + e2.printStackTrace(); |
---|
| 5621 | + } |
---|
4110 | 5622 | } |
---|
4111 | 5623 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4112 | 5624 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4152 | 5664 | |
---|
4153 | 5665 | void LoadIt(Object obj) |
---|
4154 | 5666 | { |
---|
| 5667 | + if (obj == null) |
---|
| 5668 | + { |
---|
| 5669 | + // Invalid file |
---|
| 5670 | + return; |
---|
| 5671 | + } |
---|
| 5672 | + |
---|
4155 | 5673 | System.out.println("Loaded " + obj); |
---|
4156 | 5674 | //new Exception().printStackTrace(); |
---|
4157 | 5675 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4161 | 5679 | |
---|
4162 | 5680 | if (readobj != null) |
---|
4163 | 5681 | { |
---|
| 5682 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 5683 | + // Save(); |
---|
4164 | 5684 | try |
---|
4165 | 5685 | { |
---|
4166 | 5686 | //readobj.deepCopySelf(copy); |
---|
4167 | 5687 | copy.clear(); // june 2014 |
---|
| 5688 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5689 | + copy.skyboxext = readobj.skyboxext; |
---|
4168 | 5690 | for (int i = 0; i < readobj.size(); i++) |
---|
4169 | 5691 | { |
---|
4170 | 5692 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4205 | 5727 | } |
---|
4206 | 5728 | } catch (ClassCastException e) |
---|
4207 | 5729 | { |
---|
| 5730 | + e.printStackTrace(); |
---|
4208 | 5731 | assert (false); |
---|
4209 | 5732 | Composite c = (Composite) copy; |
---|
4210 | 5733 | c.children.clear(); |
---|
.. | .. |
---|
4215 | 5738 | c.addChild(csg); |
---|
4216 | 5739 | } |
---|
4217 | 5740 | |
---|
| 5741 | + copy.versionlist = readobj.versionlist; |
---|
| 5742 | + copy.versionindex = readobj.versionindex; |
---|
| 5743 | + copy.versiontable = readobj.versiontable; |
---|
| 5744 | + |
---|
| 5745 | + if (copy.versionlist == null) |
---|
| 5746 | + { |
---|
| 5747 | + // Backward compatibility |
---|
| 5748 | + copy.versionlist = new Object3D[100]; |
---|
| 5749 | + copy.versionindex = -1; |
---|
| 5750 | + |
---|
| 5751 | + //Save(true); |
---|
| 5752 | + } |
---|
| 5753 | + |
---|
| 5754 | + //? SetUndoStates(); |
---|
| 5755 | + |
---|
4218 | 5756 | ResetModel(); |
---|
4219 | 5757 | copy.HardTouch(); // recompile? |
---|
4220 | 5758 | refreshContents(); |
---|
4221 | 5759 | } |
---|
4222 | 5760 | } |
---|
4223 | 5761 | |
---|
4224 | | - void load() // throws ClassNotFoundException |
---|
| 5762 | + void Open() // throws ClassNotFoundException |
---|
4225 | 5763 | { |
---|
4226 | | - if (GrafreeD.standAlone) |
---|
| 5764 | + if (Grafreed.standAlone) |
---|
4227 | 5765 | { |
---|
4228 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5766 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4229 | 5767 | browser.show(); |
---|
4230 | 5768 | String filename = browser.getFile(); |
---|
4231 | 5769 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4302 | 5840 | |
---|
4303 | 5841 | void save() |
---|
4304 | 5842 | { |
---|
| 5843 | + Replace(); |
---|
| 5844 | + |
---|
4305 | 5845 | if (lastname == null) |
---|
4306 | 5846 | { |
---|
4307 | 5847 | return; |
---|
.. | .. |
---|
4310 | 5850 | try |
---|
4311 | 5851 | { |
---|
4312 | 5852 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4313 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 5853 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5854 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4314 | 5855 | |
---|
4315 | 5856 | p.writeObject(copy); |
---|
4316 | 5857 | p.flush(); |
---|
4317 | 5858 | |
---|
| 5859 | + zstream.close(); |
---|
4318 | 5860 | ostream.close(); |
---|
4319 | 5861 | |
---|
4320 | 5862 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4322 | 5864 | //ps.print(buffer.toString()); |
---|
4323 | 5865 | } catch (IOException e) |
---|
4324 | 5866 | { |
---|
| 5867 | + e.printStackTrace(); |
---|
4325 | 5868 | } |
---|
4326 | 5869 | } |
---|
| 5870 | + |
---|
4327 | 5871 | String lastname; |
---|
4328 | 5872 | |
---|
4329 | 5873 | void saveAs() |
---|
4330 | 5874 | { |
---|
4331 | | - if (GrafreeD.standAlone) |
---|
| 5875 | + if (Grafreed.standAlone) |
---|
4332 | 5876 | { |
---|
4333 | 5877 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4334 | 5878 | browser.setVisible(true); |
---|
4335 | 5879 | String filename = browser.getFile(); |
---|
4336 | 5880 | if (filename != null && filename.length() > 0) |
---|
4337 | 5881 | { |
---|
| 5882 | + if (!filename.endsWith(".gfd")) |
---|
| 5883 | + filename += ".gfd"; |
---|
4338 | 5884 | lastname = browser.getDirectory() + filename; |
---|
4339 | 5885 | save(); |
---|
4340 | 5886 | } |
---|
.. | .. |
---|
4433 | 5979 | try |
---|
4434 | 5980 | { |
---|
4435 | 5981 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4436 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4437 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 5982 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5983 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4438 | 5984 | |
---|
4439 | 5985 | Object3D objectparent = obj.parent; |
---|
4440 | 5986 | obj.parent = null; |
---|
4441 | 5987 | |
---|
4442 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 5988 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4443 | 5989 | |
---|
4444 | 5990 | obj.parent = objectparent; |
---|
4445 | 5991 | |
---|
.. | .. |
---|
4451 | 5997 | p.writeObject(object); |
---|
4452 | 5998 | p.flush(); |
---|
4453 | 5999 | |
---|
| 6000 | + zstream.close(); |
---|
4454 | 6001 | ostream.close(); |
---|
4455 | | - // zstream.close(); |
---|
4456 | 6002 | |
---|
4457 | 6003 | // group.selection.get(0).parent = parent; |
---|
4458 | 6004 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4473 | 6019 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4474 | 6020 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4475 | 6021 | copy.generatePOV(buffer); |
---|
4476 | | - if (GrafreeD.standAlone) |
---|
| 6022 | + if (Grafreed.standAlone) |
---|
4477 | 6023 | { |
---|
4478 | 6024 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4479 | 6025 | browser.show(); |
---|
.. | .. |
---|
4499 | 6045 | Object3D client; |
---|
4500 | 6046 | Object3D copy; |
---|
4501 | 6047 | MenuBar menuBar; |
---|
4502 | | - Menu windowMenu; |
---|
4503 | | - MenuItem loadItem; |
---|
| 6048 | + Menu fileMenu; |
---|
| 6049 | + MenuItem newItem; |
---|
| 6050 | + MenuItem openItem; |
---|
4504 | 6051 | MenuItem saveItem; |
---|
4505 | 6052 | MenuItem saveAsItem; |
---|
4506 | 6053 | MenuItem exportAsItem; |
---|
4507 | 6054 | MenuItem reexportItem; |
---|
4508 | 6055 | MenuItem povItem; |
---|
4509 | 6056 | MenuItem closeItem; |
---|
4510 | | - Menu cameraMenu; |
---|
| 6057 | + |
---|
4511 | 6058 | CheckboxMenuItem zBufferItem; |
---|
4512 | 6059 | //MenuItem normalLensItem; |
---|
4513 | | - MenuItem editCameraItem; |
---|
4514 | | - MenuItem revertCameraItem; |
---|
4515 | | - CheckboxMenuItem toggleLiveItem; |
---|
4516 | 6060 | MenuItem stepItem; |
---|
| 6061 | + CheckboxMenuItem toggleLiveItem; |
---|
4517 | 6062 | CheckboxMenuItem toggleFullScreenItem; |
---|
4518 | 6063 | CheckboxMenuItem toggleTimelineItem; |
---|
4519 | 6064 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4522 | 6067 | CheckboxMenuItem toggleFootContactItem; |
---|
4523 | 6068 | CheckboxMenuItem toggleDLItem; |
---|
4524 | 6069 | CheckboxMenuItem toggleTextureItem; |
---|
4525 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 6070 | + CheckboxMenuItem toggleSwitchItem; |
---|
4526 | 6071 | CheckboxMenuItem toggleRootItem; |
---|
4527 | 6072 | CheckboxMenuItem animationItem; |
---|
| 6073 | + MenuItem archiveItem; |
---|
4528 | 6074 | CheckboxMenuItem toggleHandleItem; |
---|
4529 | 6075 | CheckboxMenuItem togglePaintItem; |
---|
4530 | 6076 | JSplitPane mainPanel; |
---|
4531 | 6077 | JScrollPane scrollpane; |
---|
| 6078 | + |
---|
4532 | 6079 | JPanel toolbarPanel; |
---|
4533 | | - JPanel treePanel; |
---|
| 6080 | + |
---|
| 6081 | + cGridBag treePanel; |
---|
| 6082 | + |
---|
4534 | 6083 | JPanel radioPanel; |
---|
4535 | 6084 | ButtonGroup buttonGroup; |
---|
4536 | | - JPanel ctrlPanel; |
---|
4537 | | - JPanel materialPanel; |
---|
| 6085 | + |
---|
| 6086 | + cGridBag toolboxPanel; |
---|
| 6087 | + cGridBag skyboxPanel; |
---|
| 6088 | + cGridBag materialPanel; |
---|
| 6089 | + cGridBag ctrlPanel; |
---|
| 6090 | + |
---|
4538 | 6091 | JScrollPane infoPanel; |
---|
4539 | | - JPanel optionsPanel; |
---|
| 6092 | + |
---|
| 6093 | + cGridBag optionsPanel; |
---|
| 6094 | + |
---|
4540 | 6095 | JTabbedPane objectPanel; |
---|
4541 | | - JPanel XYZPanel; |
---|
| 6096 | + boolean materialFlushed; |
---|
| 6097 | + Object3D latestObject; |
---|
| 6098 | + |
---|
| 6099 | + cGridBag transformPanel; |
---|
| 6100 | + cGridBag XYZPanel; |
---|
| 6101 | + |
---|
4542 | 6102 | JSplitPane gridPanel; |
---|
4543 | 6103 | JSplitPane bigPanel; |
---|
4544 | | - JPanel bigThree; |
---|
4545 | | - JTabbedPane scenePanel; |
---|
4546 | | - JPanel centralPanel; |
---|
| 6104 | + |
---|
| 6105 | + cGridBag bigThree; |
---|
| 6106 | + cGridBag scenePanel; |
---|
| 6107 | + cGridBag centralPanel; |
---|
4547 | 6108 | JSplitPane cameraPanel; |
---|
4548 | 6109 | JPanel timelinePanel; |
---|
4549 | 6110 | JMenuBar timelineMenubar; |
---|
.. | .. |
---|
4596 | 6157 | // MATERIAL |
---|
4597 | 6158 | JLabel materialLabel; |
---|
4598 | 6159 | JLabel colorLabel; |
---|
4599 | | - NumberSlider colorField; |
---|
| 6160 | + cNumberSlider colorField; |
---|
4600 | 6161 | JLabel modulationLabel; |
---|
4601 | | - NumberSlider modulationField; |
---|
| 6162 | + cNumberSlider saturationField; |
---|
4602 | 6163 | JLabel metalnessLabel; |
---|
4603 | | - NumberSlider metalnessField; |
---|
| 6164 | + cNumberSlider metalnessField; |
---|
4604 | 6165 | JLabel diffuseLabel; |
---|
4605 | | - NumberSlider diffuseField; |
---|
| 6166 | + cNumberSlider diffuseField; |
---|
4606 | 6167 | JLabel specularLabel; |
---|
4607 | | - NumberSlider specularField; |
---|
| 6168 | + cNumberSlider specularField; |
---|
4608 | 6169 | JLabel shininessLabel; |
---|
4609 | | - NumberSlider shininessField; |
---|
| 6170 | + cNumberSlider shininessField; |
---|
4610 | 6171 | JLabel shiftLabel; |
---|
4611 | | - NumberSlider shiftField; |
---|
| 6172 | + cNumberSlider shiftField; |
---|
4612 | 6173 | JLabel ambientLabel; |
---|
4613 | | - NumberSlider ambientField; |
---|
| 6174 | + cNumberSlider ambientField; |
---|
4614 | 6175 | JLabel lightareaLabel; |
---|
4615 | | - NumberSlider lightareaField; |
---|
| 6176 | + cNumberSlider lightareaField; |
---|
4616 | 6177 | JLabel diffusenessLabel; |
---|
4617 | | - NumberSlider diffusenessField; |
---|
| 6178 | + cNumberSlider diffusenessField; |
---|
4618 | 6179 | JLabel velvetLabel; |
---|
4619 | | - NumberSlider velvetField; |
---|
| 6180 | + cNumberSlider velvetField; |
---|
4620 | 6181 | JLabel sheenLabel; |
---|
4621 | | - NumberSlider sheenField; |
---|
| 6182 | + cNumberSlider sheenField; |
---|
4622 | 6183 | JLabel subsurfaceLabel; |
---|
4623 | | - NumberSlider subsurfaceField; |
---|
| 6184 | + cNumberSlider subsurfaceField; |
---|
4624 | 6185 | //JLabel bumpLabel; |
---|
4625 | 6186 | //NumberSlider bumpField; |
---|
4626 | 6187 | JLabel backlitLabel; |
---|
4627 | | - NumberSlider backlitField; |
---|
| 6188 | + cNumberSlider backlitField; |
---|
4628 | 6189 | JLabel anisoLabel; |
---|
4629 | | - NumberSlider anisoField; |
---|
| 6190 | + cNumberSlider anisoField; |
---|
4630 | 6191 | JLabel anisoVLabel; |
---|
4631 | | - NumberSlider anisoVField; |
---|
| 6192 | + cNumberSlider anisoVField; |
---|
| 6193 | + |
---|
4632 | 6194 | JLabel cameraLabel; |
---|
4633 | | - NumberSlider cameraField; |
---|
| 6195 | + cNumberSlider cameraField; |
---|
4634 | 6196 | JLabel selfshadowLabel; |
---|
4635 | | - NumberSlider selfshadowField; |
---|
| 6197 | + cNumberSlider selfshadowField; |
---|
4636 | 6198 | JLabel shadowLabel; |
---|
4637 | | - NumberSlider shadowField; |
---|
| 6199 | + cNumberSlider shadowField; |
---|
4638 | 6200 | JLabel textureLabel; |
---|
4639 | | - NumberSlider textureField; |
---|
| 6201 | + cNumberSlider textureField; |
---|
4640 | 6202 | JLabel opacityLabel; |
---|
4641 | | - NumberSlider opacityField; |
---|
| 6203 | + cNumberSlider opacityField; |
---|
4642 | 6204 | JLabel fakedepthLabel; |
---|
4643 | | - NumberSlider fakedepthField; |
---|
| 6205 | + cNumberSlider fakedepthField; |
---|
4644 | 6206 | JLabel shadowbiasLabel; |
---|
4645 | | - NumberSlider shadowbiasField; |
---|
| 6207 | + cNumberSlider shadowbiasField; |
---|
| 6208 | + |
---|
4646 | 6209 | JLabel bumpLabel; |
---|
4647 | | - NumberSlider bumpField; |
---|
| 6210 | + cNumberSlider bumpField; |
---|
4648 | 6211 | JLabel noiseLabel; |
---|
4649 | | - NumberSlider noiseField; |
---|
| 6212 | + cNumberSlider noiseField; |
---|
4650 | 6213 | JLabel powerLabel; |
---|
4651 | | - NumberSlider powerField; |
---|
| 6214 | + cNumberSlider powerField; |
---|
4652 | 6215 | JLabel borderfadeLabel; |
---|
4653 | | - NumberSlider borderfadeField; |
---|
| 6216 | + cNumberSlider borderfadeField; |
---|
4654 | 6217 | JLabel fogLabel; |
---|
4655 | | - NumberSlider fogField; |
---|
| 6218 | + cNumberSlider fogField; |
---|
4656 | 6219 | JLabel opacityPowerLabel; |
---|
4657 | | - NumberSlider opacityPowerField; |
---|
4658 | | - JTree jTree; |
---|
| 6220 | + cNumberSlider opacityPowerField; |
---|
| 6221 | + cTree jTree; |
---|
4659 | 6222 | //ObjectUI parent; |
---|
4660 | 6223 | |
---|
4661 | | - NumberSlider normalpushField; |
---|
| 6224 | + cNumberSlider normalpushField; |
---|
| 6225 | + |
---|
| 6226 | + private MenuItem importGFDItem; |
---|
| 6227 | + private MenuItem importVRMLX3DItem; |
---|
| 6228 | + private MenuItem import3DSItem; |
---|
| 6229 | + private MenuItem importOBJItem; |
---|
4662 | 6230 | } |
---|