.. | .. |
---|
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 | + if (Globals.ADVANCED) |
---|
| 464 | + { |
---|
| 465 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 466 | + importVRMLX3DItem.addActionListener(this); |
---|
| 467 | + } |
---|
| 468 | + menu.add("-"); |
---|
| 469 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 470 | + importGFDItem.addActionListener(this); |
---|
| 471 | + fileMenu.add(menu); |
---|
| 472 | + fileMenu.add("-"); |
---|
| 473 | + |
---|
| 474 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 475 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
275 | 476 | //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("-"); |
---|
| 477 | + fileMenu.add("-"); |
---|
| 478 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 479 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 480 | + fileMenu.add("-"); |
---|
280 | 481 | if (client.parent != null) |
---|
281 | 482 | { |
---|
282 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 483 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
283 | 484 | } else |
---|
284 | 485 | { |
---|
285 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 486 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
286 | 487 | } |
---|
287 | 488 | |
---|
288 | | - loadItem.addActionListener(this); |
---|
| 489 | + newItem.addActionListener(this); |
---|
| 490 | + openItem.addActionListener(this); |
---|
289 | 491 | saveItem.addActionListener(this); |
---|
290 | 492 | saveAsItem.addActionListener(this); |
---|
291 | 493 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
293 | 495 | //povItem.addActionListener(this); |
---|
294 | 496 | closeItem.addActionListener(this); |
---|
295 | 497 | |
---|
296 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
297 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
298 | | - //zBufferItem.addActionListener(this); |
---|
299 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
300 | | - //normalLensItem.addActionListener(this); |
---|
301 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
302 | | - revertCameraItem.addActionListener(this); |
---|
303 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
304 | | - toggleTimelineItem.addItemListener(this); |
---|
305 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
306 | | - toggleFullScreenItem.addItemListener(this); |
---|
307 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
308 | | - cameraMenu.add("-"); |
---|
309 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
310 | | - toggleTextureItem.addItemListener(this); |
---|
311 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
312 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
313 | | - toggleLiveItem.addItemListener(this); |
---|
314 | | - toggleLiveItem.setState(Globals.isLIVE()); |
---|
315 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
316 | | - stepItem.addActionListener(this); |
---|
317 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
318 | | -// toggleDLItem.addItemListener(this); |
---|
319 | | -// toggleDLItem.setState(false); |
---|
320 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
321 | | - toggleRenderItem.addItemListener(this); |
---|
322 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
323 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
324 | | - toggleDebugItem.addItemListener(this); |
---|
325 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
326 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
327 | | - toggleFrustumItem.addItemListener(this); |
---|
328 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
329 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
330 | | - toggleFootContactItem.addItemListener(this); |
---|
331 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
332 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
333 | | - toggleRandomItem.addItemListener(this); |
---|
334 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
335 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
336 | | - toggleHandleItem.addItemListener(this); |
---|
337 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
338 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
339 | | - togglePaintItem.addItemListener(this); |
---|
340 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
341 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
342 | | -// toggleRootItem.addItemListener(this); |
---|
343 | | -// toggleRootItem.setState(false); |
---|
344 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
345 | | -// animationItem.addItemListener(this); |
---|
346 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
347 | | - cameraMenu.add("-"); |
---|
348 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
349 | | - editCameraItem.addActionListener(this); |
---|
350 | | - |
---|
351 | 498 | objectPanel = new JTabbedPane(); |
---|
| 499 | + |
---|
| 500 | + ChangeListener changeListener = new ChangeListener() |
---|
| 501 | + { |
---|
| 502 | + //String name; |
---|
| 503 | + |
---|
| 504 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 505 | + { |
---|
| 506 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 507 | +// { |
---|
| 508 | +// if (latestObject != null) |
---|
| 509 | +// { |
---|
| 510 | +// refreshContents(true); |
---|
| 511 | +// SetMaterial(latestObject); |
---|
| 512 | +// } |
---|
| 513 | +// |
---|
| 514 | +// materialFlushed = true; |
---|
| 515 | +// } |
---|
| 516 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 517 | +// { |
---|
| 518 | +// if (listUI.size() == 0) |
---|
| 519 | +// EditSelection(false); |
---|
| 520 | +// } |
---|
| 521 | + |
---|
| 522 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 523 | +// { |
---|
| 524 | +// name = copy.skyboxname; |
---|
| 525 | +// |
---|
| 526 | +// if (name == null) |
---|
| 527 | +// { |
---|
| 528 | +// name = ""; |
---|
| 529 | +// } |
---|
| 530 | +// |
---|
| 531 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 532 | +// copy.skyboxext = "jpg"; |
---|
| 533 | +// } |
---|
| 534 | +// else |
---|
| 535 | +// { |
---|
| 536 | +// if (name != null) |
---|
| 537 | +// { |
---|
| 538 | +// if (name.equals("")) |
---|
| 539 | +// { |
---|
| 540 | +// copy.skyboxname = null; |
---|
| 541 | +// copy.skyboxext = null; |
---|
| 542 | +// } |
---|
| 543 | +// else |
---|
| 544 | +// { |
---|
| 545 | +// copy.skyboxname = name; |
---|
| 546 | +// } |
---|
| 547 | +// } |
---|
| 548 | +// } |
---|
| 549 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 550 | + |
---|
| 551 | +// refreshContents(false); // To refresh Info tab |
---|
| 552 | + cameraView.repaint(); |
---|
| 553 | + } |
---|
| 554 | + }; |
---|
| 555 | + objectPanel.addChangeListener(changeListener); |
---|
| 556 | + |
---|
352 | 557 | toolbarPanel = new JPanel(); |
---|
353 | 558 | toolbarPanel.setName("Toolbar"); |
---|
354 | | - treePanel = new JPanel(); |
---|
| 559 | + |
---|
| 560 | + treePanel = new cGridBag(); |
---|
355 | 561 | treePanel.setName("Tree"); |
---|
356 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
357 | | - ctrlPanel.setName("Edit"); |
---|
358 | | - materialPanel = new JPanel(); |
---|
359 | | - materialPanel.setName("Material"); |
---|
| 562 | + |
---|
| 563 | + editPanel = new cGridBag().setVertical(true); |
---|
| 564 | + //editPanel.setName("Edit"); |
---|
| 565 | + |
---|
| 566 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
| 567 | + |
---|
| 568 | + editCommandsPanel = new cGridBag(); |
---|
| 569 | + editPanel.add(editCommandsPanel); |
---|
| 570 | + editPanel.add(ctrlPanel); |
---|
| 571 | + |
---|
| 572 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 573 | + //toolboxPanel.setName("Toolbox"); |
---|
| 574 | + |
---|
| 575 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 576 | + |
---|
| 577 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 578 | + //materialPanel.setName("Material"); |
---|
| 579 | + |
---|
360 | 580 | /*JTextPane*/ |
---|
361 | 581 | infoarea = createTextPane(); |
---|
| 582 | + doc = infoarea.getStyledDocument(); |
---|
| 583 | + |
---|
362 | 584 | infoarea.setEditable(true); |
---|
363 | 585 | SetText(); |
---|
| 586 | + |
---|
364 | 587 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
365 | 588 | // infoarea.setOpaque(false); |
---|
366 | 589 | // //infoarea.setForeground(textcolor); |
---|
367 | | - infoarea.setLineWrap(true); |
---|
368 | | - infoarea.setWrapStyleWord(true); |
---|
| 590 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 591 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
369 | 592 | 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"); |
---|
| 593 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
| 594 | + //infoPanel.setName("Info"); |
---|
372 | 595 | //infoPanel.setLayout(new BorderLayout()); |
---|
373 | 596 | //infoPanel.add(createTextPane()); |
---|
374 | 597 | |
---|
.. | .. |
---|
376 | 599 | mainPanel.setName("Main"); |
---|
377 | 600 | mainPanel.setContinuousLayout(true); |
---|
378 | 601 | mainPanel.setOneTouchExpandable(true); |
---|
379 | | - mainPanel.setDividerLocation(1.0); |
---|
380 | 602 | mainPanel.setDividerSize(9); |
---|
381 | | - mainPanel.setResizeWeight(0); |
---|
382 | | - |
---|
| 603 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 604 | + mainPanel.setResizeWeight(0.5); |
---|
| 605 | + |
---|
| 606 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 607 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 608 | + divider.setDividerSize(15); |
---|
| 609 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 610 | + |
---|
| 611 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 612 | + |
---|
383 | 613 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
384 | 614 | //mainPanel.setLayout(new GridBagLayout()); |
---|
385 | 615 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
386 | | - treePanel.setLayout(new GridBagLayout()); |
---|
387 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
388 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 616 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 617 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 618 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
389 | 619 | |
---|
390 | 620 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
391 | 621 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
424 | 654 | static String newline = "\n"; |
---|
425 | 655 | protected static final String buttonString = "JButton"; |
---|
426 | 656 | StyledDocument doc; |
---|
427 | | - JTextArea infoarea; |
---|
| 657 | + JTextPane infoarea; |
---|
428 | 658 | |
---|
429 | 659 | void ClearInfo() |
---|
430 | 660 | { |
---|
.. | .. |
---|
447 | 677 | e.printStackTrace(); |
---|
448 | 678 | } |
---|
449 | 679 | |
---|
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(); |
---|
| 680 | +// String selection = infoarea.getText(); |
---|
| 681 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 682 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 683 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
454 | 684 | //clipboard.setContents(data, data); |
---|
455 | 685 | } |
---|
456 | 686 | |
---|
.. | .. |
---|
473 | 703 | //SendInfo("Name:", "bold"); |
---|
474 | 704 | if (sel.GetTextures() != null || debug) |
---|
475 | 705 | { |
---|
476 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 706 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
477 | 707 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
478 | 708 | if (sel.Size() > 0) |
---|
479 | 709 | { |
---|
480 | 710 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
481 | 711 | } |
---|
482 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 712 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
483 | 713 | if (debug) |
---|
484 | 714 | { |
---|
485 | 715 | try |
---|
.. | .. |
---|
491 | 721 | } |
---|
492 | 722 | |
---|
493 | 723 | if (full) |
---|
494 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 724 | + { |
---|
| 725 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 726 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 727 | + } |
---|
495 | 728 | |
---|
496 | 729 | if (sel.bRep != null) |
---|
497 | 730 | { |
---|
.. | .. |
---|
518 | 751 | } |
---|
519 | 752 | if (sel.support != null) |
---|
520 | 753 | { |
---|
521 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 754 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
522 | 755 | } |
---|
523 | 756 | if (sel.scriptnode != null) |
---|
524 | 757 | { |
---|
.. | .. |
---|
589 | 822 | { |
---|
590 | 823 | CameraPane.pointflow = (PointFlow) sel; |
---|
591 | 824 | } |
---|
| 825 | + |
---|
| 826 | + si.SendInfo("_____________________", "regular"); |
---|
| 827 | + si.SendInfo("", "regular"); |
---|
592 | 828 | } |
---|
593 | 829 | } |
---|
594 | 830 | |
---|
.. | .. |
---|
604 | 840 | } |
---|
605 | 841 | } |
---|
606 | 842 | |
---|
| 843 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 844 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 845 | + |
---|
| 846 | + Rectangle keeprect; |
---|
| 847 | + cRadio radio; |
---|
| 848 | + |
---|
| 849 | +cButton keepButton; |
---|
| 850 | + cButton twoButton; // Full 3D |
---|
| 851 | + cButton sixButton; |
---|
| 852 | + cButton threeButton; |
---|
| 853 | + cButton sevenButton; |
---|
| 854 | + cButton fourButton; // full panel |
---|
| 855 | + cButton oneButton; // full XYZ |
---|
| 856 | + //cButton currentLayout; |
---|
| 857 | + |
---|
| 858 | + boolean maximized; |
---|
| 859 | + |
---|
| 860 | + cButton fullscreenLayout; |
---|
| 861 | + cButton expandedLayout; |
---|
| 862 | + |
---|
| 863 | + void Minimize() |
---|
| 864 | + { |
---|
| 865 | + frame.setState(Frame.ICONIFIED); |
---|
| 866 | + frame.validate(); |
---|
| 867 | + } |
---|
| 868 | + |
---|
| 869 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 870 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 871 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
| 872 | + void Maximize() |
---|
| 873 | + { |
---|
| 874 | + if (CameraPane.FULLSCREEN) |
---|
| 875 | + { |
---|
| 876 | + ToggleFullScreen(); |
---|
| 877 | + } |
---|
| 878 | + |
---|
| 879 | + if (maximized) |
---|
| 880 | + { |
---|
| 881 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 882 | + } |
---|
| 883 | + else |
---|
| 884 | + { |
---|
| 885 | + keeprect = frame.getBounds(); |
---|
| 886 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 887 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 888 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 889 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 890 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
| 891 | + } |
---|
| 892 | + |
---|
| 893 | + maximized ^= true; |
---|
| 894 | + |
---|
| 895 | + frame.validate(); |
---|
| 896 | + } |
---|
| 897 | + |
---|
| 898 | + cButton minButton; |
---|
| 899 | + cButton maxButton; |
---|
| 900 | + cButton fullButton; |
---|
| 901 | + cButton collapseButton; |
---|
| 902 | + cButton maximize3DButton; |
---|
| 903 | + |
---|
607 | 904 | void ToggleFullScreen() |
---|
608 | 905 | { |
---|
609 | | - if (CameraPane.FULLSCREEN) |
---|
| 906 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 907 | + |
---|
| 908 | + cameraView.ToggleFullScreen(); |
---|
| 909 | + |
---|
| 910 | + if (!CameraPane.FULLSCREEN) |
---|
610 | 911 | { |
---|
611 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
612 | | - framePanel.add(bigThree); |
---|
613 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 912 | + device.setFullScreenWindow(null); |
---|
| 913 | + frame.dispose(); |
---|
| 914 | + frame.setUndecorated(false); |
---|
| 915 | + frame.validate(); |
---|
| 916 | + frame.setVisible(true); |
---|
| 917 | + |
---|
| 918 | + //frame.setVisible(false); |
---|
| 919 | +// frame.removeNotify(); |
---|
| 920 | +// frame.setUndecorated(false); |
---|
| 921 | +// frame.addNotify(); |
---|
| 922 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 923 | + |
---|
| 924 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 925 | +// X framePanel.add(bigThree); |
---|
| 926 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 927 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
| 928 | + |
---|
| 929 | + //frame.setVisible(true); |
---|
| 930 | +// radio.layout = keepButton; |
---|
| 931 | + //theFrame = null; |
---|
| 932 | + keepButton = null; |
---|
| 933 | +// radio.layout.doClick(); |
---|
| 934 | + |
---|
614 | 935 | } else |
---|
615 | 936 | { |
---|
616 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
617 | | - framePanel.remove(bigThree); |
---|
618 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 937 | + keepButton = radio.layout; |
---|
| 938 | + //keeprect = frame.getBounds(); |
---|
| 939 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 940 | +// frame.getToolkit().getScreenSize().height); |
---|
| 941 | + //frame.setVisible(false); |
---|
| 942 | + |
---|
| 943 | + frame.dispose(); |
---|
| 944 | + frame.setUndecorated(true); |
---|
| 945 | + device.setFullScreenWindow(frame); |
---|
| 946 | + frame.validate(); |
---|
| 947 | + frame.setVisible(true); |
---|
| 948 | +// frame.removeNotify(); |
---|
| 949 | +// frame.setUndecorated(true); |
---|
| 950 | +// frame.addNotify(); |
---|
| 951 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 952 | +// X framePanel.remove(bigThree); |
---|
| 953 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 954 | +// framePanel.setDividerLocation(0); |
---|
| 955 | + |
---|
| 956 | +// radio.layout = fullscreenLayout; |
---|
| 957 | +// radio.layout.doClick(); |
---|
| 958 | + //frame.setVisible(true); |
---|
619 | 959 | } |
---|
620 | | - cameraView.ToggleFullScreen(); |
---|
| 960 | + frame.validate(); |
---|
| 961 | + |
---|
| 962 | + cameraView.requestFocusInWindow(); |
---|
621 | 963 | } |
---|
622 | 964 | |
---|
623 | | - private JTextArea createTextPane() |
---|
| 965 | + void CollapseToolbar() |
---|
| 966 | + { |
---|
| 967 | + framePanel.setDividerLocation(0); |
---|
| 968 | + //frame.validate(); |
---|
| 969 | + |
---|
| 970 | + cameraView.requestFocusInWindow(); |
---|
| 971 | + } |
---|
| 972 | + |
---|
| 973 | + private Object3D Duplicate(Object3D object) |
---|
624 | 974 | { |
---|
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 | | - }; |
---|
| 975 | + boolean temp = CameraPane.SWITCH; |
---|
| 976 | + CameraPane.SWITCH = false; |
---|
| 977 | + |
---|
| 978 | + if (Grafreed.grafreed.universe.versiontable == null) |
---|
| 979 | + Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 980 | + |
---|
| 981 | + object.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 982 | + // if (copy == client) |
---|
| 983 | + |
---|
| 984 | + Object3D versions[] = object.versionlist; |
---|
| 985 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe |
---|
| 986 | + object.versionlist = null; |
---|
| 987 | + object.versiontable = null; |
---|
| 988 | + |
---|
| 989 | + Object3D parent = object.parent; |
---|
| 990 | + object.parent = null; |
---|
| 991 | + |
---|
| 992 | + //byte[] compress = Compress(copy); |
---|
| 993 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
| 994 | + |
---|
| 995 | + object.parent = parent; |
---|
| 996 | + |
---|
| 997 | + object.versionlist = versions; |
---|
| 998 | + object.versiontable = versiontable; // if Grafreed.grafreed.universe |
---|
| 999 | + |
---|
| 1000 | + object.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 1001 | + |
---|
| 1002 | + CameraPane.SWITCH = temp; |
---|
| 1003 | + |
---|
| 1004 | + return compress; |
---|
| 1005 | + } |
---|
640 | 1006 | |
---|
641 | | - String[] initStyles = |
---|
642 | | - { |
---|
643 | | - "regular", "italic", "bold", "small", "large", |
---|
644 | | - "regular", "button", "regular", "icon", |
---|
645 | | - "regular" |
---|
646 | | - }; |
---|
| 1007 | + private JTextPane createTextPane() |
---|
| 1008 | + { |
---|
| 1009 | +// TEXTAREA String[] initString = |
---|
| 1010 | +// { |
---|
| 1011 | +// "This is an editable JTextPane, ", //regular |
---|
| 1012 | +// "another ", //italic |
---|
| 1013 | +// "styled ", //bold |
---|
| 1014 | +// "text ", //small |
---|
| 1015 | +// "component, ", //large |
---|
| 1016 | +// "which supports embedded components..." + newline,//regular |
---|
| 1017 | +// " " + newline, //button |
---|
| 1018 | +// "...and embedded icons..." + newline, //regular |
---|
| 1019 | +// " ", //icon |
---|
| 1020 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 1021 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 1022 | +// + "cover methods for interacting with those objects." |
---|
| 1023 | +// }; |
---|
| 1024 | +// |
---|
| 1025 | +// String[] initStyles = |
---|
| 1026 | +// { |
---|
| 1027 | +// "regular", "italic", "bold", "small", "large", |
---|
| 1028 | +// "regular", "button", "regular", "icon", |
---|
| 1029 | +// "regular" |
---|
| 1030 | +// }; |
---|
| 1031 | +// |
---|
| 1032 | +// JTextPane textPane = new JTextPane(); |
---|
| 1033 | +// textPane.setEditable(true); |
---|
| 1034 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 1035 | +// addStylesToDocument(doc); |
---|
| 1036 | +// |
---|
| 1037 | +// try |
---|
| 1038 | +// { |
---|
| 1039 | +// for (int j = 0; j < 2; j++) |
---|
| 1040 | +// { |
---|
| 1041 | +// for (int i = 0; i < initString.length; i++) |
---|
| 1042 | +// { |
---|
| 1043 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 1044 | +// doc.getStyle(initStyles[i])); |
---|
| 1045 | +// } |
---|
| 1046 | +// } |
---|
| 1047 | +// } catch (BadLocationException ble) |
---|
| 1048 | +// { |
---|
| 1049 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 1050 | +// } |
---|
647 | 1051 | |
---|
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; |
---|
| 1052 | + return new JTextPane(); // textPane; |
---|
669 | 1053 | } |
---|
670 | 1054 | |
---|
671 | 1055 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
718 | 1102 | protected static ImageIcon createImageIcon(String path, |
---|
719 | 1103 | String description) |
---|
720 | 1104 | { |
---|
721 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 1105 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
722 | 1106 | if (imgURL != null) |
---|
723 | 1107 | { |
---|
724 | 1108 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
741 | 1125 | { |
---|
742 | 1126 | SetupMaterial(materialPanel); |
---|
743 | 1127 | } |
---|
| 1128 | + |
---|
744 | 1129 | //SetupName(); |
---|
745 | 1130 | //SetupViews(); |
---|
746 | 1131 | } |
---|
.. | .. |
---|
750 | 1135 | // NumberSlider vDivsField; |
---|
751 | 1136 | // JCheckBox endcaps; |
---|
752 | 1137 | JCheckBox liveCB; |
---|
| 1138 | + JCheckBox selectableCB; |
---|
753 | 1139 | JCheckBox hideCB; |
---|
754 | 1140 | JCheckBox link2masterCB; |
---|
755 | 1141 | JCheckBox markCB; |
---|
.. | .. |
---|
757 | 1143 | JCheckBox speedupCB; |
---|
758 | 1144 | JCheckBox rewindCB; |
---|
759 | 1145 | JCheckBox flipVCB; |
---|
| 1146 | + |
---|
| 1147 | + cCheckBox toggleTextureCB; |
---|
| 1148 | + cCheckBox toggleSwitchCB; |
---|
| 1149 | + |
---|
760 | 1150 | JComboBox texresMenu; |
---|
| 1151 | + |
---|
761 | 1152 | JButton resetButton; |
---|
762 | 1153 | JButton stepButton; |
---|
763 | 1154 | JButton stepAllButton; |
---|
.. | .. |
---|
765 | 1156 | JButton slowerButton; |
---|
766 | 1157 | JButton fasterButton; |
---|
767 | 1158 | JButton remarkButton; |
---|
| 1159 | + |
---|
| 1160 | + cGridBag editPanel; |
---|
| 1161 | + cGridBag editCommandsPanel; |
---|
| 1162 | + |
---|
| 1163 | + cGridBag namePanel; |
---|
| 1164 | + cGridBag setupPanel; |
---|
| 1165 | + cGridBag setupPanel2; |
---|
| 1166 | + cGridBag objectCommandsPanel; |
---|
| 1167 | + cGridBag pushPanel; |
---|
| 1168 | + cGridBag fillPanel; |
---|
768 | 1169 | |
---|
769 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 1170 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
770 | 1171 | { |
---|
771 | 1172 | JCheckBox cb; |
---|
772 | 1173 | |
---|
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); |
---|
| 1174 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
778 | 1175 | cb.addItemListener(this); |
---|
779 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
780 | | - oe.aConstraints.gridwidth = 1; |
---|
781 | | - oe.aConstraints.gridx += 1; |
---|
782 | 1176 | |
---|
783 | 1177 | return cb; |
---|
784 | 1178 | } |
---|
785 | 1179 | |
---|
786 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 1180 | + cButton AddButton(cGridBag panel, String label) |
---|
787 | 1181 | { |
---|
788 | 1182 | cButton cb; |
---|
789 | 1183 | |
---|
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); |
---|
| 1184 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
795 | 1185 | cb.addActionListener(this); |
---|
796 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
797 | | - oe.aConstraints.gridwidth = 1; |
---|
798 | | - oe.aConstraints.gridx += 1; |
---|
799 | 1186 | |
---|
800 | 1187 | return cb; |
---|
801 | 1188 | } |
---|
802 | 1189 | |
---|
803 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 1190 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
804 | 1191 | { |
---|
805 | 1192 | JComboBox combo; |
---|
806 | 1193 | |
---|
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; |
---|
| 1194 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
810 | 1195 | combo.addActionListener(this); |
---|
811 | 1196 | |
---|
812 | 1197 | return combo; |
---|
813 | 1198 | } |
---|
814 | 1199 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 1200 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
816 | 1201 | { |
---|
817 | | - NumberSlider combo; |
---|
| 1202 | + cGridBag control = new cGridBag(); |
---|
| 1203 | + |
---|
| 1204 | + cNumberSlider combo; |
---|
818 | 1205 | |
---|
819 | 1206 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 1207 | 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 | | - |
---|
| 1208 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1209 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 1210 | combo.setFloat(current); |
---|
833 | | - |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 1211 | + |
---|
| 1212 | + panel.add(control); |
---|
| 1213 | + |
---|
| 1214 | + return control; |
---|
839 | 1215 | } |
---|
840 | 1216 | |
---|
841 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 1217 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
842 | 1218 | { |
---|
843 | | - NumberSlider combo; |
---|
| 1219 | + cGridBag control = new cGridBag(); |
---|
| 1220 | + |
---|
| 1221 | + cNumberSlider combo; |
---|
844 | 1222 | |
---|
845 | 1223 | JLabel jlabel = new JLabel(label); |
---|
846 | | - |
---|
847 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
848 | 1224 | 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 | | - |
---|
| 1225 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1226 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
858 | 1227 | combo.setInteger(current); |
---|
859 | 1228 | |
---|
860 | | - combo.label = jlabel; |
---|
861 | | - |
---|
862 | | - combo.addChangeListener(this); |
---|
863 | | - |
---|
864 | | - return combo; |
---|
| 1229 | + panel.add(control); |
---|
| 1230 | + |
---|
| 1231 | + return control; |
---|
865 | 1232 | } |
---|
866 | 1233 | |
---|
867 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 1234 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
868 | 1235 | { |
---|
869 | 1236 | JTextArea text; |
---|
870 | 1237 | |
---|
871 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
872 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
873 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1238 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
874 | 1239 | text.addCaretListener(this); |
---|
875 | | - aConstraints.gridx += 1; |
---|
876 | | - aConstraints.gridwidth = 1; |
---|
877 | 1240 | |
---|
878 | 1241 | return text; |
---|
879 | 1242 | } |
---|
.. | .. |
---|
903 | 1266 | objEditor.ctrlPanel.remove(j); |
---|
904 | 1267 | } |
---|
905 | 1268 | |
---|
| 1269 | + void Remove(cNumberSlider j) |
---|
| 1270 | + { |
---|
| 1271 | + j.removeChangeListener(this); |
---|
| 1272 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 1273 | + objEditor.ctrlPanel.remove(j); |
---|
| 1274 | + } |
---|
| 1275 | + |
---|
906 | 1276 | /* |
---|
907 | 1277 | */ |
---|
908 | | - void Return() // ObjEditor oe) |
---|
| 1278 | + void Return0() // ObjEditor oe) |
---|
909 | 1279 | { |
---|
910 | 1280 | aConstraints.gridy += 1; |
---|
911 | 1281 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
960 | 1330 | |
---|
961 | 1331 | void SetupUI2(ObjEditor oe) |
---|
962 | 1332 | { |
---|
963 | | -// oe.aConstraints.weightx = 0; |
---|
964 | | -// oe.aConstraints.weighty = 0; |
---|
965 | | -// oe.aConstraints.gridx = 0; |
---|
966 | | -// oe.aConstraints.gridy = 0; |
---|
967 | | - SetupName(oe); |
---|
| 1333 | + //SetupName(oe); |
---|
968 | 1334 | |
---|
969 | | - if (!GroupEditor.allparams) |
---|
| 1335 | + namePanel = new cGridBag(); |
---|
| 1336 | + |
---|
| 1337 | + //if (copy.pinned) |
---|
| 1338 | + { |
---|
| 1339 | + pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF); |
---|
| 1340 | + pinButton.setSelected(copy.pinned); |
---|
| 1341 | + cGridBag t = new cGridBag(); |
---|
| 1342 | + t.preferredWidth = 2; |
---|
| 1343 | + t.add(pinButton); |
---|
| 1344 | + namePanel.add(t); |
---|
| 1345 | + |
---|
| 1346 | + pinButton.addItemListener(this); |
---|
| 1347 | + } |
---|
| 1348 | + |
---|
| 1349 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 1350 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
| 1351 | + oe.ctrlPanel.add(namePanel); |
---|
| 1352 | + |
---|
| 1353 | + oe.ctrlPanel.Return(); |
---|
| 1354 | + |
---|
| 1355 | + if (!allparams) |
---|
970 | 1356 | return; |
---|
971 | 1357 | |
---|
972 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
973 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
974 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1358 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1359 | + |
---|
| 1360 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1361 | + liveCB.setToolTipText("Animate object"); |
---|
| 1362 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1363 | + markCB.setToolTipText("Set target transform"); |
---|
| 1364 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1365 | + selectableCB.setToolTipText("Make object selectable"); |
---|
975 | 1366 | // 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"); |
---|
| 1367 | + |
---|
| 1368 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1369 | + hideCB.setToolTipText("Hide object"); |
---|
| 1370 | + |
---|
| 1371 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
| 1372 | + |
---|
| 1373 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1374 | + |
---|
| 1375 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1376 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1377 | + |
---|
| 1378 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1379 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
| 1380 | + |
---|
| 1381 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1382 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1383 | + |
---|
| 1384 | + if (Globals.ADVANCED) |
---|
| 1385 | + { |
---|
| 1386 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1387 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1388 | + } |
---|
| 1389 | + |
---|
| 1390 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1391 | + oe.ctrlPanel.Return(); |
---|
| 1392 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1393 | + oe.ctrlPanel.Return(); |
---|
| 1394 | + |
---|
| 1395 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
| 1396 | + |
---|
| 1397 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1398 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1399 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1400 | + stepButton.setToolTipText("Step one frame"); |
---|
982 | 1401 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
983 | 1402 | // stepAllButton = AddButton(oe, "Step All"); |
---|
984 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
985 | 1403 | // Return(); |
---|
986 | | - slowerButton = AddButton(oe, "Slow"); |
---|
987 | | - fasterButton = AddButton(oe, "Fast"); |
---|
988 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1404 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1405 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1406 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1407 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1408 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1409 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
989 | 1410 | |
---|
990 | | - Return(); |
---|
| 1411 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
| 1412 | + oe.ctrlPanel.Return(); |
---|
991 | 1413 | |
---|
992 | | - normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
993 | | - Return(); |
---|
| 1414 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1415 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1416 | + //Return(); |
---|
| 1417 | + |
---|
| 1418 | + oe.ctrlPanel.Return(); |
---|
994 | 1419 | |
---|
995 | 1420 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
996 | 1421 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1085 | 1510 | oe.aConstraints.gridwidth = 1; |
---|
1086 | 1511 | /**/ |
---|
1087 | 1512 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1088 | | - Return(); |
---|
| 1513 | + oe.ctrlPanel.Return(); |
---|
1089 | 1514 | |
---|
1090 | 1515 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1091 | 1516 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1143 | 1568 | |
---|
1144 | 1569 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1145 | 1570 | { |
---|
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); |
---|
| 1571 | + if (Globals.DEBUG) |
---|
| 1572 | + System.out.println("CREATE CAMERAS"); |
---|
| 1573 | + cams = CreateCameras(); |
---|
1162 | 1574 | } else |
---|
1163 | 1575 | { |
---|
1164 | 1576 | cams = (cGroup) copy.get(0); |
---|
.. | .. |
---|
1187 | 1599 | //JPanel worldPanel = |
---|
1188 | 1600 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1189 | 1601 | //worldPanel.setName("World"); |
---|
1190 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
1191 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1192 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1602 | + centralPanel = new cGridBag(); |
---|
| 1603 | + centralPanel.preferredWidth = 20; |
---|
| 1604 | + |
---|
| 1605 | + if (Globals.ADVANCED) |
---|
| 1606 | + { |
---|
| 1607 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1608 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1193 | 1609 | |
---|
1194 | 1610 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1195 | 1611 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1198 | 1614 | // cameraPanel.setDividerSize(9); |
---|
1199 | 1615 | cameraPanel.setResizeWeight(1.0); |
---|
1200 | 1616 | |
---|
| 1617 | + } |
---|
| 1618 | + |
---|
1201 | 1619 | centralPanel.add(cameraView); |
---|
| 1620 | + centralPanel.setFocusable(true); |
---|
1202 | 1621 | //frame.setJMenuBar(timelineMenubar); |
---|
1203 | 1622 | //centralPanel.add(timelinePanel); |
---|
1204 | 1623 | |
---|
.. | .. |
---|
1217 | 1636 | //frontView.object = copy; |
---|
1218 | 1637 | //sideView.object = copy; |
---|
1219 | 1638 | |
---|
1220 | | - XYZPanel = new JPanel(); |
---|
1221 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1639 | + transformPanel = new cGridBag().setVertical(true); |
---|
| 1640 | + |
---|
| 1641 | + cGridBag resetTransformPanel = new cGridBag(); |
---|
| 1642 | + |
---|
| 1643 | + resetTransformPanel.preferredHeight = 2; |
---|
| 1644 | + |
---|
| 1645 | + cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF); |
---|
| 1646 | + resetTransform.setToolTipText("Reset Translation, Rotation and Scale"); |
---|
| 1647 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1648 | + { |
---|
| 1649 | + public void mouseClicked(MouseEvent e) |
---|
| 1650 | + { |
---|
| 1651 | + ResetTransform(); |
---|
| 1652 | + } |
---|
| 1653 | + }); |
---|
| 1654 | + resetTransformPanel.add(resetTransform); |
---|
| 1655 | + |
---|
| 1656 | + resetTransform = GetButton("T only", !Globals.NIMBUSLAF); |
---|
| 1657 | + resetTransform.setToolTipText("Reset Translation only"); |
---|
| 1658 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1659 | + { |
---|
| 1660 | + public void mouseClicked(MouseEvent e) |
---|
| 1661 | + { |
---|
| 1662 | + ResetTransform(1); |
---|
| 1663 | + } |
---|
| 1664 | + }); |
---|
| 1665 | + resetTransformPanel.add(resetTransform); |
---|
| 1666 | + |
---|
| 1667 | + resetTransform = GetButton("RS only", !Globals.NIMBUSLAF); |
---|
| 1668 | + resetTransform.setToolTipText("Reset Rotation and Scale only"); |
---|
| 1669 | + resetTransform.addMouseListener(new MouseAdapter() |
---|
| 1670 | + { |
---|
| 1671 | + public void mouseClicked(MouseEvent e) |
---|
| 1672 | + { |
---|
| 1673 | + ResetTransform(2); |
---|
| 1674 | + } |
---|
| 1675 | + }); |
---|
| 1676 | + resetTransformPanel.add(resetTransform); |
---|
| 1677 | + |
---|
| 1678 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1679 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1222 | 1680 | |
---|
1223 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1224 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1225 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1681 | + XYZPanel.preferredWidth = 5; |
---|
| 1682 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1683 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1684 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1685 | + //XYZPanel.setName("XYZ"); |
---|
1226 | 1686 | |
---|
| 1687 | + transformPanel.add(resetTransformPanel); |
---|
| 1688 | + transformPanel.add(XYZPanel); |
---|
| 1689 | + |
---|
1227 | 1690 | /* |
---|
1228 | 1691 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
1229 | 1692 | gridPanel.setLayout(new GridLayout(1, 2)); |
---|
.. | .. |
---|
1231 | 1694 | gridPanel.add(cameraView); |
---|
1232 | 1695 | gridPanel.add(XYZPanel); |
---|
1233 | 1696 | */ |
---|
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); |
---|
| 1697 | +// gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
| 1698 | +// gridPanel.setContinuousLayout(true); |
---|
| 1699 | +// gridPanel.setOneTouchExpandable(true); |
---|
| 1700 | +// gridPanel.setDividerLocation(1.0); |
---|
| 1701 | +// gridPanel.setDividerSize(9); |
---|
| 1702 | +// gridPanel.setResizeWeight(0.85); |
---|
1240 | 1703 | |
---|
1241 | 1704 | // aConstraints.weighty = 0; |
---|
1242 | 1705 | //System.out.println("THIS = " + this); |
---|
.. | .. |
---|
1259 | 1722 | |
---|
1260 | 1723 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1261 | 1724 | //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); |
---|
| 1725 | + objectPanel.add(skyboxPanel); |
---|
| 1726 | + objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg")); |
---|
| 1727 | + objectPanel.setToolTipTextAt(0, "Backgrounds"); |
---|
| 1728 | + |
---|
| 1729 | + objectPanel.add(toolboxPanel); |
---|
| 1730 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1731 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
1268 | 1732 | |
---|
| 1733 | + objectPanel.add(materialPanel); |
---|
| 1734 | + objectPanel.setIconAt(2, GetIcon("icons/material.png")); |
---|
| 1735 | + objectPanel.setToolTipTextAt(2, "Material"); |
---|
| 1736 | + |
---|
| 1737 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1738 | +// north.setName("Edit"); |
---|
| 1739 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1740 | +// objectPanel.add(north); |
---|
| 1741 | + objectPanel.add(editPanel); |
---|
| 1742 | + objectPanel.setIconAt(3, GetIcon("icons/writewhite.png")); |
---|
| 1743 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
| 1744 | + |
---|
| 1745 | + objectPanel.add(transformPanel); |
---|
| 1746 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1747 | + objectPanel.setToolTipTextAt(4, "TRS transform"); |
---|
| 1748 | + |
---|
| 1749 | + patchMaterial = true; |
---|
| 1750 | + cameraView.patchMaterial = this; |
---|
| 1751 | + objectPanel.setSelectedIndex(2); |
---|
| 1752 | + |
---|
1269 | 1753 | /* |
---|
1270 | 1754 | aConstraints.gridx = 0; |
---|
1271 | 1755 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1273 | 1757 | aConstraints.gridy += 1; |
---|
1274 | 1758 | aConstraints.gridwidth = 1; |
---|
1275 | 1759 | mainPanel.add(objectPanel, aConstraints); |
---|
1276 | | - */ |
---|
| 1760 | + */ |
---|
1277 | 1761 | |
---|
1278 | 1762 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1279 | 1763 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1284 | 1768 | scrollpane.setWheelScrollingEnabled(true); |
---|
1285 | 1769 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1286 | 1770 | |
---|
1287 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1288 | | - scenePanel.add(scrollpane); |
---|
| 1771 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1772 | + scenePanel.preferredWidth = 6; |
---|
| 1773 | + |
---|
| 1774 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1775 | + tabbedPane.add(scrollpane); |
---|
1289 | 1776 | |
---|
1290 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
1291 | | - |
---|
1292 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1777 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1293 | 1778 | |
---|
1294 | 1779 | optionsPanel.setName("Options"); |
---|
1295 | | - scenePanel.add(optionsPanel); |
---|
| 1780 | + |
---|
| 1781 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1782 | + |
---|
| 1783 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1296 | 1784 | |
---|
| 1785 | + tabbedPane.add(optionsPanel); |
---|
| 1786 | + |
---|
| 1787 | + scenePanel.add(tabbedPane); |
---|
| 1788 | + |
---|
| 1789 | + cGridBag creditsPanel = new cGridBag().setVertical(true); |
---|
| 1790 | + creditsPanel.setName("Credits"); |
---|
| 1791 | + |
---|
| 1792 | + cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
| 1793 | + creditsPanel.add(ogaLabel); |
---|
| 1794 | + |
---|
| 1795 | + cButton creditButton; |
---|
| 1796 | + creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
| 1797 | + creditButton.setToolTipText("https://opengameart.org"); |
---|
| 1798 | + |
---|
| 1799 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1800 | + { |
---|
| 1801 | + public void mouseClicked(MouseEvent e) |
---|
| 1802 | + { |
---|
| 1803 | + try |
---|
| 1804 | + { |
---|
| 1805 | + Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/")); |
---|
| 1806 | + } catch (Exception e1) |
---|
| 1807 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1808 | + { |
---|
| 1809 | + e1.printStackTrace(); |
---|
| 1810 | + } |
---|
| 1811 | + } |
---|
| 1812 | + }); |
---|
| 1813 | + |
---|
| 1814 | + ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF); |
---|
| 1815 | + creditsPanel.add(ogaLabel); |
---|
| 1816 | + |
---|
| 1817 | + creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF)); |
---|
| 1818 | + creditButton.setToolTipText("https://3delicious.net"); |
---|
| 1819 | + |
---|
| 1820 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1821 | + { |
---|
| 1822 | + public void mouseClicked(MouseEvent e) |
---|
| 1823 | + { |
---|
| 1824 | + try |
---|
| 1825 | + { |
---|
| 1826 | + Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net")); |
---|
| 1827 | + } catch (Exception e1) |
---|
| 1828 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1829 | + { |
---|
| 1830 | + e1.printStackTrace(); |
---|
| 1831 | + } |
---|
| 1832 | + } |
---|
| 1833 | + }); |
---|
| 1834 | + |
---|
| 1835 | + creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF)); |
---|
| 1836 | + creditButton.setToolTipText("https://archive3d.net"); |
---|
| 1837 | + |
---|
| 1838 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1839 | + { |
---|
| 1840 | + public void mouseClicked(MouseEvent e) |
---|
| 1841 | + { |
---|
| 1842 | + try |
---|
| 1843 | + { |
---|
| 1844 | + Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net")); |
---|
| 1845 | + } catch (Exception e1) |
---|
| 1846 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1847 | + { |
---|
| 1848 | + e1.printStackTrace(); |
---|
| 1849 | + } |
---|
| 1850 | + } |
---|
| 1851 | + }); |
---|
| 1852 | + |
---|
| 1853 | + creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF)); |
---|
| 1854 | + creditButton.setToolTipText("https://turbosquid.com"); |
---|
| 1855 | + |
---|
| 1856 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1857 | + { |
---|
| 1858 | + public void mouseClicked(MouseEvent e) |
---|
| 1859 | + { |
---|
| 1860 | + try |
---|
| 1861 | + { |
---|
| 1862 | + Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free")); |
---|
| 1863 | + } catch (Exception e1) |
---|
| 1864 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1865 | + { |
---|
| 1866 | + e1.printStackTrace(); |
---|
| 1867 | + } |
---|
| 1868 | + } |
---|
| 1869 | + }); |
---|
| 1870 | + |
---|
| 1871 | + for (int i=6; --i>=0;) |
---|
| 1872 | + { |
---|
| 1873 | + creditsPanel.add(new cGridBag()); |
---|
| 1874 | + } |
---|
| 1875 | + |
---|
| 1876 | + tabbedPane.add(creditsPanel); |
---|
| 1877 | + tabbedPane.setToolTipTextAt(3, "Credits"); |
---|
| 1878 | + |
---|
| 1879 | + if (Globals.ADVANCED) |
---|
| 1880 | + { |
---|
| 1881 | + tabbedPane.add(infoPanel); |
---|
| 1882 | + tabbedPane.setIconAt(4, GetIcon("icons/info.png")); |
---|
| 1883 | + tabbedPane.setToolTipTextAt(4, "Information"); |
---|
| 1884 | + } |
---|
1297 | 1885 | |
---|
1298 | 1886 | /* |
---|
1299 | 1887 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1315 | 1903 | jtp.add(tree); |
---|
1316 | 1904 | */ |
---|
1317 | 1905 | |
---|
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"); |
---|
| 1906 | +// bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
| 1907 | +// bigPanel.setContinuousLayout(true); |
---|
| 1908 | +// bigPanel.setOneTouchExpandable(true); |
---|
| 1909 | +// bigPanel.setDividerLocation(0.8); |
---|
| 1910 | +// bigPanel.setDividerSize(15); |
---|
| 1911 | +// bigPanel.setResizeWeight(0.15); |
---|
| 1912 | +// bigPanel.setName("Scene"); |
---|
1325 | 1913 | |
---|
1326 | 1914 | //bigPanel.setLayout(new BorderLayout()); |
---|
1327 | 1915 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1328 | 1916 | //bigPanel.add(ctrlPanel); |
---|
1329 | 1917 | //bigPanel.add(gridPanel); |
---|
| 1918 | + /** |
---|
1330 | 1919 | bigThree = new JPanel(); |
---|
1331 | 1920 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1332 | 1921 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1350 | 1939 | // aConstraints.gridheight = 3; |
---|
1351 | 1940 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1352 | 1941 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1942 | + /**/ |
---|
1353 | 1943 | |
---|
| 1944 | + bigThree = new cGridBag(); |
---|
| 1945 | + bigThree.addComponent(scenePanel); |
---|
| 1946 | + bigThree.addComponent(centralPanel); |
---|
| 1947 | + //bigThree.addComponent(XYZPanel); |
---|
| 1948 | + |
---|
1354 | 1949 | // // SIDE EFFECT!!! |
---|
1355 | 1950 | // aConstraints.gridx = 0; |
---|
1356 | 1951 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1358 | 1953 | // aConstraints.gridheight = 1; |
---|
1359 | 1954 | |
---|
1360 | 1955 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1361 | | - framePanel.setContinuousLayout(true); |
---|
1362 | | - framePanel.setOneTouchExpandable(true); |
---|
1363 | | - framePanel.setDividerLocation(0.8); |
---|
| 1956 | + |
---|
| 1957 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1958 | + new java.beans.PropertyChangeListener() |
---|
| 1959 | + { |
---|
| 1960 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1961 | + { |
---|
| 1962 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1963 | + { |
---|
| 1964 | + if (radio.layout != expandedLayout) |
---|
| 1965 | + { |
---|
| 1966 | + radio.layout = expandedLayout; |
---|
| 1967 | + radio.layout.doClick(); |
---|
| 1968 | + } |
---|
| 1969 | + } |
---|
| 1970 | + } |
---|
| 1971 | + }); |
---|
| 1972 | + |
---|
| 1973 | + framePanel.setContinuousLayout(false); |
---|
| 1974 | + framePanel.setOneTouchExpandable(false); |
---|
| 1975 | + //.setDividerLocation(0.8); |
---|
1364 | 1976 | //framePanel.setDividerSize(15); |
---|
1365 | 1977 | //framePanel.setResizeWeight(0.15); |
---|
1366 | 1978 | framePanel.setName("Frame"); |
---|
1367 | 1979 | |
---|
1368 | 1980 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1369 | 1981 | /**/ |
---|
1370 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1982 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1371 | 1983 | //worldPane.add(bigPanel); |
---|
1372 | 1984 | //worldPane.add(worldPanel); |
---|
1373 | 1985 | /**/ |
---|
.. | .. |
---|
1377 | 1989 | |
---|
1378 | 1990 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1379 | 1991 | |
---|
1380 | | - frame.setSize(1024, 768); |
---|
1381 | | - frame.show(); |
---|
| 1992 | + frame.setSize(1280, 860); |
---|
| 1993 | + |
---|
| 1994 | + cameraView.requestFocusInWindow(); |
---|
| 1995 | + |
---|
| 1996 | +// gridPanel.setDividerLocation(1.0); |
---|
| 1997 | + |
---|
| 1998 | + frame.validate(); |
---|
1382 | 1999 | |
---|
1383 | | - gridPanel.setDividerLocation(1.0); |
---|
| 2000 | + frame.setVisible(true); |
---|
1384 | 2001 | |
---|
1385 | 2002 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1386 | 2003 | frame.addWindowListener(new WindowAdapter() |
---|
1387 | 2004 | { |
---|
1388 | | - |
---|
1389 | 2005 | public void windowClosing(WindowEvent e) |
---|
1390 | 2006 | { |
---|
1391 | 2007 | Close(); |
---|
.. | .. |
---|
1393 | 2009 | }); |
---|
1394 | 2010 | } |
---|
1395 | 2011 | |
---|
| 2012 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 2013 | + { |
---|
| 2014 | + } |
---|
| 2015 | + |
---|
1396 | 2016 | JTree GetTree() |
---|
1397 | 2017 | { |
---|
1398 | 2018 | return objEditor.jTree; |
---|
.. | .. |
---|
1404 | 2024 | ctrlPanel.removeAll(); |
---|
1405 | 2025 | } |
---|
1406 | 2026 | |
---|
1407 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 2027 | + void SetupMaterial(cGridBag materialpanel) |
---|
1408 | 2028 | { |
---|
1409 | | - aConstraints.weighty = 0; |
---|
1410 | | - //aConstraints.weightx = 1; |
---|
1411 | | - /* |
---|
| 2029 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 2030 | + |
---|
| 2031 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF); |
---|
| 2032 | + skin.setToolTipText("Skin"); |
---|
| 2033 | + skin.addMouseListener(new MouseAdapter() |
---|
| 2034 | + { |
---|
| 2035 | + public void mouseClicked(MouseEvent e) |
---|
| 2036 | + { |
---|
| 2037 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 2038 | + cMaterial material = object.material; |
---|
| 2039 | + |
---|
| 2040 | + // Skin |
---|
| 2041 | + colorField.setFloat(material.color); |
---|
| 2042 | + float saturation = material.modulation; |
---|
| 2043 | + |
---|
| 2044 | + if (!cameraView.Skinshader) |
---|
| 2045 | + { |
---|
| 2046 | + saturation /= 1.5; |
---|
| 2047 | + } |
---|
| 2048 | + |
---|
| 2049 | + saturationField.setFloat(saturation); |
---|
| 2050 | + |
---|
| 2051 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2052 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2053 | + diffusenessField.setFloat(material.factor); |
---|
| 2054 | + shininessField.setFloat(material.shininess); |
---|
| 2055 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2056 | + diffuseField.setFloat(material.diffuse); |
---|
| 2057 | + specularField.setFloat(material.specular); |
---|
| 2058 | + |
---|
| 2059 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2060 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2061 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2062 | + |
---|
| 2063 | + materialtouched = true; |
---|
| 2064 | + applySelf(); |
---|
| 2065 | + } |
---|
| 2066 | + }); |
---|
| 2067 | + presetpanel.add(skin); |
---|
| 2068 | + |
---|
| 2069 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF); |
---|
| 2070 | + lambert.setToolTipText("Diffuse"); |
---|
| 2071 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 2072 | + { |
---|
| 2073 | + public void mouseClicked(MouseEvent e) |
---|
| 2074 | + { |
---|
| 2075 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 2076 | + cMaterial material = object.material; |
---|
| 2077 | + |
---|
| 2078 | + diffusenessField.setFloat(material.factor); |
---|
| 2079 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2080 | + |
---|
| 2081 | + materialtouched = true; |
---|
| 2082 | + applySelf(); |
---|
| 2083 | + } |
---|
| 2084 | + }); |
---|
| 2085 | + presetpanel.add(lambert); |
---|
| 2086 | + |
---|
| 2087 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF); |
---|
| 2088 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 2089 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 2090 | + { |
---|
| 2091 | + public void mouseClicked(MouseEvent e) |
---|
| 2092 | + { |
---|
| 2093 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 2094 | + cMaterial material = object.material; |
---|
| 2095 | + |
---|
| 2096 | + diffusenessField.setFloat(material.factor); |
---|
| 2097 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2098 | + |
---|
| 2099 | + materialtouched = true; |
---|
| 2100 | + applySelf(); |
---|
| 2101 | + } |
---|
| 2102 | + }); |
---|
| 2103 | + presetpanel.add(diffuse2); |
---|
| 2104 | + |
---|
| 2105 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF); |
---|
| 2106 | + diffusemoon.setToolTipText("Moon"); |
---|
| 2107 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 2108 | + { |
---|
| 2109 | + public void mouseClicked(MouseEvent e) |
---|
| 2110 | + { |
---|
| 2111 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 2112 | + cMaterial material = object.material; |
---|
| 2113 | + |
---|
| 2114 | + diffusenessField.setFloat(material.factor); |
---|
| 2115 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2116 | + |
---|
| 2117 | + materialtouched = true; |
---|
| 2118 | + applySelf(); |
---|
| 2119 | + } |
---|
| 2120 | + }); |
---|
| 2121 | + presetpanel.add(diffusemoon); |
---|
| 2122 | + |
---|
| 2123 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF); |
---|
| 2124 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 2125 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 2126 | + { |
---|
| 2127 | + public void mouseClicked(MouseEvent e) |
---|
| 2128 | + { |
---|
| 2129 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 2130 | + cMaterial material = object.material; |
---|
| 2131 | + |
---|
| 2132 | + diffusenessField.setFloat(material.factor); |
---|
| 2133 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2134 | + |
---|
| 2135 | + materialtouched = true; |
---|
| 2136 | + applySelf(); |
---|
| 2137 | + } |
---|
| 2138 | + }); |
---|
| 2139 | + presetpanel.add(diffusemoon2); |
---|
| 2140 | + |
---|
| 2141 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF); |
---|
| 2142 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 2143 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 2144 | + { |
---|
| 2145 | + public void mouseClicked(MouseEvent e) |
---|
| 2146 | + { |
---|
| 2147 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 2148 | + cMaterial material = object.material; |
---|
| 2149 | + |
---|
| 2150 | + diffusenessField.setFloat(material.factor); |
---|
| 2151 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2152 | + |
---|
| 2153 | + materialtouched = true; |
---|
| 2154 | + applySelf(); |
---|
| 2155 | + } |
---|
| 2156 | + }); |
---|
| 2157 | + presetpanel.add(diffusemoon3); |
---|
| 2158 | + |
---|
| 2159 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF); |
---|
| 2160 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 2161 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 2162 | + { |
---|
| 2163 | + public void mouseClicked(MouseEvent e) |
---|
| 2164 | + { |
---|
| 2165 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 2166 | + cMaterial material = object.material; |
---|
| 2167 | + |
---|
| 2168 | + sheenField.setFloat(material.sheen); |
---|
| 2169 | + |
---|
| 2170 | + materialtouched = true; |
---|
| 2171 | + applySelf(); |
---|
| 2172 | + } |
---|
| 2173 | + }); |
---|
| 2174 | + presetpanel.add(diffusesheen); |
---|
| 2175 | + |
---|
| 2176 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF); |
---|
| 2177 | + rough.setToolTipText("Rough metal"); |
---|
| 2178 | + rough.addMouseListener(new MouseAdapter() |
---|
| 2179 | + { |
---|
| 2180 | + public void mouseClicked(MouseEvent e) |
---|
| 2181 | + { |
---|
| 2182 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 2183 | + cMaterial material = object.material; |
---|
| 2184 | + |
---|
| 2185 | + shininessField.setFloat(material.shininess); |
---|
| 2186 | + velvetField.setFloat(material.velvet); |
---|
| 2187 | + |
---|
| 2188 | + materialtouched = true; |
---|
| 2189 | + applySelf(); |
---|
| 2190 | + } |
---|
| 2191 | + }); |
---|
| 2192 | + presetpanel.add(rough); |
---|
| 2193 | + |
---|
| 2194 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF); |
---|
| 2195 | + rough2.setToolTipText("Medium metal"); |
---|
| 2196 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 2197 | + { |
---|
| 2198 | + public void mouseClicked(MouseEvent e) |
---|
| 2199 | + { |
---|
| 2200 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2201 | + cMaterial material = object.material; |
---|
| 2202 | + |
---|
| 2203 | + shininessField.setFloat(material.shininess); |
---|
| 2204 | + lightareaField.setFloat(material.lightarea); |
---|
| 2205 | + |
---|
| 2206 | + materialtouched = true; |
---|
| 2207 | + applySelf(); |
---|
| 2208 | + } |
---|
| 2209 | + }); |
---|
| 2210 | + presetpanel.add(rough2); |
---|
| 2211 | + |
---|
| 2212 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF); |
---|
| 2213 | + shini0.setToolTipText("Shiny"); |
---|
| 2214 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2215 | + { |
---|
| 2216 | + public void mouseClicked(MouseEvent e) |
---|
| 2217 | + { |
---|
| 2218 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2219 | + cMaterial material = object.material; |
---|
| 2220 | + |
---|
| 2221 | + shininessField.setFloat(material.shininess); |
---|
| 2222 | + lightareaField.setFloat(material.lightarea); |
---|
| 2223 | + |
---|
| 2224 | + materialtouched = true; |
---|
| 2225 | + applySelf(); |
---|
| 2226 | + } |
---|
| 2227 | + }); |
---|
| 2228 | + presetpanel.add(shini0); |
---|
| 2229 | + |
---|
| 2230 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF); |
---|
| 2231 | + shini1.setToolTipText("Shiny2"); |
---|
| 2232 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2233 | + { |
---|
| 2234 | + public void mouseClicked(MouseEvent e) |
---|
| 2235 | + { |
---|
| 2236 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2237 | + cMaterial material = object.material; |
---|
| 2238 | + |
---|
| 2239 | + shininessField.setFloat(material.shininess); |
---|
| 2240 | + lightareaField.setFloat(material.lightarea); |
---|
| 2241 | + |
---|
| 2242 | + materialtouched = true; |
---|
| 2243 | + applySelf(); |
---|
| 2244 | + } |
---|
| 2245 | + }); |
---|
| 2246 | + presetpanel.add(shini1); |
---|
| 2247 | + |
---|
| 2248 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF); |
---|
| 2249 | + shini2.setToolTipText("Shiny3"); |
---|
| 2250 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2251 | + { |
---|
| 2252 | + public void mouseClicked(MouseEvent e) |
---|
| 2253 | + { |
---|
| 2254 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2255 | + cMaterial material = object.material; |
---|
| 2256 | + |
---|
| 2257 | + shininessField.setFloat(material.shininess); |
---|
| 2258 | + lightareaField.setFloat(material.lightarea); |
---|
| 2259 | + |
---|
| 2260 | + materialtouched = true; |
---|
| 2261 | + applySelf(); |
---|
| 2262 | + } |
---|
| 2263 | + }); |
---|
| 2264 | + presetpanel.add(shini2); |
---|
| 2265 | + |
---|
| 2266 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF); |
---|
| 2267 | + aniso.setToolTipText("AnisoU"); |
---|
| 2268 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2269 | + { |
---|
| 2270 | + public void mouseClicked(MouseEvent e) |
---|
| 2271 | + { |
---|
| 2272 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2273 | + cMaterial material = object.material; |
---|
| 2274 | + |
---|
| 2275 | + anisoField.setFloat(material.aniso); |
---|
| 2276 | + anisoVField.setFloat(material.anisoV); |
---|
| 2277 | + |
---|
| 2278 | + materialtouched = true; |
---|
| 2279 | + applySelf(); |
---|
| 2280 | + } |
---|
| 2281 | + }); |
---|
| 2282 | + presetpanel.add(aniso); |
---|
| 2283 | + |
---|
| 2284 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF); |
---|
| 2285 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2286 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2287 | + { |
---|
| 2288 | + public void mouseClicked(MouseEvent e) |
---|
| 2289 | + { |
---|
| 2290 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2291 | + cMaterial material = object.material; |
---|
| 2292 | + |
---|
| 2293 | + anisoField.setFloat(material.aniso); |
---|
| 2294 | + anisoVField.setFloat(material.anisoV); |
---|
| 2295 | + |
---|
| 2296 | + materialtouched = true; |
---|
| 2297 | + applySelf(); |
---|
| 2298 | + } |
---|
| 2299 | + }); |
---|
| 2300 | + presetpanel.add(aniso2); |
---|
| 2301 | + |
---|
| 2302 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF); |
---|
| 2303 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2304 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2305 | + { |
---|
| 2306 | + public void mouseClicked(MouseEvent e) |
---|
| 2307 | + { |
---|
| 2308 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2309 | + cMaterial material = object.material; |
---|
| 2310 | + |
---|
| 2311 | + anisoField.setFloat(material.aniso); |
---|
| 2312 | + anisoVField.setFloat(material.anisoV); |
---|
| 2313 | + |
---|
| 2314 | + materialtouched = true; |
---|
| 2315 | + applySelf(); |
---|
| 2316 | + } |
---|
| 2317 | + }); |
---|
| 2318 | + presetpanel.add(aniso3); |
---|
| 2319 | + |
---|
| 2320 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF); |
---|
| 2321 | + velvet0.setToolTipText("Velvet"); |
---|
| 2322 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2323 | + { |
---|
| 2324 | + public void mouseClicked(MouseEvent e) |
---|
| 2325 | + { |
---|
| 2326 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2327 | + cMaterial material = object.material; |
---|
| 2328 | + |
---|
| 2329 | + diffusenessField.setFloat(material.factor); |
---|
| 2330 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2331 | + sheenField.setFloat(material.sheen); |
---|
| 2332 | + shininessField.setFloat(material.shininess); |
---|
| 2333 | + velvetField.setFloat(material.velvet); |
---|
| 2334 | + shiftField.setFloat(material.shift); |
---|
| 2335 | + |
---|
| 2336 | + materialtouched = true; |
---|
| 2337 | + applySelf(); |
---|
| 2338 | + } |
---|
| 2339 | + }); |
---|
| 2340 | + presetpanel.add(velvet0); |
---|
| 2341 | + |
---|
| 2342 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF); |
---|
| 2343 | + bump0.setToolTipText("Bump texture"); |
---|
| 2344 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2345 | + { |
---|
| 2346 | + public void mouseClicked(MouseEvent e) |
---|
| 2347 | + { |
---|
| 2348 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2349 | + cMaterial material = object.material; |
---|
| 2350 | + |
---|
| 2351 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2352 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2353 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2354 | + |
---|
| 2355 | + materialtouched = true; |
---|
| 2356 | + applySelf(); |
---|
| 2357 | + } |
---|
| 2358 | + }); |
---|
| 2359 | + presetpanel.add(bump0); |
---|
| 2360 | + |
---|
| 2361 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF); |
---|
| 2362 | + borderShader.setToolTipText("Border fade"); |
---|
| 2363 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2364 | + { |
---|
| 2365 | + public void mouseClicked(MouseEvent e) |
---|
| 2366 | + { |
---|
| 2367 | + borderfadeField.setFloat(0.5); |
---|
| 2368 | + opacityField.setFloat(0.75); |
---|
| 2369 | + |
---|
| 2370 | + materialtouched = true; |
---|
| 2371 | + applySelf(); |
---|
| 2372 | + } |
---|
| 2373 | + }); |
---|
| 2374 | + presetpanel.add(borderShader); |
---|
| 2375 | + |
---|
| 2376 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF); |
---|
| 2377 | + halo.setToolTipText("Halo"); |
---|
| 2378 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2379 | + { |
---|
| 2380 | + public void mouseClicked(MouseEvent e) |
---|
| 2381 | + { |
---|
| 2382 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2383 | + cMaterial material = object.material; |
---|
| 2384 | + |
---|
| 2385 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2386 | + |
---|
| 2387 | + materialtouched = true; |
---|
| 2388 | + applySelf(); |
---|
| 2389 | + } |
---|
| 2390 | + }); |
---|
| 2391 | + presetpanel.add(halo); |
---|
| 2392 | + |
---|
| 2393 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF); |
---|
| 2394 | + candle.setToolTipText("Candle"); |
---|
| 2395 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2396 | + { |
---|
| 2397 | + public void mouseClicked(MouseEvent e) |
---|
| 2398 | + { |
---|
| 2399 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2400 | + cMaterial material = object.material; |
---|
| 2401 | + |
---|
| 2402 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2403 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2404 | + ambientField.setFloat(material.ambient); |
---|
| 2405 | + specularField.setFloat(material.specular); |
---|
| 2406 | + lightareaField.setFloat(material.lightarea); |
---|
| 2407 | + shininessField.setFloat(material.shininess); |
---|
| 2408 | + |
---|
| 2409 | + materialtouched = true; |
---|
| 2410 | + applySelf(); |
---|
| 2411 | + } |
---|
| 2412 | + }); |
---|
| 2413 | + presetpanel.add(candle); |
---|
| 2414 | + |
---|
| 2415 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF); |
---|
| 2416 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2417 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2418 | + { |
---|
| 2419 | + public void mouseClicked(MouseEvent e) |
---|
| 2420 | + { |
---|
| 2421 | + diffuseField.setFloat(0.001); |
---|
| 2422 | + ambientField.setFloat(0.001); |
---|
| 2423 | + cameraField.setFloat(0.001); |
---|
| 2424 | + specularField.setFloat(0.001); |
---|
| 2425 | + fakedepthField.setFloat(0.001); |
---|
| 2426 | + opacityField.setFloat(0.6); |
---|
| 2427 | + |
---|
| 2428 | + materialtouched = true; |
---|
| 2429 | + applySelf(); |
---|
| 2430 | + } |
---|
| 2431 | + }); |
---|
| 2432 | + presetpanel.add(shadowShader); |
---|
| 2433 | + |
---|
| 2434 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2435 | + |
---|
| 2436 | + presetpanel.preferredWidth = 1; |
---|
| 2437 | + |
---|
| 2438 | + materialpanel.add(presetpanel); |
---|
| 2439 | + materialpanel.add(panel); |
---|
| 2440 | + |
---|
| 2441 | + panel.preferredWidth = 8; |
---|
| 2442 | + |
---|
| 2443 | + /* |
---|
1412 | 2444 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1413 | 2445 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1414 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1415 | | - aConstraints.gridx += 1; |
---|
1416 | | - */ |
---|
| 2446 | + */ |
---|
1417 | 2447 | |
---|
1418 | | - aConstraints.gridwidth = 1; |
---|
1419 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1420 | | - aConstraints.gridx += 1; |
---|
1421 | | - aConstraints.weighty = 0; |
---|
1422 | | - aConstraints.gridwidth = 1; |
---|
| 2448 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 2449 | + |
---|
| 2450 | + editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
| 2451 | + createMaterialButton.setToolTipText("Create material"); |
---|
1423 | 2452 | |
---|
1424 | 2453 | /* |
---|
1425 | 2454 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1426 | | - aConstraints.gridx += 1; |
---|
1427 | | - aConstraints.weighty = 0; |
---|
1428 | | - aConstraints.gridwidth = 1; |
---|
1429 | 2455 | */ |
---|
1430 | 2456 | |
---|
1431 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1432 | | - aConstraints.gridx += 1; |
---|
| 2457 | + editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
| 2458 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 2459 | + |
---|
| 2460 | + if (Globals.ADVANCED) |
---|
| 2461 | + { |
---|
| 2462 | + editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
| 2463 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 2464 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 2465 | + } |
---|
1433 | 2466 | |
---|
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; |
---|
| 2467 | + editBar.preferredHeight = 15; |
---|
| 2468 | + |
---|
| 2469 | + panel.add(editBar); |
---|
| 2470 | + |
---|
1448 | 2471 | /**/ |
---|
1449 | 2472 | //aConstraints.weighty = 0; |
---|
1450 | 2473 | ////aConstraints.weightx = 1; |
---|
1451 | 2474 | //aConstraints.weighty = 1; |
---|
1452 | 2475 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1453 | 2476 | //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; |
---|
| 2477 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1459 | 2478 | |
---|
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; |
---|
| 2479 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
1470 | 2480 | |
---|
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; |
---|
| 2481 | + cGridBag huepanel = new cGridBag(); |
---|
| 2482 | + cGridBag huelabel = new cGridBag(); |
---|
| 2483 | + cLabel hue = GetLabel("icons/hue.png", false); |
---|
| 2484 | + hue.fit = true; |
---|
| 2485 | + |
---|
| 2486 | + hue.addMouseListener(new MouseAdapter() |
---|
| 2487 | + { |
---|
| 2488 | + public void mousePressed(MouseEvent e) |
---|
| 2489 | + { |
---|
| 2490 | + int x = e.getX(); |
---|
| 2491 | + |
---|
| 2492 | + colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth()); |
---|
| 2493 | + } |
---|
| 2494 | + }); |
---|
| 2495 | + |
---|
| 2496 | + huelabel.add(hue); |
---|
| 2497 | + huelabel.preferredWidth = 20; |
---|
| 2498 | + huepanel.add(new cGridBag()); // Label |
---|
| 2499 | + huepanel.add(huelabel); // Field/slider |
---|
| 2500 | + |
---|
| 2501 | + huepanel.preferredHeight = 7; |
---|
1480 | 2502 | |
---|
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; |
---|
| 2503 | + colorSection.add(huepanel); |
---|
| 2504 | + |
---|
| 2505 | + cGridBag color = new cGridBag(); |
---|
| 2506 | + |
---|
| 2507 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2508 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2509 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1490 | 2510 | |
---|
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; |
---|
| 2511 | + //colorField.preferredWidth = 200; |
---|
| 2512 | + colorSection.add(color); |
---|
1500 | 2513 | |
---|
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; |
---|
| 2514 | + cGridBag modulation = new cGridBag(); |
---|
| 2515 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 2516 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2517 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2518 | + colorSection.add(modulation); |
---|
1510 | 2519 | |
---|
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; |
---|
| 2520 | + cGridBag opacity = new cGridBag(); |
---|
| 2521 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2522 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2523 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2524 | + colorSection.add(opacity); |
---|
1520 | 2525 | |
---|
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; |
---|
| 2526 | + colorSection.add(GetSeparator()); |
---|
| 2527 | + |
---|
| 2528 | + cGridBag texture = new cGridBag(); |
---|
| 2529 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 2530 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2531 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2532 | + colorSection.add(texture); |
---|
1529 | 2533 | |
---|
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; |
---|
| 2534 | + panel.add(GetSeparator()); |
---|
| 2535 | + |
---|
| 2536 | + panel.add(colorSection); |
---|
| 2537 | + |
---|
| 2538 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2539 | + |
---|
| 2540 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 2541 | + |
---|
| 2542 | + cGridBag diffuse = new cGridBag(); |
---|
| 2543 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 2544 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2545 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2546 | + diffuseSection.add(diffuse); |
---|
1539 | 2547 | |
---|
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; |
---|
| 2548 | + cGridBag diffuseness = new cGridBag(); |
---|
| 2549 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 2550 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2551 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2552 | + diffuseSection.add(diffuseness); |
---|
1549 | 2553 | |
---|
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; |
---|
| 2554 | + cGridBag selfshadow = new cGridBag(); |
---|
| 2555 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 2556 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2557 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2558 | + diffuseSection.add(selfshadow); |
---|
1559 | 2559 | |
---|
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; |
---|
| 2560 | + cGridBag sheen = new cGridBag(); |
---|
| 2561 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 2562 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2563 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2564 | + diffuseSection.add(sheen); |
---|
1569 | 2565 | |
---|
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; |
---|
| 2566 | + cGridBag subsurface = new cGridBag(); |
---|
| 2567 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 2568 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2569 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2570 | + diffuseSection.add(subsurface); |
---|
1579 | 2571 | |
---|
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; |
---|
| 2572 | + cGridBag shadow = new cGridBag(); |
---|
| 2573 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 2574 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2575 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2576 | + diffuseSection.add(shadow); |
---|
1589 | 2577 | |
---|
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; |
---|
| 2578 | + cGridBag fakedepth = new cGridBag(); |
---|
| 2579 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 2580 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2581 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2582 | + diffuseSection.add(fakedepth); |
---|
1599 | 2583 | |
---|
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; |
---|
| 2584 | + cGridBag shadowbias = new cGridBag(); |
---|
| 2585 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 2586 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2587 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2588 | + diffuseSection.add(shadowbias); |
---|
1608 | 2589 | |
---|
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; |
---|
| 2590 | + panel.add(GetSeparator()); |
---|
| 2591 | + |
---|
| 2592 | + panel.add(diffuseSection); |
---|
| 2593 | + |
---|
| 2594 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2595 | + |
---|
| 2596 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1618 | 2597 | |
---|
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; |
---|
| 2598 | + cGridBag specular = new cGridBag(); |
---|
| 2599 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 2600 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2601 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2602 | + specularSection.add(specular); |
---|
1628 | 2603 | |
---|
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; |
---|
| 2604 | + cGridBag lightarea = new cGridBag(); |
---|
| 2605 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 2606 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2607 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2608 | + specularSection.add(lightarea); |
---|
1638 | 2609 | |
---|
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; |
---|
| 2610 | + cGridBag shininess = new cGridBag(); |
---|
| 2611 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 2612 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2613 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2614 | + specularSection.add(shininess); |
---|
1648 | 2615 | |
---|
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; |
---|
| 2616 | + cGridBag metalness = new cGridBag(); |
---|
| 2617 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 2618 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2619 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2620 | + specularSection.add(metalness); |
---|
1658 | 2621 | |
---|
1659 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1660 | | - Return(); |
---|
| 2622 | + cGridBag velvet = new cGridBag(); |
---|
| 2623 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 2624 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2625 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2626 | + specularSection.add(velvet); |
---|
| 2627 | + |
---|
| 2628 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 2629 | + //Return(); |
---|
1661 | 2630 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1662 | 2631 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1663 | 2632 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1668 | 2637 | // aConstraints.gridy += 1; |
---|
1669 | 2638 | // aConstraints.gridwidth = 1; |
---|
1670 | 2639 | |
---|
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; |
---|
| 2640 | + cGridBag anisoU = new cGridBag(); |
---|
| 2641 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 2642 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2643 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2644 | + specularSection.add(anisoU); |
---|
1679 | 2645 | |
---|
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; |
---|
| 2646 | + cGridBag anisoV = new cGridBag(); |
---|
| 2647 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 2648 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2649 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2650 | + specularSection.add(anisoV); |
---|
1689 | 2651 | |
---|
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 | 2652 | |
---|
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; |
---|
| 2653 | + panel.add(GetSeparator()); |
---|
| 2654 | + |
---|
| 2655 | + panel.add(specularSection); |
---|
| 2656 | + |
---|
| 2657 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2658 | + |
---|
| 2659 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1709 | 2660 | |
---|
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; |
---|
| 2661 | + cGridBag camera = new cGridBag(); |
---|
| 2662 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 2663 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2664 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2665 | + colorSection.add(camera); |
---|
1720 | 2666 | |
---|
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; |
---|
| 2667 | + cGridBag ambient = new cGridBag(); |
---|
| 2668 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 2669 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2670 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2671 | + colorSection.add(ambient); |
---|
1730 | 2672 | |
---|
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; |
---|
| 2673 | + cGridBag backlit = new cGridBag(); |
---|
| 2674 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 2675 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2676 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2677 | + colorSection.add(backlit); |
---|
1740 | 2678 | |
---|
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; |
---|
| 2679 | + //panel.add(new JSeparator()); |
---|
| 2680 | + |
---|
| 2681 | + //panel.add(globalSection); |
---|
| 2682 | + |
---|
| 2683 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2684 | + |
---|
| 2685 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1750 | 2686 | |
---|
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; |
---|
| 2687 | + cGridBag bump = new cGridBag(); |
---|
| 2688 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 2689 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2690 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2691 | + textureSection.add(bump); |
---|
1760 | 2692 | |
---|
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; |
---|
| 2693 | + cGridBag noise = new cGridBag(); |
---|
| 2694 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 2695 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2696 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 2697 | + textureSection.add(noise); |
---|
1770 | 2698 | |
---|
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; |
---|
| 2699 | + cGridBag power = new cGridBag(); |
---|
| 2700 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 2701 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2702 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 2703 | + textureSection.add(power); |
---|
1780 | 2704 | |
---|
1781 | | - //aConstraints.weighty = 1; |
---|
1782 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1783 | | - //aConstraints.gridx += 1; |
---|
1784 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1785 | | - aConstraints.weighty = 0; |
---|
| 2705 | + cGridBag borderfade = new cGridBag(); |
---|
| 2706 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 2707 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2708 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2709 | + textureSection.add(borderfade); |
---|
1786 | 2710 | |
---|
1787 | | - aConstraints.gridx = 0; |
---|
1788 | | - aConstraints.gridy = 0; |
---|
1789 | | - aConstraints.gridwidth = 1; |
---|
| 2711 | + cGridBag fog = new cGridBag(); |
---|
| 2712 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 2713 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2714 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 2715 | + textureSection.add(fog); |
---|
| 2716 | + |
---|
| 2717 | + cGridBag opacityPower = new cGridBag(); |
---|
| 2718 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 2719 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2720 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 2721 | + textureSection.add(opacityPower); |
---|
| 2722 | + |
---|
| 2723 | + panel.add(GetSeparator()); |
---|
| 2724 | + |
---|
| 2725 | + panel.add(textureSection); |
---|
| 2726 | + |
---|
| 2727 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1790 | 2728 | |
---|
1791 | 2729 | SetMaterial(copy); // .GetMaterial()); |
---|
1792 | 2730 | |
---|
1793 | | - colorField.addChangeListener(this); |
---|
1794 | | - modulationField.addChangeListener(this); |
---|
| 2731 | + //colorField.addChangeListener(this); |
---|
| 2732 | +// modulationField.addChangeListener(this); |
---|
1795 | 2733 | metalnessField.addChangeListener(this); |
---|
1796 | 2734 | diffuseField.addChangeListener(this); |
---|
1797 | 2735 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1821 | 2759 | opacityPowerField.addChangeListener(this); |
---|
1822 | 2760 | /**/ |
---|
1823 | 2761 | |
---|
1824 | | - resetSlidersButton.addActionListener(this); |
---|
1825 | 2762 | clearMaterialButton.addActionListener(this); |
---|
1826 | 2763 | createMaterialButton.addActionListener(this); |
---|
1827 | | - |
---|
1828 | | - propagateToggle.addItemListener(this); |
---|
1829 | | - multiplyToggle.addItemListener(this); |
---|
| 2764 | + |
---|
| 2765 | + if (Globals.ADVANCED) |
---|
| 2766 | + { |
---|
| 2767 | + resetSlidersButton.addActionListener(this); |
---|
| 2768 | + propagateToggle.addItemListener(this); |
---|
| 2769 | + multiplyToggle.addItemListener(this); |
---|
| 2770 | + } |
---|
1830 | 2771 | } |
---|
1831 | 2772 | |
---|
1832 | 2773 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1844 | 2785 | // 3D models |
---|
1845 | 2786 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1846 | 2787 | { |
---|
1847 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1848 | | - LoadFile(filename, lastConverter); |
---|
| 2788 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2789 | + //LoadFile(filename, lastConverter); |
---|
| 2790 | + LoadObjFile(filename); // New 3ds loader |
---|
1849 | 2791 | continue; |
---|
1850 | 2792 | } |
---|
1851 | 2793 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
1997 | 2939 | |
---|
1998 | 2940 | //? flashIt = false; |
---|
1999 | 2941 | CameraPane pane = (CameraPane) cameraView; |
---|
2000 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2942 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
2001 | 2943 | pane.clickEnd(location.x, location.y, 0, true); |
---|
2002 | 2944 | |
---|
2003 | 2945 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2046 | 2988 | e2.printStackTrace(); |
---|
2047 | 2989 | } |
---|
2048 | 2990 | } |
---|
| 2991 | + |
---|
2049 | 2992 | LoadJMEThread loadThread; |
---|
2050 | 2993 | |
---|
2051 | 2994 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2103 | 3046 | //LoadFile0(filename, converter); |
---|
2104 | 3047 | } |
---|
2105 | 3048 | } |
---|
| 3049 | + |
---|
2106 | 3050 | LoadOBJThread loadObjThread; |
---|
2107 | 3051 | |
---|
2108 | 3052 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2181 | 3125 | |
---|
2182 | 3126 | void LoadObjFile(String fullname) |
---|
2183 | 3127 | { |
---|
2184 | | - /* |
---|
| 3128 | + System.out.println("Loading " + fullname); |
---|
| 3129 | + /**/ |
---|
2185 | 3130 | //lastFilename = fullname; |
---|
2186 | 3131 | if(loadObjThread == null) |
---|
2187 | 3132 | { |
---|
2188 | | - loadObjThread = new LoadOBJThread(); |
---|
2189 | | - loadObjThread.start(); |
---|
| 3133 | + loadObjThread = new LoadOBJThread(); |
---|
| 3134 | + loadObjThread.start(); |
---|
2190 | 3135 | } |
---|
2191 | 3136 | |
---|
2192 | 3137 | loadObjThread.add(fullname); |
---|
2193 | | - */ |
---|
| 3138 | + /**/ |
---|
2194 | 3139 | |
---|
2195 | | - System.out.println("Loading " + fullname); |
---|
2196 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 3140 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2197 | 3141 | } |
---|
2198 | 3142 | |
---|
2199 | 3143 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2454 | 3398 | |
---|
2455 | 3399 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2456 | 3400 | { |
---|
2457 | | - if (GrafreeD.standAlone) |
---|
| 3401 | + if (Grafreed.standAlone) |
---|
2458 | 3402 | { |
---|
2459 | 3403 | /**/ |
---|
2460 | 3404 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2461 | | - browser.show(); |
---|
| 3405 | + browser.setVisible(true); |
---|
2462 | 3406 | String filename = browser.getFile(); |
---|
2463 | 3407 | if (filename != null && filename.length() > 0) |
---|
2464 | 3408 | { |
---|
.. | .. |
---|
2569 | 3513 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2570 | 3514 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2571 | 3515 | } |
---|
| 3516 | + |
---|
2572 | 3517 | //cJME.count++; |
---|
2573 | 3518 | //cJME.count %= 12; |
---|
2574 | 3519 | if (gc) |
---|
.. | .. |
---|
2603 | 3548 | } |
---|
2604 | 3549 | if (input == null) |
---|
2605 | 3550 | { |
---|
| 3551 | + new Exception().printStackTrace(); |
---|
2606 | 3552 | System.exit(0); |
---|
2607 | 3553 | } |
---|
2608 | 3554 | |
---|
.. | .. |
---|
2751 | 3697 | } |
---|
2752 | 3698 | } |
---|
2753 | 3699 | } |
---|
| 3700 | + |
---|
2754 | 3701 | cFileSystemPane FSPane; |
---|
2755 | 3702 | |
---|
2756 | 3703 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2760 | 3707 | |
---|
2761 | 3708 | freezematerial = true; |
---|
2762 | 3709 | colorField.setFloat(mat.color); |
---|
2763 | | - modulationField.setFloat(mat.modulation); |
---|
| 3710 | + saturationField.setFloat(mat.modulation); |
---|
2764 | 3711 | metalnessField.setFloat(mat.metalness); |
---|
2765 | 3712 | diffuseField.setFloat(mat.diffuse); |
---|
2766 | 3713 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
2804 | 3751 | } |
---|
2805 | 3752 | } |
---|
2806 | 3753 | } |
---|
| 3754 | + |
---|
2807 | 3755 | freezematerial = false; |
---|
2808 | 3756 | } |
---|
2809 | 3757 | |
---|
2810 | 3758 | void SetMaterial(Object3D object) |
---|
2811 | 3759 | { |
---|
| 3760 | + latestObject = object; |
---|
| 3761 | + |
---|
2812 | 3762 | cMaterial mat = object.material; |
---|
2813 | 3763 | |
---|
2814 | 3764 | if (mat == null) |
---|
.. | .. |
---|
2817 | 3767 | return; |
---|
2818 | 3768 | } |
---|
2819 | 3769 | |
---|
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 | | - } |
---|
| 3770 | + if (multiplyToggle != null) |
---|
| 3771 | + multiplyToggle.setSelected(mat.multiply); |
---|
| 3772 | + |
---|
| 3773 | + AllocProjectedVertices(object); |
---|
2847 | 3774 | |
---|
2848 | 3775 | SetMaterial(mat, object.projectedVertices); |
---|
2849 | 3776 | } |
---|
.. | .. |
---|
2919 | 3846 | // } |
---|
2920 | 3847 | |
---|
2921 | 3848 | /**/ |
---|
2922 | | - if (deselect) |
---|
| 3849 | + if (deselect || child == null) |
---|
2923 | 3850 | { |
---|
2924 | 3851 | //group.deselectAll(); |
---|
2925 | 3852 | //freeze = true; |
---|
2926 | 3853 | GetTree().clearSelection(); |
---|
2927 | 3854 | //freeze = false; |
---|
| 3855 | + |
---|
| 3856 | + if (child == null) |
---|
| 3857 | + { |
---|
| 3858 | + return; |
---|
| 3859 | + } |
---|
2928 | 3860 | } |
---|
2929 | 3861 | |
---|
2930 | 3862 | //group.addSelectee(child); |
---|
.. | .. |
---|
2958 | 3890 | public void itemStateChanged(ItemEvent event) |
---|
2959 | 3891 | { |
---|
2960 | 3892 | // System.out.println("Propagate = " + propagate); |
---|
| 3893 | + if (event.getSource() == pinButton) |
---|
| 3894 | + { |
---|
| 3895 | + copy.pinned ^= true; |
---|
| 3896 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3897 | + { |
---|
| 3898 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3899 | + copy.CloseUI(); |
---|
| 3900 | + //copy.editWindow.refreshContents(); |
---|
| 3901 | + } |
---|
| 3902 | + } |
---|
| 3903 | + else |
---|
2961 | 3904 | if (event.getSource() == propagateToggle) |
---|
2962 | 3905 | { |
---|
2963 | 3906 | propagate ^= true; |
---|
.. | .. |
---|
2993 | 3936 | cameraView.ToggleDL(); |
---|
2994 | 3937 | cameraView.repaint(); |
---|
2995 | 3938 | return; |
---|
2996 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3939 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2997 | 3940 | { |
---|
2998 | 3941 | cameraView.ToggleTexture(); |
---|
2999 | 3942 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
3032 | 3975 | frame.validate(); |
---|
3033 | 3976 | |
---|
3034 | 3977 | return; |
---|
3035 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3978 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
3036 | 3979 | { |
---|
3037 | | - cameraView.ToggleRandom(); |
---|
| 3980 | + cameraView.ToggleSwitch(); |
---|
3038 | 3981 | cameraView.repaint(); |
---|
3039 | 3982 | return; |
---|
3040 | 3983 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3062 | 4005 | } else if (event.getSource() == liveCB) |
---|
3063 | 4006 | { |
---|
3064 | 4007 | copy.live ^= true; |
---|
| 4008 | + objEditor.refreshContents(true); // To show item colors |
---|
| 4009 | + return; |
---|
| 4010 | + } else if (event.getSource() == selectableCB) |
---|
| 4011 | + { |
---|
| 4012 | + copy.dontselect ^= true; |
---|
3065 | 4013 | return; |
---|
3066 | 4014 | } else if (event.getSource() == hideCB) |
---|
3067 | 4015 | { |
---|
3068 | 4016 | copy.hide ^= true; |
---|
3069 | 4017 | copy.Touch(); // display list issue |
---|
3070 | | - objEditor.refreshContents(); |
---|
| 4018 | + objEditor.refreshContents(true); // To show item colors |
---|
3071 | 4019 | return; |
---|
3072 | 4020 | } else if (event.getSource() == link2masterCB) |
---|
3073 | 4021 | { |
---|
.. | .. |
---|
3077 | 4025 | if (event.getSource() == randomCB) |
---|
3078 | 4026 | { |
---|
3079 | 4027 | copy.random ^= true; |
---|
| 4028 | + objEditor.refreshContents(); |
---|
3080 | 4029 | return; |
---|
3081 | 4030 | } |
---|
3082 | 4031 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3100 | 4049 | |
---|
3101 | 4050 | public void actionPerformed(ActionEvent event) |
---|
3102 | 4051 | { |
---|
| 4052 | + Object source = event.getSource(); |
---|
3103 | 4053 | // SCRIPT DIALOG |
---|
3104 | | - if (event.getSource() == okbutton) |
---|
| 4054 | + if (source == okbutton) |
---|
3105 | 4055 | { |
---|
3106 | 4056 | textpanel.setVisible(false); |
---|
3107 | 4057 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3113 | 4063 | textarea = null; |
---|
3114 | 4064 | textpanel = null; |
---|
3115 | 4065 | } |
---|
3116 | | - if (event.getSource() == cancelbutton) |
---|
| 4066 | + if (source == cancelbutton) |
---|
3117 | 4067 | { |
---|
3118 | 4068 | textpanel.setVisible(false); |
---|
3119 | 4069 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3125 | 4075 | //applySelf(); |
---|
3126 | 4076 | //client.refreshEditWindow(); |
---|
3127 | 4077 | //refreshContents(); |
---|
3128 | | - if (event.getSource() == nameField) |
---|
| 4078 | + if (source == nameField) |
---|
3129 | 4079 | { |
---|
3130 | 4080 | //System.out.println("ObjEditor " + event); |
---|
3131 | 4081 | applySelf0(true); |
---|
3132 | 4082 | //parent.applySelf(); |
---|
3133 | | - objEditor.refreshContents(); |
---|
3134 | | - } else if (event.getSource() == resetButton) |
---|
| 4083 | + // conflicts with requestFocus objEditor.refreshContents(); |
---|
| 4084 | + } else if (source == resetButton) |
---|
3135 | 4085 | { |
---|
3136 | 4086 | CameraPane.fullreset = true; |
---|
3137 | 4087 | copy.Reset(); // ResetMeshes(); |
---|
3138 | 4088 | copy.Touch(); |
---|
3139 | 4089 | objEditor.refreshContents(); |
---|
3140 | | - } else if (event.getSource() == stepItem) |
---|
| 4090 | + } else if (source == stepItem) |
---|
3141 | 4091 | { |
---|
3142 | 4092 | //cameraView.ONESTEP = true; |
---|
3143 | 4093 | Globals.ONESTEP = true; |
---|
3144 | 4094 | cameraView.repaint(); |
---|
3145 | 4095 | return; |
---|
3146 | | - } else if (event.getSource() == stepButton) |
---|
| 4096 | + } else if (source == stepButton) |
---|
3147 | 4097 | { |
---|
3148 | 4098 | copy.Step(); |
---|
3149 | 4099 | copy.Touch(); |
---|
3150 | 4100 | objEditor.refreshContents(); |
---|
3151 | | - } else if (event.getSource() == slowerButton) |
---|
| 4101 | + } else if (source == slowerButton) |
---|
3152 | 4102 | { |
---|
3153 | 4103 | copy.Slower(); |
---|
3154 | 4104 | copy.Touch(); |
---|
3155 | 4105 | objEditor.refreshContents(); |
---|
3156 | | - } else if (event.getSource() == fasterButton) |
---|
| 4106 | + } else if (source == fasterButton) |
---|
3157 | 4107 | { |
---|
3158 | 4108 | copy.Faster(); |
---|
3159 | 4109 | copy.Touch(); |
---|
3160 | 4110 | objEditor.refreshContents(); |
---|
3161 | | - } else if (event.getSource() == remarkButton) |
---|
| 4111 | + } else if (source == remarkButton) |
---|
3162 | 4112 | { |
---|
3163 | 4113 | copy.Remark(); |
---|
3164 | 4114 | copy.Touch(); |
---|
3165 | 4115 | objEditor.refreshContents(); |
---|
3166 | | - } else if (event.getSource() == stepAllButton) |
---|
| 4116 | + } else if (source == stepAllButton) |
---|
3167 | 4117 | { |
---|
3168 | 4118 | copy.StepAll(); |
---|
3169 | 4119 | copy.Touch(); |
---|
3170 | 4120 | objEditor.refreshContents(); |
---|
3171 | | - } else if (event.getSource() == resetAllButton) |
---|
| 4121 | + } else if (source == resetAllButton) |
---|
3172 | 4122 | { |
---|
3173 | 4123 | //CameraPane.fullreset = true; |
---|
3174 | 4124 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3201 | 4151 | // Close(); |
---|
3202 | 4152 | // } |
---|
3203 | 4153 | // else |
---|
3204 | | - if (event.getSource() == resetSlidersButton) |
---|
| 4154 | + if (source == resetSlidersButton) |
---|
3205 | 4155 | { |
---|
3206 | 4156 | ResetSliders(); |
---|
3207 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 4157 | + } else if (source == clearMaterialButton) |
---|
3208 | 4158 | { |
---|
3209 | 4159 | ClearMaterial(); |
---|
3210 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 4160 | + } else if (source == createMaterialButton) |
---|
3211 | 4161 | { |
---|
3212 | 4162 | CreateMaterial(); |
---|
3213 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 4163 | + } else if (source == clearPanelButton) |
---|
3214 | 4164 | { |
---|
3215 | 4165 | copy.ClearUI(); |
---|
3216 | 4166 | refreshContents(true); |
---|
3217 | | - } /* |
---|
3218 | | - } |
---|
3219 | | - |
---|
3220 | | - public boolean action(Event event, Object arg) |
---|
3221 | | - { |
---|
3222 | | - */ else if (event.getSource() == closeItem) |
---|
| 4167 | + } else if (source == importGFDItem) |
---|
| 4168 | + { |
---|
| 4169 | + ImportGFD(); |
---|
| 4170 | + } else |
---|
| 4171 | + if (source == importVRMLX3DItem) |
---|
| 4172 | + { |
---|
| 4173 | + ImportVRMLX3D(); |
---|
| 4174 | + } else |
---|
| 4175 | + if (source == import3DSItem) |
---|
| 4176 | + { |
---|
| 4177 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 4178 | + } else |
---|
| 4179 | + if (source == importOBJItem) |
---|
| 4180 | + { |
---|
| 4181 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 4182 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 4183 | + browser.setVisible(true); |
---|
| 4184 | + String filename = browser.getFile(); |
---|
| 4185 | + if (filename != null && filename.length() > 0) |
---|
| 4186 | + { |
---|
| 4187 | + String fullname = browser.getDirectory() + filename; |
---|
| 4188 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 4189 | + } |
---|
| 4190 | + } else |
---|
| 4191 | + if (source == closeItem) |
---|
3223 | 4192 | { |
---|
3224 | 4193 | Close(); |
---|
3225 | 4194 | //return true; |
---|
3226 | | - } else if (event.getSource() == loadItem) |
---|
| 4195 | + } else if (source == openItem) |
---|
3227 | 4196 | { |
---|
3228 | | - load(); |
---|
| 4197 | + Open(); |
---|
3229 | 4198 | //return true; |
---|
3230 | | - } else if (event.getSource() == saveItem) |
---|
| 4199 | + } else if (source == newItem) |
---|
| 4200 | + { |
---|
| 4201 | + New(); |
---|
| 4202 | + } else if (source == saveItem) |
---|
3231 | 4203 | { |
---|
3232 | 4204 | save(); |
---|
3233 | 4205 | //return true; |
---|
3234 | | - } else if (event.getSource() == saveAsItem) |
---|
| 4206 | + } else if (source == saveAsItem) |
---|
3235 | 4207 | { |
---|
3236 | 4208 | saveAs(); |
---|
3237 | 4209 | //return true; |
---|
3238 | | - } else if (event.getSource() == reexportItem) |
---|
| 4210 | + } else if (source == reexportItem) |
---|
3239 | 4211 | { |
---|
3240 | 4212 | reexport(); |
---|
3241 | 4213 | //return true; |
---|
3242 | | - } else if (event.getSource() == exportAsItem) |
---|
| 4214 | + } else if (source == exportAsItem) |
---|
3243 | 4215 | { |
---|
3244 | 4216 | export(); |
---|
3245 | 4217 | //return true; |
---|
3246 | | - } else if (event.getSource() == povItem) |
---|
| 4218 | + } else if (source == povItem) |
---|
3247 | 4219 | { |
---|
3248 | 4220 | generatePOV(); |
---|
3249 | 4221 | //return true; |
---|
3250 | | - } else if (event.getSource() == zBufferItem) |
---|
| 4222 | + } else if (event.getSource() == archiveItem) |
---|
| 4223 | + { |
---|
| 4224 | + cTools.Archive(frame); |
---|
| 4225 | + return; |
---|
| 4226 | + } else if (source == zBufferItem) |
---|
3251 | 4227 | { |
---|
3252 | 4228 | try |
---|
3253 | 4229 | { |
---|
.. | .. |
---|
3269 | 4245 | cameraView.repaint(); |
---|
3270 | 4246 | //return true; |
---|
3271 | 4247 | } |
---|
3272 | | - */ else if (event.getSource() == editCameraItem) |
---|
3273 | | - { |
---|
3274 | | - cameraView.ProtectCamera(); |
---|
3275 | | - cameraView.repaint(); |
---|
3276 | | - return; |
---|
3277 | | - } else if (event.getSource() == revertCameraItem) |
---|
3278 | | - { |
---|
3279 | | - cameraView.RevertCamera(); |
---|
3280 | | - cameraView.repaint(); |
---|
3281 | | - return; |
---|
3282 | | -// } else if (event.getSource() == textureButton) |
---|
3283 | | -// { |
---|
3284 | | -// return; // true; |
---|
3285 | | - } else // combos... |
---|
3286 | | - if (event.getSource() == texresMenu) |
---|
| 4248 | + */ else // combos... |
---|
| 4249 | + if (source == texresMenu) |
---|
3287 | 4250 | { |
---|
3288 | 4251 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3289 | 4252 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3295 | 4258 | } |
---|
3296 | 4259 | } |
---|
3297 | 4260 | |
---|
| 4261 | + void New() |
---|
| 4262 | + { |
---|
| 4263 | + while (copy.Size() > 0) |
---|
| 4264 | + { |
---|
| 4265 | + copy.remove(0); |
---|
| 4266 | + } |
---|
| 4267 | + |
---|
| 4268 | + copy.selection.clear(); |
---|
| 4269 | + |
---|
| 4270 | + if (copy == Grafreed.grafreed.universe) |
---|
| 4271 | + { |
---|
| 4272 | + CreateCameras(); |
---|
| 4273 | + cameraView.SetCamera(GetCamera(copy, 0)); |
---|
| 4274 | + } |
---|
| 4275 | + ResetModel(); |
---|
| 4276 | + objEditor.refreshContents(); |
---|
| 4277 | + } |
---|
| 4278 | + |
---|
| 4279 | + static public byte[] Compress(Object3D o) |
---|
| 4280 | + { |
---|
| 4281 | + // Slower to actually compress. |
---|
| 4282 | + try |
---|
| 4283 | + { |
---|
| 4284 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4285 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 4286 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
| 4287 | + |
---|
| 4288 | + Object3D parent = o.parent; |
---|
| 4289 | + o.parent = null; |
---|
| 4290 | + |
---|
| 4291 | + out.writeObject(o); |
---|
| 4292 | + |
---|
| 4293 | + o.parent = parent; |
---|
| 4294 | + |
---|
| 4295 | + out.flush(); |
---|
| 4296 | + |
---|
| 4297 | + baos //zstream |
---|
| 4298 | + .close(); |
---|
| 4299 | + out.close(); |
---|
| 4300 | + |
---|
| 4301 | + byte[] bytes = baos.toByteArray(); |
---|
| 4302 | + |
---|
| 4303 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 4304 | + return bytes; |
---|
| 4305 | + } catch (Exception e) |
---|
| 4306 | + { |
---|
| 4307 | + System.err.println(e); |
---|
| 4308 | + return null; |
---|
| 4309 | + } |
---|
| 4310 | + } |
---|
| 4311 | + |
---|
| 4312 | + static public Object Uncompress(byte[] bytes) |
---|
| 4313 | + { |
---|
| 4314 | + System.out.println("restore #bytes = " + bytes.length); |
---|
| 4315 | + try |
---|
| 4316 | + { |
---|
| 4317 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4318 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 4319 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
| 4320 | + Object obj = in.readObject(); |
---|
| 4321 | + |
---|
| 4322 | + bais //istream |
---|
| 4323 | + .close(); |
---|
| 4324 | + in.close(); |
---|
| 4325 | + |
---|
| 4326 | + return obj; |
---|
| 4327 | + } catch (Exception e) |
---|
| 4328 | + { |
---|
| 4329 | + System.err.println(e); |
---|
| 4330 | + return null; |
---|
| 4331 | + } |
---|
| 4332 | + } |
---|
| 4333 | + |
---|
| 4334 | + static public Object clone(Object o) |
---|
| 4335 | + { |
---|
| 4336 | + try |
---|
| 4337 | + { |
---|
| 4338 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4339 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 4340 | + |
---|
| 4341 | + out.writeObject(o); |
---|
| 4342 | + |
---|
| 4343 | + out.flush(); |
---|
| 4344 | + out.close(); |
---|
| 4345 | + |
---|
| 4346 | + byte[] bytes = baos.toByteArray(); |
---|
| 4347 | + |
---|
| 4348 | + System.out.println("clone = " + bytes.length); |
---|
| 4349 | + |
---|
| 4350 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4351 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 4352 | + Object obj = in.readObject(); |
---|
| 4353 | + in.close(); |
---|
| 4354 | + |
---|
| 4355 | + return obj; |
---|
| 4356 | + } catch (Exception e) |
---|
| 4357 | + { |
---|
| 4358 | + System.err.println(e); |
---|
| 4359 | + return null; |
---|
| 4360 | + } |
---|
| 4361 | + } |
---|
| 4362 | + |
---|
| 4363 | + cRadio GetCurrentTab() |
---|
| 4364 | + { |
---|
| 4365 | + cRadio ab; |
---|
| 4366 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4367 | + { |
---|
| 4368 | + ab = (cRadio)e.nextElement(); |
---|
| 4369 | + if(ab.GetObject() == copy) |
---|
| 4370 | + { |
---|
| 4371 | + return ab; |
---|
| 4372 | + } |
---|
| 4373 | + } |
---|
| 4374 | + |
---|
| 4375 | + return null; |
---|
| 4376 | + } |
---|
| 4377 | + |
---|
| 4378 | + |
---|
| 4379 | + public void Save() |
---|
| 4380 | + { |
---|
| 4381 | + //Save(true); |
---|
| 4382 | + Replace(); |
---|
| 4383 | + SetVersionStates(); |
---|
| 4384 | + } |
---|
| 4385 | + |
---|
| 4386 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 4387 | + { |
---|
| 4388 | + if (compress.length != name.length) |
---|
| 4389 | + { |
---|
| 4390 | + return false; |
---|
| 4391 | + } |
---|
| 4392 | + |
---|
| 4393 | + for (int i=compress.length; --i>=0;) |
---|
| 4394 | + { |
---|
| 4395 | + if (compress[i] != name[i]) |
---|
| 4396 | + return false; |
---|
| 4397 | + } |
---|
| 4398 | + |
---|
| 4399 | + return true; |
---|
| 4400 | + } |
---|
| 4401 | + |
---|
| 4402 | + void DeleteVersion() |
---|
| 4403 | + { |
---|
| 4404 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4405 | + { |
---|
| 4406 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4407 | + } |
---|
| 4408 | + |
---|
| 4409 | + if (copy.versionlist[copy.versionindex] == null) |
---|
| 4410 | + copy.versionindex -= 1; |
---|
| 4411 | + |
---|
| 4412 | + if (copy.versionindex != -1) |
---|
| 4413 | + CopyChanged(); |
---|
| 4414 | + |
---|
| 4415 | + SetVersionStates(); |
---|
| 4416 | + } |
---|
| 4417 | + |
---|
| 4418 | + public boolean Save(boolean user) |
---|
| 4419 | + { |
---|
| 4420 | + System.err.println("Save"); |
---|
| 4421 | + Replace(); |
---|
| 4422 | + |
---|
| 4423 | + //cRadio tab = GetCurrentTab(); |
---|
| 4424 | + |
---|
| 4425 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
| 4426 | + |
---|
| 4427 | + boolean thesame = false; |
---|
| 4428 | + |
---|
| 4429 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4430 | +// { |
---|
| 4431 | +// thesame = true; |
---|
| 4432 | +// } |
---|
| 4433 | + |
---|
| 4434 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 4435 | + if (!thesame) |
---|
| 4436 | + { |
---|
| 4437 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4438 | + { |
---|
| 4439 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4440 | + } |
---|
| 4441 | + |
---|
| 4442 | + //tab.user[tab.versionindex] = user; |
---|
| 4443 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 4444 | + |
---|
| 4445 | + copy.versionlist[++copy.versionindex] = compress; |
---|
| 4446 | + |
---|
| 4447 | + // if (increment) |
---|
| 4448 | + // tab.versionindex++; |
---|
| 4449 | + } |
---|
| 4450 | + |
---|
| 4451 | + //copy.RestoreBigData(versiontable); |
---|
| 4452 | + |
---|
| 4453 | + //assert(hashtable.isEmpty()); |
---|
| 4454 | + |
---|
| 4455 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4456 | +// { |
---|
| 4457 | +// //tab.user[i] = false; |
---|
| 4458 | +// copy.versionlist[i] = null; |
---|
| 4459 | +// } |
---|
| 4460 | + |
---|
| 4461 | + SetVersionStates(); |
---|
| 4462 | + |
---|
| 4463 | + // test save |
---|
| 4464 | + if (false) |
---|
| 4465 | + { |
---|
| 4466 | + try |
---|
| 4467 | + { |
---|
| 4468 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
| 4469 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4470 | + |
---|
| 4471 | + p.writeObject(copy); |
---|
| 4472 | + |
---|
| 4473 | + p.flush(); |
---|
| 4474 | + |
---|
| 4475 | + ostream.close(); |
---|
| 4476 | + } catch (Exception e) |
---|
| 4477 | + { |
---|
| 4478 | + e.printStackTrace(); |
---|
| 4479 | + } |
---|
| 4480 | + } |
---|
| 4481 | + |
---|
| 4482 | + return !thesame; |
---|
| 4483 | + } |
---|
| 4484 | + |
---|
| 4485 | + boolean flashIt = true; |
---|
| 4486 | + |
---|
| 4487 | + void RefreshSelection() |
---|
| 4488 | + { |
---|
| 4489 | + Object3D selection = new Object3D(); |
---|
| 4490 | + |
---|
| 4491 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4492 | + { |
---|
| 4493 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4494 | + |
---|
| 4495 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4496 | + |
---|
| 4497 | + if (obj == null) |
---|
| 4498 | + { |
---|
| 4499 | + copy.selection.remove(i--); |
---|
| 4500 | + } |
---|
| 4501 | + else |
---|
| 4502 | + { |
---|
| 4503 | + selection.add(obj); |
---|
| 4504 | + copy.selection.setElementAt(obj, i); |
---|
| 4505 | + } |
---|
| 4506 | + } |
---|
| 4507 | + |
---|
| 4508 | + flashIt = false; |
---|
| 4509 | + GetTree().clearSelection(); |
---|
| 4510 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4511 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4512 | + flashIt = true; |
---|
| 4513 | + |
---|
| 4514 | + //refreshContents(false); |
---|
| 4515 | + } |
---|
| 4516 | + |
---|
| 4517 | + void CopyChanged() |
---|
| 4518 | + { |
---|
| 4519 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4520 | + |
---|
| 4521 | + SetVersionStates(); |
---|
| 4522 | + |
---|
| 4523 | + boolean temp = CameraPane.SWITCH; |
---|
| 4524 | + CameraPane.SWITCH = false; |
---|
| 4525 | + |
---|
| 4526 | + copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4527 | + |
---|
| 4528 | + copy.clear(); |
---|
| 4529 | + |
---|
| 4530 | + copy.skyboxname = obj.skyboxname; |
---|
| 4531 | + copy.skyboxext = obj.skyboxext; |
---|
| 4532 | + |
---|
| 4533 | + for (int i=0; i<obj.Size(); i++) |
---|
| 4534 | + { |
---|
| 4535 | + copy.add(obj.get(i)); |
---|
| 4536 | + } |
---|
| 4537 | + |
---|
| 4538 | + copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4539 | + |
---|
| 4540 | + CameraPane.SWITCH = temp; |
---|
| 4541 | + |
---|
| 4542 | + RefreshSelection(); |
---|
| 4543 | + //assert(hashtable.isEmpty()); |
---|
| 4544 | + |
---|
| 4545 | + copy.Touch(); |
---|
| 4546 | + |
---|
| 4547 | + ResetModel(); |
---|
| 4548 | + copy.HardTouch(); // recompile? |
---|
| 4549 | + |
---|
| 4550 | + cRadio ab; |
---|
| 4551 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4552 | + { |
---|
| 4553 | + ab = (cRadio)e.nextElement(); |
---|
| 4554 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 4555 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 4556 | + if (test != null) |
---|
| 4557 | + { |
---|
| 4558 | + test.editWindow = ab.object.editWindow; |
---|
| 4559 | + ab.object = test; |
---|
| 4560 | + } |
---|
| 4561 | + } |
---|
| 4562 | + |
---|
| 4563 | + refreshContents(true); |
---|
| 4564 | + } |
---|
| 4565 | + |
---|
| 4566 | + cButton previousVersionButton; |
---|
| 4567 | + cButton restoreButton; |
---|
| 4568 | + cButton replaceButton; |
---|
| 4569 | + cButton nextVersionButton; |
---|
| 4570 | + cButton saveVersionButton; |
---|
| 4571 | + cButton deleteVersionButton; |
---|
| 4572 | + |
---|
| 4573 | + boolean muteSlider; |
---|
| 4574 | + |
---|
| 4575 | + int VersionCount() |
---|
| 4576 | + { |
---|
| 4577 | + int count = 0; |
---|
| 4578 | + |
---|
| 4579 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 4580 | + { |
---|
| 4581 | + if (copy.versionlist[i] != null) |
---|
| 4582 | + count++; |
---|
| 4583 | + } |
---|
| 4584 | + |
---|
| 4585 | + return count; |
---|
| 4586 | + } |
---|
| 4587 | + |
---|
| 4588 | + public cGridBag versionSliderPane; |
---|
| 4589 | + |
---|
| 4590 | + void SetVersionStates() |
---|
| 4591 | + { |
---|
| 4592 | + //if (true) |
---|
| 4593 | + // return; |
---|
| 4594 | + |
---|
| 4595 | + //cRadio tab = GetCurrentTab(); |
---|
| 4596 | + |
---|
| 4597 | + if (copy.versionlist == null) |
---|
| 4598 | + { |
---|
| 4599 | + saveVersionButton.setEnabled(false); |
---|
| 4600 | + restoreButton.setEnabled(false); |
---|
| 4601 | + replaceButton.setEnabled(false); |
---|
| 4602 | + previousVersionButton.setEnabled(false); |
---|
| 4603 | + nextVersionButton.setEnabled(false); |
---|
| 4604 | + deleteVersionButton.setEnabled(false); |
---|
| 4605 | + versionSliderPane.setVisible(false); |
---|
| 4606 | + } |
---|
| 4607 | + else |
---|
| 4608 | + { |
---|
| 4609 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4610 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4611 | + |
---|
| 4612 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4613 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4614 | + |
---|
| 4615 | + deleteVersionButton.setEnabled(copy.versionindex != -1); |
---|
| 4616 | + //copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4617 | + |
---|
| 4618 | + muteSlider = true; |
---|
| 4619 | + versionSlider.setMinimum(0); |
---|
| 4620 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4621 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4622 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
| 4623 | + muteSlider = false; |
---|
| 4624 | + |
---|
| 4625 | + versionSliderPane.setVisible(true); |
---|
| 4626 | + } |
---|
| 4627 | + } |
---|
| 4628 | + |
---|
| 4629 | + public boolean PreviousVersion() |
---|
| 4630 | + { |
---|
| 4631 | + // Option? |
---|
| 4632 | + Replace(); |
---|
| 4633 | + |
---|
| 4634 | + System.err.println("Undo"); |
---|
| 4635 | + |
---|
| 4636 | + //cRadio tab = GetCurrentTab(); |
---|
| 4637 | + |
---|
| 4638 | + if (copy.versionindex == 0) |
---|
| 4639 | + { |
---|
| 4640 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4641 | + return false; |
---|
| 4642 | + } |
---|
| 4643 | + |
---|
| 4644 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 4645 | +// { |
---|
| 4646 | +// if (Save(false)) |
---|
| 4647 | +// tab.versionindex -= 1; |
---|
| 4648 | +// else |
---|
| 4649 | +// { |
---|
| 4650 | +// if (tab.versionindex <= 0) |
---|
| 4651 | +// return false; |
---|
| 4652 | +// else |
---|
| 4653 | +// tab.versionindex -= 1; |
---|
| 4654 | +// } |
---|
| 4655 | +// } |
---|
| 4656 | + |
---|
| 4657 | + copy.versionindex -= 1; |
---|
| 4658 | + |
---|
| 4659 | + CopyChanged(); |
---|
| 4660 | + |
---|
| 4661 | + return true; |
---|
| 4662 | + } |
---|
| 4663 | + |
---|
| 4664 | + public boolean Restore() |
---|
| 4665 | + { |
---|
| 4666 | + System.err.println("Restore"); |
---|
| 4667 | + |
---|
| 4668 | + //cRadio tab = GetCurrentTab(); |
---|
| 4669 | + |
---|
| 4670 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4671 | + { |
---|
| 4672 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4673 | + return false; |
---|
| 4674 | + } |
---|
| 4675 | + |
---|
| 4676 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4677 | + CopyChanged(); |
---|
| 4678 | + |
---|
| 4679 | + return true; |
---|
| 4680 | + } |
---|
| 4681 | + |
---|
| 4682 | + public boolean Replace() |
---|
| 4683 | + { |
---|
| 4684 | + //System.err.println("Replace"); |
---|
| 4685 | + |
---|
| 4686 | + //cRadio tab = GetCurrentTab(); |
---|
| 4687 | + |
---|
| 4688 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4689 | + { |
---|
| 4690 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4691 | + return false; |
---|
| 4692 | + } |
---|
| 4693 | + |
---|
| 4694 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
| 4695 | + |
---|
| 4696 | + return true; |
---|
| 4697 | + } |
---|
| 4698 | + |
---|
| 4699 | + public void NextVersion() |
---|
| 4700 | + { |
---|
| 4701 | + // Option? |
---|
| 4702 | + Replace(); |
---|
| 4703 | + |
---|
| 4704 | + //cRadio tab = GetCurrentTab(); |
---|
| 4705 | + |
---|
| 4706 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
| 4707 | + { |
---|
| 4708 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4709 | + return; |
---|
| 4710 | + } |
---|
| 4711 | + |
---|
| 4712 | + copy.versionindex += 1; |
---|
| 4713 | + |
---|
| 4714 | + CopyChanged(); |
---|
| 4715 | + |
---|
| 4716 | + //if (!tab.user[tab.versionindex]) |
---|
| 4717 | + // tab.graphs[tab.versionindex] = null; |
---|
| 4718 | + } |
---|
| 4719 | + |
---|
| 4720 | + void ImportGFD() |
---|
| 4721 | + { |
---|
| 4722 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
| 4723 | + browser.show(); |
---|
| 4724 | + String filename = browser.getFile(); |
---|
| 4725 | + if (filename != null && filename.length() > 0) |
---|
| 4726 | + { |
---|
| 4727 | + String fullname = browser.getDirectory() + filename; |
---|
| 4728 | + |
---|
| 4729 | + //Object3D readobj = |
---|
| 4730 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 4731 | + //makeSomething(readobj); |
---|
| 4732 | + } |
---|
| 4733 | + } |
---|
| 4734 | + |
---|
| 4735 | + void ImportVRMLX3D() |
---|
| 4736 | + { |
---|
| 4737 | + if (Grafreed.standAlone) |
---|
| 4738 | + { |
---|
| 4739 | + /**/ |
---|
| 4740 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 4741 | + browser.show(); |
---|
| 4742 | + String filename = browser.getFile(); |
---|
| 4743 | + if (filename != null && filename.length() > 0) |
---|
| 4744 | + { |
---|
| 4745 | + String fullname = browser.getDirectory() + filename; |
---|
| 4746 | + LoadVRMLX3D(fullname); |
---|
| 4747 | + } |
---|
| 4748 | + /**/ |
---|
| 4749 | + } |
---|
| 4750 | + } |
---|
| 4751 | + |
---|
3298 | 4752 | void ToggleAnimation() |
---|
3299 | 4753 | { |
---|
3300 | 4754 | if (!Globals.ANIMATION) |
---|
3301 | 4755 | { |
---|
3302 | 4756 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3303 | | - browser.show(); |
---|
| 4757 | + browser.setVisible(true); |
---|
3304 | 4758 | String filename = browser.getFile(); |
---|
3305 | 4759 | if (filename != null && filename.length() > 0) |
---|
3306 | 4760 | { |
---|
.. | .. |
---|
3310 | 4764 | |
---|
3311 | 4765 | Globals.ANIMATION ^= true; |
---|
3312 | 4766 | |
---|
3313 | | - GrafreeD.wav.cursor = 0; |
---|
3314 | | - GrafreeD.wav.loop = 0; |
---|
| 4767 | + Grafreed.wav.cursor = 0; |
---|
| 4768 | + Grafreed.wav.loop = 0; |
---|
3315 | 4769 | } |
---|
3316 | 4770 | } else |
---|
3317 | 4771 | { |
---|
.. | .. |
---|
3361 | 4815 | void CreateMaterial() |
---|
3362 | 4816 | { |
---|
3363 | 4817 | //copy.ClearMaterial(); // PATCH |
---|
3364 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 4818 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3365 | 4819 | if (copy.selection.size() > 0) |
---|
3366 | 4820 | //SetMaterial(copy); |
---|
3367 | 4821 | { |
---|
.. | .. |
---|
3412 | 4866 | assert false; |
---|
3413 | 4867 | } |
---|
3414 | 4868 | |
---|
3415 | | - void EditSelection() |
---|
| 4869 | + void EditSelection(boolean newWindow) |
---|
3416 | 4870 | { |
---|
3417 | 4871 | } |
---|
3418 | 4872 | |
---|
.. | .. |
---|
3420 | 4874 | { |
---|
3421 | 4875 | copy.ResetBlockLoop(); // temporary problem |
---|
3422 | 4876 | |
---|
3423 | | - boolean random = CameraPane.RANDOM; |
---|
3424 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 4877 | + boolean random = CameraPane.SWITCH; |
---|
| 4878 | + CameraPane.SWITCH = false; // parse everything |
---|
3425 | 4879 | copy.ResetDisplayList(); |
---|
3426 | 4880 | copy.HardTouch(); |
---|
3427 | | - CameraPane.RANDOM = random; |
---|
| 4881 | + CameraPane.SWITCH = random; |
---|
3428 | 4882 | } |
---|
3429 | 4883 | |
---|
3430 | 4884 | // public void applySelf() |
---|
.. | .. |
---|
3454 | 4908 | // else |
---|
3455 | 4909 | // applySelf(true); |
---|
3456 | 4910 | // } |
---|
| 4911 | + |
---|
| 4912 | + boolean Equal(double a, double b) |
---|
| 4913 | + { |
---|
| 4914 | + return Math.abs(a - b) < 0.001; |
---|
| 4915 | + } |
---|
| 4916 | + |
---|
3457 | 4917 | void applySelf0(boolean name) |
---|
3458 | 4918 | { |
---|
3459 | 4919 | if (name) |
---|
.. | .. |
---|
3471 | 4931 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
3472 | 4932 | |
---|
3473 | 4933 | current.color = (float) colorField.getFloat(); |
---|
3474 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4934 | + current.modulation = (float) saturationField.getFloat(); |
---|
3475 | 4935 | current.metalness = (float) metalnessField.getFloat(); |
---|
3476 | 4936 | current.diffuse = (float) diffuseField.getFloat(); |
---|
3477 | 4937 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
3494 | 4954 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3495 | 4955 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3496 | 4956 | |
---|
3497 | | - if (!NumberSlider.frozen) |
---|
| 4957 | + if (!cNumberSlider.frozen) |
---|
3498 | 4958 | { |
---|
3499 | 4959 | //System.out.println("Propagate = " + propagate); |
---|
3500 | 4960 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 4961 | + |
---|
| 4962 | + if (copy.material != null) |
---|
| 4963 | + { |
---|
| 4964 | + cMaterial mat = copy.material; |
---|
| 4965 | + |
---|
| 4966 | + if (!Equal(colorField.getFloat(), mat.color)) |
---|
| 4967 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4968 | + if (!Equal(saturationField.getFloat(), mat.modulation)) |
---|
| 4969 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4970 | + if (!Equal(metalnessField.getFloat(), mat.metalness)) |
---|
| 4971 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4972 | + if (!Equal(diffuseField.getFloat(), mat.diffuse)) |
---|
| 4973 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4974 | + if (!Equal(specularField.getFloat(), mat.specular)) |
---|
| 4975 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4976 | + if (!Equal(shininessField.getFloat(), mat.shininess)) |
---|
| 4977 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4978 | + if (!Equal(shiftField.getFloat(), mat.shift)) |
---|
| 4979 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4980 | + if (!Equal(ambientField.getFloat(), mat.ambient)) |
---|
| 4981 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4982 | + if (!Equal(lightareaField.getFloat(), mat.lightarea)) |
---|
| 4983 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4984 | + if (!Equal(diffusenessField.getFloat(), mat.factor)) |
---|
| 4985 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4986 | + if (!Equal(velvetField.getFloat(), mat.velvet)) |
---|
| 4987 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4988 | + if (!Equal(sheenField.getFloat(), mat.sheen)) |
---|
| 4989 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4990 | + if (!Equal(subsurfaceField.getFloat(), mat.subsurface)) |
---|
| 4991 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4992 | + if (!Equal(backlitField.getFloat(), mat.bump)) |
---|
| 4993 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4994 | + if (!Equal(anisoField.getFloat(), mat.aniso)) |
---|
| 4995 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4996 | + if (!Equal(anisoVField.getFloat(), mat.anisoV)) |
---|
| 4997 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4998 | + if (!Equal(cameraField.getFloat(), mat.cameralight)) |
---|
| 4999 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 5000 | + if (!Equal(selfshadowField.getFloat(), mat.diffuseness)) |
---|
| 5001 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 5002 | + if (!Equal(shadowField.getFloat(), mat.shadow)) |
---|
| 5003 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 5004 | + if (!Equal(textureField.getFloat(), mat.texture)) |
---|
| 5005 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 5006 | + if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
| 5007 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 5008 | + if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
| 5009 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 5010 | + if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
| 5011 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 5012 | + } |
---|
| 5013 | + |
---|
3501 | 5014 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3502 | 5015 | { |
---|
3503 | 5016 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3526 | 5039 | //copy.Touch(); |
---|
3527 | 5040 | } |
---|
3528 | 5041 | |
---|
| 5042 | + cNumberSlider versionSlider; |
---|
| 5043 | + |
---|
3529 | 5044 | public void stateChanged(ChangeEvent e) |
---|
3530 | 5045 | { |
---|
3531 | | - // assert(false); |
---|
| 5046 | + // assert(false); |
---|
| 5047 | + if (e.getSource() == versionSlider) |
---|
| 5048 | + { |
---|
| 5049 | + if (muteSlider) |
---|
| 5050 | + return; |
---|
| 5051 | + |
---|
| 5052 | + Replace(); |
---|
| 5053 | + |
---|
| 5054 | + int version = versionSlider.getInteger(); |
---|
| 5055 | + |
---|
| 5056 | + if (version != -1 && copy.versionlist[version] != null) |
---|
| 5057 | + { |
---|
| 5058 | + copy.versionindex = version; |
---|
| 5059 | + CopyChanged(); |
---|
| 5060 | + } |
---|
| 5061 | + |
---|
| 5062 | + return; |
---|
| 5063 | + } |
---|
3532 | 5064 | |
---|
3533 | 5065 | if (freezematerial) |
---|
3534 | 5066 | { |
---|
.. | .. |
---|
3542 | 5074 | || e.getSource() == apertureField |
---|
3543 | 5075 | || e.getSource() == shadowblurField) |
---|
3544 | 5076 | { |
---|
| 5077 | + new Exception().printStackTrace(); |
---|
3545 | 5078 | System.exit(0); |
---|
3546 | 5079 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3547 | 5080 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3563 | 5096 | { |
---|
3564 | 5097 | //System.out.println("stateChanged = " + this); |
---|
3565 | 5098 | materialtouched = true; |
---|
| 5099 | + |
---|
| 5100 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 5101 | + { |
---|
| 5102 | + saturationField.setFloat(1); |
---|
| 5103 | + } |
---|
| 5104 | + |
---|
3566 | 5105 | applySelf(); |
---|
3567 | 5106 | //System.out.println("this = " + this); |
---|
3568 | 5107 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
3612 | 5151 | } |
---|
3613 | 5152 | |
---|
3614 | 5153 | if (normalpushField != null) |
---|
3615 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 5154 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3616 | 5155 | } |
---|
3617 | 5156 | |
---|
3618 | 5157 | void SnapObject() |
---|
.. | .. |
---|
3862 | 5401 | { |
---|
3863 | 5402 | if (GetTree() != null) |
---|
3864 | 5403 | { |
---|
| 5404 | + GetTree().revalidate(); |
---|
3865 | 5405 | GetTree().repaint(); |
---|
3866 | 5406 | } |
---|
3867 | 5407 | |
---|
3868 | 5408 | radioPanel.revalidate(); |
---|
3869 | 5409 | radioPanel.repaint(); |
---|
3870 | | - ctrlPanel.revalidate(); // ? new |
---|
| 5410 | + ctrlPanel.validate(); // ? new |
---|
3871 | 5411 | ctrlPanel.repaint(); |
---|
3872 | 5412 | } |
---|
| 5413 | + |
---|
| 5414 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5415 | + SetVersionStates(); |
---|
| 5416 | + |
---|
| 5417 | + cameraView.requestFocusInWindow(); |
---|
3873 | 5418 | } |
---|
3874 | 5419 | |
---|
3875 | 5420 | static TweenManager tweenManager = new TweenManager(); |
---|
3876 | 5421 | |
---|
3877 | 5422 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3878 | 5423 | { |
---|
| 5424 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
| 5425 | + Save(); |
---|
3879 | 5426 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3880 | 5427 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3881 | 5428 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3899 | 5446 | // group = (Composite) group.get(0); |
---|
3900 | 5447 | // } |
---|
3901 | 5448 | |
---|
3902 | | - System.out.println("makeSomething of " + thing); |
---|
| 5449 | + //System.out.println("makeSomething of " + thing); |
---|
3903 | 5450 | |
---|
3904 | 5451 | /* |
---|
3905 | 5452 | if (deselect && jList != null) |
---|
.. | .. |
---|
3962 | 5509 | { |
---|
3963 | 5510 | ResetModel(); |
---|
3964 | 5511 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 5512 | + |
---|
| 5513 | + if (thing.Size() == 0) |
---|
| 5514 | + { |
---|
| 5515 | + //EditSelection(false); |
---|
| 5516 | + } |
---|
| 5517 | + |
---|
3965 | 5518 | refreshContents(); |
---|
3966 | 5519 | } |
---|
3967 | 5520 | |
---|
.. | .. |
---|
4079 | 5632 | } |
---|
4080 | 5633 | } |
---|
4081 | 5634 | } |
---|
| 5635 | + |
---|
4082 | 5636 | LoadGFDThread loadGFDThread; |
---|
4083 | 5637 | |
---|
4084 | 5638 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4098 | 5652 | |
---|
4099 | 5653 | try |
---|
4100 | 5654 | { |
---|
| 5655 | + // Try compressed version first. |
---|
4101 | 5656 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4102 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5657 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 5658 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4103 | 5659 | |
---|
4104 | 5660 | readobj = (Object3D) p.readObject(); |
---|
4105 | 5661 | istream.close(); |
---|
.. | .. |
---|
4107 | 5663 | readobj.ResetDisplayList(); |
---|
4108 | 5664 | } catch (Exception e) |
---|
4109 | 5665 | { |
---|
4110 | | - e.printStackTrace(); |
---|
| 5666 | + if (!e.toString().contains("GZIP")) |
---|
| 5667 | + e.printStackTrace(); |
---|
| 5668 | + |
---|
| 5669 | + try |
---|
| 5670 | + { |
---|
| 5671 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 5672 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5673 | + |
---|
| 5674 | + readobj = (Object3D) p.readObject(); |
---|
| 5675 | + istream.close(); |
---|
| 5676 | + |
---|
| 5677 | + readobj.ResetDisplayList(); |
---|
| 5678 | + } catch (Exception e2) |
---|
| 5679 | + { |
---|
| 5680 | + e2.printStackTrace(); |
---|
| 5681 | + } |
---|
4111 | 5682 | } |
---|
4112 | 5683 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4113 | 5684 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4153 | 5724 | |
---|
4154 | 5725 | void LoadIt(Object obj) |
---|
4155 | 5726 | { |
---|
| 5727 | + if (obj == null) |
---|
| 5728 | + { |
---|
| 5729 | + // Invalid file |
---|
| 5730 | + return; |
---|
| 5731 | + } |
---|
| 5732 | + |
---|
4156 | 5733 | System.out.println("Loaded " + obj); |
---|
4157 | 5734 | //new Exception().printStackTrace(); |
---|
4158 | 5735 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4162 | 5739 | |
---|
4163 | 5740 | if (readobj != null) |
---|
4164 | 5741 | { |
---|
| 5742 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 5743 | + // Save(); |
---|
4165 | 5744 | try |
---|
4166 | 5745 | { |
---|
4167 | 5746 | //readobj.deepCopySelf(copy); |
---|
4168 | 5747 | copy.clear(); // june 2014 |
---|
| 5748 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5749 | + copy.skyboxext = readobj.skyboxext; |
---|
4169 | 5750 | for (int i = 0; i < readobj.size(); i++) |
---|
4170 | 5751 | { |
---|
4171 | 5752 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4206 | 5787 | } |
---|
4207 | 5788 | } catch (ClassCastException e) |
---|
4208 | 5789 | { |
---|
| 5790 | + e.printStackTrace(); |
---|
4209 | 5791 | assert (false); |
---|
4210 | 5792 | Composite c = (Composite) copy; |
---|
4211 | 5793 | c.children.clear(); |
---|
.. | .. |
---|
4216 | 5798 | c.addChild(csg); |
---|
4217 | 5799 | } |
---|
4218 | 5800 | |
---|
| 5801 | + copy.versionlist = readobj.versionlist; |
---|
| 5802 | + copy.versionindex = readobj.versionindex; |
---|
| 5803 | + copy.versiontable = readobj.versiontable; |
---|
| 5804 | + |
---|
| 5805 | + if (copy.versionlist == null) |
---|
| 5806 | + { |
---|
| 5807 | + // Backward compatibility |
---|
| 5808 | + copy.versionlist = new Object3D[100]; |
---|
| 5809 | + copy.versionindex = -1; |
---|
| 5810 | + |
---|
| 5811 | + //Save(true); |
---|
| 5812 | + } |
---|
| 5813 | + |
---|
| 5814 | + //? SetUndoStates(); |
---|
| 5815 | + |
---|
4219 | 5816 | ResetModel(); |
---|
4220 | 5817 | copy.HardTouch(); // recompile? |
---|
4221 | 5818 | refreshContents(); |
---|
4222 | 5819 | } |
---|
4223 | 5820 | } |
---|
4224 | 5821 | |
---|
4225 | | - void load() // throws ClassNotFoundException |
---|
| 5822 | + void Open() // throws ClassNotFoundException |
---|
4226 | 5823 | { |
---|
4227 | | - if (GrafreeD.standAlone) |
---|
| 5824 | + if (Grafreed.standAlone) |
---|
4228 | 5825 | { |
---|
4229 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5826 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4230 | 5827 | browser.show(); |
---|
4231 | 5828 | String filename = browser.getFile(); |
---|
4232 | 5829 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4303 | 5900 | |
---|
4304 | 5901 | void save() |
---|
4305 | 5902 | { |
---|
| 5903 | + Replace(); |
---|
| 5904 | + |
---|
4306 | 5905 | if (lastname == null) |
---|
4307 | 5906 | { |
---|
4308 | 5907 | return; |
---|
.. | .. |
---|
4311 | 5910 | try |
---|
4312 | 5911 | { |
---|
4313 | 5912 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4314 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 5913 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5914 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4315 | 5915 | |
---|
4316 | 5916 | p.writeObject(copy); |
---|
4317 | 5917 | p.flush(); |
---|
4318 | 5918 | |
---|
| 5919 | + zstream.close(); |
---|
4319 | 5920 | ostream.close(); |
---|
4320 | 5921 | |
---|
4321 | 5922 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4323 | 5924 | //ps.print(buffer.toString()); |
---|
4324 | 5925 | } catch (IOException e) |
---|
4325 | 5926 | { |
---|
| 5927 | + e.printStackTrace(); |
---|
4326 | 5928 | } |
---|
4327 | 5929 | } |
---|
| 5930 | + |
---|
4328 | 5931 | String lastname; |
---|
4329 | 5932 | |
---|
4330 | 5933 | void saveAs() |
---|
4331 | 5934 | { |
---|
4332 | | - if (GrafreeD.standAlone) |
---|
| 5935 | + if (Grafreed.standAlone) |
---|
4333 | 5936 | { |
---|
4334 | 5937 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4335 | 5938 | browser.setVisible(true); |
---|
4336 | 5939 | String filename = browser.getFile(); |
---|
4337 | 5940 | if (filename != null && filename.length() > 0) |
---|
4338 | 5941 | { |
---|
| 5942 | + if (!filename.endsWith(".gfd")) |
---|
| 5943 | + filename += ".gfd"; |
---|
4339 | 5944 | lastname = browser.getDirectory() + filename; |
---|
4340 | 5945 | save(); |
---|
4341 | 5946 | } |
---|
.. | .. |
---|
4434 | 6039 | try |
---|
4435 | 6040 | { |
---|
4436 | 6041 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4437 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4438 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 6042 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 6043 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4439 | 6044 | |
---|
4440 | 6045 | Object3D objectparent = obj.parent; |
---|
4441 | 6046 | obj.parent = null; |
---|
4442 | 6047 | |
---|
4443 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 6048 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4444 | 6049 | |
---|
4445 | 6050 | obj.parent = objectparent; |
---|
4446 | 6051 | |
---|
.. | .. |
---|
4452 | 6057 | p.writeObject(object); |
---|
4453 | 6058 | p.flush(); |
---|
4454 | 6059 | |
---|
| 6060 | + zstream.close(); |
---|
4455 | 6061 | ostream.close(); |
---|
4456 | | - // zstream.close(); |
---|
4457 | 6062 | |
---|
4458 | 6063 | // group.selection.get(0).parent = parent; |
---|
4459 | 6064 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4474 | 6079 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4475 | 6080 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4476 | 6081 | copy.generatePOV(buffer); |
---|
4477 | | - if (GrafreeD.standAlone) |
---|
| 6082 | + if (Grafreed.standAlone) |
---|
4478 | 6083 | { |
---|
4479 | 6084 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4480 | 6085 | browser.show(); |
---|
.. | .. |
---|
4500 | 6105 | Object3D client; |
---|
4501 | 6106 | Object3D copy; |
---|
4502 | 6107 | MenuBar menuBar; |
---|
4503 | | - Menu windowMenu; |
---|
4504 | | - MenuItem loadItem; |
---|
| 6108 | + Menu fileMenu; |
---|
| 6109 | + MenuItem newItem; |
---|
| 6110 | + MenuItem openItem; |
---|
4505 | 6111 | MenuItem saveItem; |
---|
4506 | 6112 | MenuItem saveAsItem; |
---|
4507 | 6113 | MenuItem exportAsItem; |
---|
4508 | 6114 | MenuItem reexportItem; |
---|
4509 | 6115 | MenuItem povItem; |
---|
4510 | 6116 | MenuItem closeItem; |
---|
4511 | | - Menu cameraMenu; |
---|
| 6117 | + |
---|
4512 | 6118 | CheckboxMenuItem zBufferItem; |
---|
4513 | 6119 | //MenuItem normalLensItem; |
---|
4514 | | - MenuItem editCameraItem; |
---|
4515 | | - MenuItem revertCameraItem; |
---|
4516 | | - CheckboxMenuItem toggleLiveItem; |
---|
4517 | 6120 | MenuItem stepItem; |
---|
| 6121 | + CheckboxMenuItem toggleLiveItem; |
---|
4518 | 6122 | CheckboxMenuItem toggleFullScreenItem; |
---|
4519 | 6123 | CheckboxMenuItem toggleTimelineItem; |
---|
4520 | 6124 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4523 | 6127 | CheckboxMenuItem toggleFootContactItem; |
---|
4524 | 6128 | CheckboxMenuItem toggleDLItem; |
---|
4525 | 6129 | CheckboxMenuItem toggleTextureItem; |
---|
4526 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 6130 | + CheckboxMenuItem toggleSwitchItem; |
---|
4527 | 6131 | CheckboxMenuItem toggleRootItem; |
---|
4528 | 6132 | CheckboxMenuItem animationItem; |
---|
| 6133 | + MenuItem archiveItem; |
---|
4529 | 6134 | CheckboxMenuItem toggleHandleItem; |
---|
4530 | 6135 | CheckboxMenuItem togglePaintItem; |
---|
4531 | 6136 | JSplitPane mainPanel; |
---|
4532 | 6137 | JScrollPane scrollpane; |
---|
| 6138 | + |
---|
4533 | 6139 | JPanel toolbarPanel; |
---|
4534 | | - JPanel treePanel; |
---|
| 6140 | + |
---|
| 6141 | + cGridBag treePanel; |
---|
| 6142 | + |
---|
4535 | 6143 | JPanel radioPanel; |
---|
4536 | 6144 | ButtonGroup buttonGroup; |
---|
4537 | | - JPanel ctrlPanel; |
---|
4538 | | - JPanel materialPanel; |
---|
| 6145 | + |
---|
| 6146 | + cGridBag toolboxPanel; |
---|
| 6147 | + cGridBag skyboxPanel; |
---|
| 6148 | + cGridBag materialPanel; |
---|
| 6149 | + cGridBag ctrlPanel; |
---|
| 6150 | + |
---|
4539 | 6151 | JScrollPane infoPanel; |
---|
4540 | | - JPanel optionsPanel; |
---|
| 6152 | + |
---|
| 6153 | + cGridBag optionsPanel; |
---|
| 6154 | + |
---|
4541 | 6155 | JTabbedPane objectPanel; |
---|
4542 | | - JPanel XYZPanel; |
---|
| 6156 | + boolean materialFlushed; |
---|
| 6157 | + Object3D latestObject; |
---|
| 6158 | + |
---|
| 6159 | + cGridBag transformPanel; |
---|
| 6160 | + cGridBag XYZPanel; |
---|
| 6161 | + |
---|
4543 | 6162 | JSplitPane gridPanel; |
---|
4544 | 6163 | JSplitPane bigPanel; |
---|
4545 | | - JPanel bigThree; |
---|
4546 | | - JTabbedPane scenePanel; |
---|
4547 | | - JPanel centralPanel; |
---|
| 6164 | + |
---|
| 6165 | + cGridBag bigThree; |
---|
| 6166 | + cGridBag scenePanel; |
---|
| 6167 | + cGridBag centralPanel; |
---|
4548 | 6168 | JSplitPane cameraPanel; |
---|
4549 | 6169 | JPanel timelinePanel; |
---|
4550 | 6170 | JMenuBar timelineMenubar; |
---|
.. | .. |
---|
4597 | 6217 | // MATERIAL |
---|
4598 | 6218 | JLabel materialLabel; |
---|
4599 | 6219 | JLabel colorLabel; |
---|
4600 | | - NumberSlider colorField; |
---|
| 6220 | + cNumberSlider colorField; |
---|
4601 | 6221 | JLabel modulationLabel; |
---|
4602 | | - NumberSlider modulationField; |
---|
| 6222 | + cNumberSlider saturationField; |
---|
4603 | 6223 | JLabel metalnessLabel; |
---|
4604 | | - NumberSlider metalnessField; |
---|
| 6224 | + cNumberSlider metalnessField; |
---|
4605 | 6225 | JLabel diffuseLabel; |
---|
4606 | | - NumberSlider diffuseField; |
---|
| 6226 | + cNumberSlider diffuseField; |
---|
4607 | 6227 | JLabel specularLabel; |
---|
4608 | | - NumberSlider specularField; |
---|
| 6228 | + cNumberSlider specularField; |
---|
4609 | 6229 | JLabel shininessLabel; |
---|
4610 | | - NumberSlider shininessField; |
---|
| 6230 | + cNumberSlider shininessField; |
---|
4611 | 6231 | JLabel shiftLabel; |
---|
4612 | | - NumberSlider shiftField; |
---|
| 6232 | + cNumberSlider shiftField; |
---|
4613 | 6233 | JLabel ambientLabel; |
---|
4614 | | - NumberSlider ambientField; |
---|
| 6234 | + cNumberSlider ambientField; |
---|
4615 | 6235 | JLabel lightareaLabel; |
---|
4616 | | - NumberSlider lightareaField; |
---|
| 6236 | + cNumberSlider lightareaField; |
---|
4617 | 6237 | JLabel diffusenessLabel; |
---|
4618 | | - NumberSlider diffusenessField; |
---|
| 6238 | + cNumberSlider diffusenessField; |
---|
4619 | 6239 | JLabel velvetLabel; |
---|
4620 | | - NumberSlider velvetField; |
---|
| 6240 | + cNumberSlider velvetField; |
---|
4621 | 6241 | JLabel sheenLabel; |
---|
4622 | | - NumberSlider sheenField; |
---|
| 6242 | + cNumberSlider sheenField; |
---|
4623 | 6243 | JLabel subsurfaceLabel; |
---|
4624 | | - NumberSlider subsurfaceField; |
---|
| 6244 | + cNumberSlider subsurfaceField; |
---|
4625 | 6245 | //JLabel bumpLabel; |
---|
4626 | 6246 | //NumberSlider bumpField; |
---|
4627 | 6247 | JLabel backlitLabel; |
---|
4628 | | - NumberSlider backlitField; |
---|
| 6248 | + cNumberSlider backlitField; |
---|
4629 | 6249 | JLabel anisoLabel; |
---|
4630 | | - NumberSlider anisoField; |
---|
| 6250 | + cNumberSlider anisoField; |
---|
4631 | 6251 | JLabel anisoVLabel; |
---|
4632 | | - NumberSlider anisoVField; |
---|
| 6252 | + cNumberSlider anisoVField; |
---|
| 6253 | + |
---|
4633 | 6254 | JLabel cameraLabel; |
---|
4634 | | - NumberSlider cameraField; |
---|
| 6255 | + cNumberSlider cameraField; |
---|
4635 | 6256 | JLabel selfshadowLabel; |
---|
4636 | | - NumberSlider selfshadowField; |
---|
| 6257 | + cNumberSlider selfshadowField; |
---|
4637 | 6258 | JLabel shadowLabel; |
---|
4638 | | - NumberSlider shadowField; |
---|
| 6259 | + cNumberSlider shadowField; |
---|
4639 | 6260 | JLabel textureLabel; |
---|
4640 | | - NumberSlider textureField; |
---|
| 6261 | + cNumberSlider textureField; |
---|
4641 | 6262 | JLabel opacityLabel; |
---|
4642 | | - NumberSlider opacityField; |
---|
| 6263 | + cNumberSlider opacityField; |
---|
4643 | 6264 | JLabel fakedepthLabel; |
---|
4644 | | - NumberSlider fakedepthField; |
---|
| 6265 | + cNumberSlider fakedepthField; |
---|
4645 | 6266 | JLabel shadowbiasLabel; |
---|
4646 | | - NumberSlider shadowbiasField; |
---|
| 6267 | + cNumberSlider shadowbiasField; |
---|
| 6268 | + |
---|
4647 | 6269 | JLabel bumpLabel; |
---|
4648 | | - NumberSlider bumpField; |
---|
| 6270 | + cNumberSlider bumpField; |
---|
4649 | 6271 | JLabel noiseLabel; |
---|
4650 | | - NumberSlider noiseField; |
---|
| 6272 | + cNumberSlider noiseField; |
---|
4651 | 6273 | JLabel powerLabel; |
---|
4652 | | - NumberSlider powerField; |
---|
| 6274 | + cNumberSlider powerField; |
---|
4653 | 6275 | JLabel borderfadeLabel; |
---|
4654 | | - NumberSlider borderfadeField; |
---|
| 6276 | + cNumberSlider borderfadeField; |
---|
4655 | 6277 | JLabel fogLabel; |
---|
4656 | | - NumberSlider fogField; |
---|
| 6278 | + cNumberSlider fogField; |
---|
4657 | 6279 | JLabel opacityPowerLabel; |
---|
4658 | | - NumberSlider opacityPowerField; |
---|
4659 | | - JTree jTree; |
---|
| 6280 | + cNumberSlider opacityPowerField; |
---|
| 6281 | + cTree jTree; |
---|
4660 | 6282 | //ObjectUI parent; |
---|
4661 | 6283 | |
---|
4662 | | - NumberSlider normalpushField; |
---|
| 6284 | + cNumberSlider normalpushField; |
---|
| 6285 | + |
---|
| 6286 | + private MenuItem importGFDItem; |
---|
| 6287 | + private MenuItem importVRMLX3DItem; |
---|
| 6288 | + private MenuItem import3DSItem; |
---|
| 6289 | + private MenuItem importOBJItem; |
---|
4663 | 6290 | } |
---|