.. | .. |
---|
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; |
---|
| 38 | + boolean timeline; |
---|
| 39 | + boolean wasFullScreen; |
---|
31 | 40 | |
---|
| 41 | + GroupEditor callee; |
---|
| 42 | + JFrame frame; |
---|
| 43 | + |
---|
| 44 | + static ObjEditor theFrame; |
---|
| 45 | + |
---|
| 46 | + public void AllocProjectedVertices(Object3D object) |
---|
| 47 | + { |
---|
| 48 | + assert (object.projectedVertices != null); |
---|
| 49 | + |
---|
| 50 | + if (object.projectedVertices.length <= 2) |
---|
| 51 | + { |
---|
| 52 | + // Side effect... |
---|
| 53 | + Object3D.cVector2[] keep = object.projectedVertices; |
---|
| 54 | + object.projectedVertices = new Object3D.cVector2[3]; |
---|
| 55 | + for (int i = 0; i < 3; i++) |
---|
| 56 | + { |
---|
| 57 | + if (i < keep.length) |
---|
| 58 | + { |
---|
| 59 | + object.projectedVertices[i] = keep[i]; |
---|
| 60 | + } else |
---|
| 61 | + { |
---|
| 62 | + object.projectedVertices[i] = new Object3D.cVector2(); |
---|
| 63 | + } |
---|
| 64 | + /* |
---|
| 65 | + if(keep.length == 0) |
---|
| 66 | + object.projectedVertices[0] = new Object3D.cVector2(); |
---|
| 67 | + else |
---|
| 68 | + object.projectedVertices[0] = keep[0]; |
---|
| 69 | + object.projectedVertices[1] = new Object3D.cVector2(); |
---|
| 70 | + */ |
---|
| 71 | + } |
---|
| 72 | + } |
---|
| 73 | + } |
---|
| 74 | + |
---|
| 75 | + public cGridBag GetSeparator() |
---|
| 76 | + { |
---|
| 77 | + cGridBag separator = new cGridBag(); |
---|
| 78 | + separator.add(new JSeparator()); |
---|
| 79 | + separator.preferredHeight = 5; |
---|
| 80 | + return separator; |
---|
| 81 | + } |
---|
| 82 | + |
---|
| 83 | + cButton GetButton(String name, boolean border) |
---|
| 84 | + { |
---|
| 85 | + ImageIcon icon = GetIcon(name); |
---|
| 86 | + return new cButton(icon, border); |
---|
| 87 | + } |
---|
| 88 | + |
---|
| 89 | + cLabel GetLabel(String name, boolean border) |
---|
| 90 | + { |
---|
| 91 | + //ImageIcon icon = GetIcon(name); |
---|
| 92 | + return new cLabel(GetImage(name), border); |
---|
| 93 | + } |
---|
| 94 | + |
---|
| 95 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 96 | + { |
---|
| 97 | + ImageIcon icon = GetIcon(name); |
---|
| 98 | + return new cToggleButton(icon, border); |
---|
| 99 | + } |
---|
| 100 | + |
---|
| 101 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 102 | + { |
---|
| 103 | + ImageIcon icon = GetIcon(name); |
---|
| 104 | + return new cCheckBox(icon, border); |
---|
| 105 | + } |
---|
| 106 | + |
---|
| 107 | + static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>(); |
---|
| 108 | + |
---|
| 109 | + ImageIcon GetIcon(String name) |
---|
| 110 | + { |
---|
| 111 | + javax.swing.ImageIcon iconCache = icons.get(name); |
---|
| 112 | + if (iconCache != null) |
---|
| 113 | + { |
---|
| 114 | + return iconCache; |
---|
| 115 | + } |
---|
| 116 | + |
---|
| 117 | + try |
---|
| 118 | + { |
---|
| 119 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 120 | + |
---|
| 121 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 122 | +// { |
---|
| 123 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 124 | +// Graphics2D g = resized.createGraphics(); |
---|
| 125 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 126 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 127 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 128 | +// g.dispose(); |
---|
| 129 | +// |
---|
| 130 | +// image = resized; |
---|
| 131 | +// } |
---|
| 132 | + |
---|
| 133 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 134 | + |
---|
| 135 | + icons.put(name, icon); |
---|
| 136 | + |
---|
| 137 | + return icon; |
---|
| 138 | + } |
---|
| 139 | + catch (Exception e) |
---|
| 140 | + { |
---|
| 141 | + //icons.put(name, null); |
---|
| 142 | + return null; |
---|
| 143 | + } |
---|
| 144 | + } |
---|
| 145 | + |
---|
| 146 | + BufferedImage GetImage(String name) |
---|
| 147 | + { |
---|
| 148 | + try |
---|
| 149 | + { |
---|
| 150 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 151 | + |
---|
| 152 | + return image; |
---|
| 153 | + } |
---|
| 154 | + catch (Exception e) |
---|
| 155 | + { |
---|
| 156 | + return null; |
---|
| 157 | + } |
---|
| 158 | + } |
---|
| 159 | + |
---|
32 | 160 | // SCRIPT |
---|
33 | 161 | |
---|
34 | 162 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
119 | 247 | void keyPressed(int key, int modifiers) |
---|
120 | 248 | { |
---|
121 | 249 | System.out.println("KEY PRESSED"); |
---|
122 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 250 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
123 | 251 | } |
---|
124 | 252 | */ |
---|
125 | 253 | |
---|
126 | 254 | static GridBagConstraints aConstraints; |
---|
127 | 255 | static GridBagConstraints aWindowConstraints; |
---|
128 | | - GroupEditor callee; |
---|
129 | | - JFrame frame; |
---|
| 256 | + |
---|
130 | 257 | static int GRIDWIDTH = 100; // 4; |
---|
131 | 258 | |
---|
132 | 259 | public void closeUI() |
---|
133 | 260 | { |
---|
134 | 261 | //new Exception().printStackTrace(); |
---|
135 | | - System.out.println("this = " + this); |
---|
136 | | - System.out.println("objEditor = " + objEditor); |
---|
| 262 | +// System.out.println("this = " + this); |
---|
| 263 | +// System.out.println("objEditor = " + objEditor); |
---|
137 | 264 | //nameField.removeActionListener(this); |
---|
138 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 265 | +// objEditor.ctrlPanel.remove(nameField); |
---|
139 | 266 | |
---|
140 | | - if (!GroupEditor.allparams) |
---|
| 267 | + objEditor.ctrlPanel.remove(namePanel); |
---|
| 268 | + |
---|
| 269 | + if (!allparams) |
---|
141 | 270 | return; |
---|
142 | 271 | |
---|
143 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
144 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
145 | | - objEditor.ctrlPanel.remove(markCB); |
---|
146 | | - |
---|
147 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
148 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
149 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
150 | | - |
---|
151 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
152 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
153 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
154 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
155 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
156 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
157 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
158 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
159 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
160 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 272 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 273 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 274 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 275 | +// |
---|
| 276 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 277 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 278 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 279 | +// |
---|
| 280 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 281 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 282 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 283 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 284 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 285 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 286 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 287 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 288 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 289 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
| 290 | + |
---|
| 291 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 292 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 293 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
| 294 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 295 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 296 | + |
---|
| 297 | + //Remove(normalpushField); |
---|
161 | 298 | } |
---|
162 | 299 | |
---|
163 | 300 | public ObjEditor GetEditor() |
---|
164 | 301 | { |
---|
165 | 302 | return objEditor; //.GetEditor(); |
---|
166 | 303 | } |
---|
| 304 | + |
---|
| 305 | + // Sometimes myself, sometimes my callee's. |
---|
167 | 306 | ObjEditor objEditor; |
---|
168 | 307 | |
---|
169 | 308 | /* |
---|
.. | .. |
---|
199 | 338 | client = inClient; |
---|
200 | 339 | copy = client; |
---|
201 | 340 | |
---|
| 341 | +// if (copy.versionlist == null) |
---|
| 342 | +// { |
---|
| 343 | +// copy.versionlist = new Object3D[100]; |
---|
| 344 | +// copy.versionindex = -1; |
---|
| 345 | +// |
---|
| 346 | +// callee.Save(true); |
---|
| 347 | +// } |
---|
| 348 | + |
---|
202 | 349 | // "this" is not called: SetupUI2(objEditor); |
---|
203 | 350 | } |
---|
204 | 351 | |
---|
.. | .. |
---|
212 | 359 | client = inClient; |
---|
213 | 360 | copy = client; |
---|
214 | 361 | |
---|
| 362 | + if (copy.versionlist == null) |
---|
| 363 | + { |
---|
| 364 | + copy.versionlist = new Object3D[100]; |
---|
| 365 | + copy.versionindex = -1; |
---|
| 366 | + |
---|
| 367 | +// Save(true); |
---|
| 368 | + } |
---|
| 369 | + |
---|
215 | 370 | SetupUI2(callee.GetEditor()); |
---|
216 | 371 | } |
---|
217 | 372 | |
---|
.. | .. |
---|
226 | 381 | //localCopy.parent = null; |
---|
227 | 382 | |
---|
228 | 383 | frame = new JFrame(); |
---|
| 384 | + frame.setUndecorated(false); |
---|
229 | 385 | objEditor = this; |
---|
230 | 386 | this.callee = callee; |
---|
231 | 387 | |
---|
232 | 388 | //parent = p; |
---|
233 | 389 | |
---|
234 | 390 | GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); |
---|
235 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 391 | + if (Globals.DEBUG) |
---|
| 392 | + System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
236 | 393 | //gd.setFullScreenWindow(this); |
---|
237 | 394 | //setResizable(false); |
---|
238 | 395 | //if (!isDisplayable()) |
---|
239 | 396 | //setUndecorated(true); |
---|
240 | 397 | |
---|
241 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 398 | + //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
242 | 399 | client = inClient; |
---|
243 | 400 | copy = localCopy; |
---|
244 | 401 | copy.editWindow = this; |
---|
245 | 402 | |
---|
| 403 | +// if (copy.versionlist == null) |
---|
| 404 | +// { |
---|
| 405 | +// copy.versionlist = new Object3D[100]; |
---|
| 406 | +// copy.versionindex = -1; |
---|
| 407 | +// |
---|
| 408 | +// Save(true); |
---|
| 409 | +// } |
---|
| 410 | + |
---|
246 | 411 | SetupMenu(); |
---|
247 | 412 | |
---|
248 | 413 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
256 | 421 | return frame.action(event, obj); |
---|
257 | 422 | } |
---|
258 | 423 | |
---|
| 424 | + // Cannot work without static |
---|
| 425 | + static boolean allparams = true; |
---|
| 426 | + |
---|
| 427 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 428 | + |
---|
259 | 429 | void SetupMenu() |
---|
260 | 430 | { |
---|
261 | 431 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
262 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
263 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
264 | | - windowMenu.add("-"); |
---|
265 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
266 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 432 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 433 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 434 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
| 435 | + |
---|
| 436 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 437 | + Menu menu = new Menu("Import"); |
---|
| 438 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 439 | + importOBJItem.addActionListener(this); |
---|
| 440 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 441 | + import3DSItem.addActionListener(this); |
---|
| 442 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 443 | + importVRMLX3DItem.addActionListener(this); |
---|
| 444 | + menu.add("-"); |
---|
| 445 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 446 | + importGFDItem.addActionListener(this); |
---|
| 447 | + fileMenu.add(menu); |
---|
| 448 | + fileMenu.add("-"); |
---|
| 449 | + |
---|
| 450 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 451 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
267 | 452 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
268 | | - windowMenu.add("-"); |
---|
269 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
270 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
271 | | - windowMenu.add("-"); |
---|
| 453 | + fileMenu.add("-"); |
---|
| 454 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 455 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 456 | + fileMenu.add("-"); |
---|
272 | 457 | if (client.parent != null) |
---|
273 | 458 | { |
---|
274 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 459 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
275 | 460 | } else |
---|
276 | 461 | { |
---|
277 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 462 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
278 | 463 | } |
---|
279 | 464 | |
---|
280 | | - loadItem.addActionListener(this); |
---|
| 465 | + newItem.addActionListener(this); |
---|
| 466 | + openItem.addActionListener(this); |
---|
281 | 467 | saveItem.addActionListener(this); |
---|
282 | 468 | saveAsItem.addActionListener(this); |
---|
283 | 469 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
285 | 471 | //povItem.addActionListener(this); |
---|
286 | 472 | closeItem.addActionListener(this); |
---|
287 | 473 | |
---|
288 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
289 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
290 | | - //zBufferItem.addActionListener(this); |
---|
291 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
292 | | - //normalLensItem.addActionListener(this); |
---|
293 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
294 | | - revertCameraItem.addActionListener(this); |
---|
295 | | - cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen")); |
---|
296 | | - toggleFullItem.addItemListener(this); |
---|
297 | | - toggleFullItem.setState(CameraPane.FULLSCREEN); |
---|
298 | | - cameraMenu.add("-"); |
---|
299 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
300 | | - toggleTextureItem.addItemListener(this); |
---|
301 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
302 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
303 | | - toggleLiveItem.addItemListener(this); |
---|
304 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
305 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
306 | | - stepItem.addActionListener(this); |
---|
307 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
308 | | -// toggleDLItem.addItemListener(this); |
---|
309 | | -// toggleDLItem.setState(false); |
---|
310 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
311 | | - toggleRenderItem.addItemListener(this); |
---|
312 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
313 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
314 | | - toggleDebugItem.addItemListener(this); |
---|
315 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
316 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
317 | | - toggleFrustumItem.addItemListener(this); |
---|
318 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
319 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
320 | | - toggleFootContactItem.addItemListener(this); |
---|
321 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
322 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
323 | | - toggleRandomItem.addItemListener(this); |
---|
324 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
325 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
326 | | - toggleHandleItem.addItemListener(this); |
---|
327 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
328 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
329 | | - togglePaintItem.addItemListener(this); |
---|
330 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
331 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
332 | | -// toggleRootItem.addItemListener(this); |
---|
333 | | -// toggleRootItem.setState(false); |
---|
334 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
335 | | -// animationItem.addItemListener(this); |
---|
336 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
337 | | - cameraMenu.add("-"); |
---|
338 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
339 | | - editCameraItem.addActionListener(this); |
---|
340 | | - |
---|
341 | 474 | objectPanel = new JTabbedPane(); |
---|
| 475 | + |
---|
| 476 | + ChangeListener changeListener = new ChangeListener() |
---|
| 477 | + { |
---|
| 478 | + //String name; |
---|
| 479 | + |
---|
| 480 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 481 | + { |
---|
| 482 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 483 | +// { |
---|
| 484 | +// if (latestObject != null) |
---|
| 485 | +// { |
---|
| 486 | +// refreshContents(true); |
---|
| 487 | +// SetMaterial(latestObject); |
---|
| 488 | +// } |
---|
| 489 | +// |
---|
| 490 | +// materialFlushed = true; |
---|
| 491 | +// } |
---|
| 492 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 493 | +// { |
---|
| 494 | +// if (listUI.size() == 0) |
---|
| 495 | +// EditSelection(false); |
---|
| 496 | +// } |
---|
| 497 | + |
---|
| 498 | +// if (objectPanel.getSelectedIndex() == 4) |
---|
| 499 | +// { |
---|
| 500 | +// name = copy.skyboxname; |
---|
| 501 | +// |
---|
| 502 | +// if (name == null) |
---|
| 503 | +// { |
---|
| 504 | +// name = ""; |
---|
| 505 | +// } |
---|
| 506 | +// |
---|
| 507 | +// copy.skyboxname = "cubemaps/default-skyboxes/rgb"; |
---|
| 508 | +// copy.skyboxext = "jpg"; |
---|
| 509 | +// } |
---|
| 510 | +// else |
---|
| 511 | +// { |
---|
| 512 | +// if (name != null) |
---|
| 513 | +// { |
---|
| 514 | +// if (name.equals("")) |
---|
| 515 | +// { |
---|
| 516 | +// copy.skyboxname = null; |
---|
| 517 | +// copy.skyboxext = null; |
---|
| 518 | +// } |
---|
| 519 | +// else |
---|
| 520 | +// { |
---|
| 521 | +// copy.skyboxname = name; |
---|
| 522 | +// } |
---|
| 523 | +// } |
---|
| 524 | +// } |
---|
| 525 | + cameraView.transformMode = objectPanel.getSelectedIndex() == 4; |
---|
| 526 | + |
---|
| 527 | +// refreshContents(false); // To refresh Info tab |
---|
| 528 | + cameraView.repaint(); |
---|
| 529 | + } |
---|
| 530 | + }; |
---|
| 531 | + objectPanel.addChangeListener(changeListener); |
---|
| 532 | + |
---|
342 | 533 | toolbarPanel = new JPanel(); |
---|
343 | 534 | toolbarPanel.setName("Toolbar"); |
---|
344 | | - treePanel = new JPanel(); |
---|
| 535 | + |
---|
| 536 | + treePanel = new cGridBag(); |
---|
345 | 537 | treePanel.setName("Tree"); |
---|
346 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
347 | | - ctrlPanel.setName("Edit"); |
---|
348 | | - materialPanel = new JPanel(); |
---|
349 | | - materialPanel.setName("Material"); |
---|
| 538 | + |
---|
| 539 | + editPanel = new cGridBag().setVertical(true); |
---|
| 540 | + //editPanel.setName("Edit"); |
---|
| 541 | + |
---|
| 542 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
| 543 | + |
---|
| 544 | + editCommandsPanel = new cGridBag(); |
---|
| 545 | + editPanel.add(editCommandsPanel); |
---|
| 546 | + editPanel.add(ctrlPanel); |
---|
| 547 | + |
---|
| 548 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 549 | + //toolboxPanel.setName("Toolbox"); |
---|
| 550 | + |
---|
| 551 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 552 | + |
---|
| 553 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 554 | + //materialPanel.setName("Material"); |
---|
| 555 | + |
---|
350 | 556 | /*JTextPane*/ |
---|
351 | 557 | infoarea = createTextPane(); |
---|
| 558 | + doc = infoarea.getStyledDocument(); |
---|
| 559 | + |
---|
352 | 560 | infoarea.setEditable(true); |
---|
353 | 561 | SetText(); |
---|
| 562 | + |
---|
354 | 563 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
355 | 564 | // infoarea.setOpaque(false); |
---|
356 | 565 | // //infoarea.setForeground(textcolor); |
---|
357 | | - infoarea.setLineWrap(true); |
---|
358 | | - infoarea.setWrapStyleWord(true); |
---|
| 566 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 567 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
359 | 568 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
360 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
361 | | - infoPanel.setName("Info"); |
---|
| 569 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
| 570 | + //infoPanel.setName("Info"); |
---|
362 | 571 | //infoPanel.setLayout(new BorderLayout()); |
---|
363 | 572 | //infoPanel.add(createTextPane()); |
---|
364 | 573 | |
---|
.. | .. |
---|
366 | 575 | mainPanel.setName("Main"); |
---|
367 | 576 | mainPanel.setContinuousLayout(true); |
---|
368 | 577 | mainPanel.setOneTouchExpandable(true); |
---|
369 | | - mainPanel.setDividerLocation(1.0); |
---|
370 | 578 | mainPanel.setDividerSize(9); |
---|
371 | | - mainPanel.setResizeWeight(0); |
---|
372 | | - |
---|
| 579 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 580 | + mainPanel.setResizeWeight(0.5); |
---|
| 581 | + |
---|
| 582 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 583 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 584 | + divider.setDividerSize(15); |
---|
| 585 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 586 | + |
---|
| 587 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 588 | + |
---|
373 | 589 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
374 | 590 | //mainPanel.setLayout(new GridBagLayout()); |
---|
375 | 591 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
376 | | - treePanel.setLayout(new GridBagLayout()); |
---|
377 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
378 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 592 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 593 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 594 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
379 | 595 | |
---|
380 | 596 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
381 | 597 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
414 | 630 | static String newline = "\n"; |
---|
415 | 631 | protected static final String buttonString = "JButton"; |
---|
416 | 632 | StyledDocument doc; |
---|
417 | | - JTextArea infoarea; |
---|
| 633 | + JTextPane infoarea; |
---|
418 | 634 | |
---|
419 | 635 | void ClearInfo() |
---|
420 | 636 | { |
---|
.. | .. |
---|
437 | 653 | e.printStackTrace(); |
---|
438 | 654 | } |
---|
439 | 655 | |
---|
440 | | - String selection = infoarea.getText(); |
---|
441 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
442 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
443 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 656 | +// String selection = infoarea.getText(); |
---|
| 657 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 658 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 659 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
444 | 660 | //clipboard.setContents(data, data); |
---|
445 | 661 | } |
---|
446 | 662 | |
---|
.. | .. |
---|
463 | 679 | //SendInfo("Name:", "bold"); |
---|
464 | 680 | if (sel.GetTextures() != null || debug) |
---|
465 | 681 | { |
---|
466 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 682 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
467 | 683 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
468 | 684 | if (sel.Size() > 0) |
---|
469 | 685 | { |
---|
470 | 686 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
471 | 687 | } |
---|
472 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 688 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
473 | 689 | if (debug) |
---|
474 | 690 | { |
---|
475 | 691 | try |
---|
.. | .. |
---|
481 | 697 | } |
---|
482 | 698 | |
---|
483 | 699 | if (full) |
---|
484 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 700 | + { |
---|
| 701 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 702 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 703 | + } |
---|
485 | 704 | |
---|
486 | 705 | if (sel.bRep != null) |
---|
487 | 706 | { |
---|
.. | .. |
---|
508 | 727 | } |
---|
509 | 728 | if (sel.support != null) |
---|
510 | 729 | { |
---|
511 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 730 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
512 | 731 | } |
---|
513 | 732 | if (sel.scriptnode != null) |
---|
514 | 733 | { |
---|
.. | .. |
---|
522 | 741 | maxima.y = sel.toParent[3][1]; |
---|
523 | 742 | maxima.z = sel.toParent[3][2]; |
---|
524 | 743 | si.SendInfo(" Orig: " + maxima, "regular"); |
---|
525 | | - maxima.x = sel.globalTransform[3][0]; |
---|
526 | | - maxima.y = sel.globalTransform[3][1]; |
---|
527 | | - maxima.z = sel.globalTransform[3][2]; |
---|
528 | | - if (full) |
---|
529 | | - si.SendInfo(" Global Orig: " + maxima, "regular"); |
---|
530 | 744 | maxima.x = sel.toParent[0][0]; |
---|
531 | 745 | maxima.y = sel.toParent[1][1]; |
---|
532 | 746 | maxima.z = sel.toParent[2][2]; |
---|
533 | 747 | si.SendInfo(" Scale: " + maxima, "regular"); |
---|
534 | | - maxima.x = sel.globalTransform[0][0]; |
---|
535 | | - maxima.y = sel.globalTransform[1][1]; |
---|
536 | | - maxima.z = sel.globalTransform[2][2]; |
---|
| 748 | + maxima.x = sel.globalTransform[3][0]; |
---|
| 749 | + maxima.y = sel.globalTransform[3][1]; |
---|
| 750 | + maxima.z = sel.globalTransform[3][2]; |
---|
| 751 | + if (full) |
---|
| 752 | + si.SendInfo(" Global Orig: " + maxima, "regular"); |
---|
| 753 | + maxima.x = sel.globalTransform[0][0]; |
---|
| 754 | + maxima.y = sel.globalTransform[1][1]; |
---|
| 755 | + maxima.z = sel.globalTransform[2][2]; |
---|
537 | 756 | if (full) |
---|
538 | 757 | si.SendInfo(" Global Scale: " + maxima, "regular"); |
---|
539 | 758 | } |
---|
.. | .. |
---|
579 | 798 | { |
---|
580 | 799 | CameraPane.pointflow = (PointFlow) sel; |
---|
581 | 800 | } |
---|
| 801 | + |
---|
| 802 | + si.SendInfo("_____________________", "regular"); |
---|
| 803 | + si.SendInfo("", "regular"); |
---|
582 | 804 | } |
---|
583 | 805 | } |
---|
584 | 806 | |
---|
.. | .. |
---|
594 | 816 | } |
---|
595 | 817 | } |
---|
596 | 818 | |
---|
597 | | - private JTextArea createTextPane() |
---|
598 | | - { |
---|
599 | | - String[] initString = |
---|
600 | | - { |
---|
601 | | - "This is an editable JTextPane, ", //regular |
---|
602 | | - "another ", //italic |
---|
603 | | - "styled ", //bold |
---|
604 | | - "text ", //small |
---|
605 | | - "component, ", //large |
---|
606 | | - "which supports embedded components..." + newline,//regular |
---|
607 | | - " " + newline, //button |
---|
608 | | - "...and embedded icons..." + newline, //regular |
---|
609 | | - " ", //icon |
---|
610 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
611 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
612 | | - + "cover methods for interacting with those objects." |
---|
613 | | - }; |
---|
| 819 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 820 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
614 | 821 | |
---|
615 | | - String[] initStyles = |
---|
616 | | - { |
---|
617 | | - "regular", "italic", "bold", "small", "large", |
---|
618 | | - "regular", "button", "regular", "icon", |
---|
619 | | - "regular" |
---|
620 | | - }; |
---|
| 822 | + Rectangle keeprect; |
---|
| 823 | + cRadio radio; |
---|
| 824 | + |
---|
| 825 | +cButton keepButton; |
---|
| 826 | + cButton twoButton; // Full 3D |
---|
| 827 | + cButton sixButton; |
---|
| 828 | + cButton threeButton; |
---|
| 829 | + cButton sevenButton; |
---|
| 830 | + cButton fourButton; // full panel |
---|
| 831 | + cButton oneButton; // full XYZ |
---|
| 832 | + //cButton currentLayout; |
---|
| 833 | + |
---|
| 834 | + boolean maximized; |
---|
| 835 | + |
---|
| 836 | + cButton fullscreenLayout; |
---|
| 837 | + cButton expandedLayout; |
---|
621 | 838 | |
---|
622 | | - JTextPane textPane = new JTextPane(); |
---|
623 | | - textPane.setEditable(true); |
---|
624 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
625 | | - addStylesToDocument(doc); |
---|
626 | | - |
---|
627 | | - try |
---|
| 839 | + void Minimize() |
---|
628 | 840 | { |
---|
629 | | - for (int j = 0; j < 2; j++) |
---|
| 841 | + frame.setState(Frame.ICONIFIED); |
---|
| 842 | + frame.validate(); |
---|
| 843 | + } |
---|
| 844 | + |
---|
| 845 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 846 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 847 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
| 848 | + void Maximize() |
---|
| 849 | + { |
---|
| 850 | + if (CameraPane.FULLSCREEN) |
---|
630 | 851 | { |
---|
631 | | - for (int i = 0; i < initString.length; i++) |
---|
632 | | - { |
---|
633 | | - doc.insertString(doc.getLength(), initString[i], |
---|
634 | | - doc.getStyle(initStyles[i])); |
---|
635 | | - } |
---|
| 852 | + ToggleFullScreen(); |
---|
636 | 853 | } |
---|
637 | | - } catch (BadLocationException ble) |
---|
| 854 | + |
---|
| 855 | + if (maximized) |
---|
| 856 | + { |
---|
| 857 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 858 | + } |
---|
| 859 | + else |
---|
| 860 | + { |
---|
| 861 | + keeprect = frame.getBounds(); |
---|
| 862 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 863 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 864 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 865 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 866 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
| 867 | + } |
---|
| 868 | + |
---|
| 869 | + maximized ^= true; |
---|
| 870 | + |
---|
| 871 | + frame.validate(); |
---|
| 872 | + } |
---|
| 873 | + |
---|
| 874 | + cButton minButton; |
---|
| 875 | + cButton maxButton; |
---|
| 876 | + cButton fullButton; |
---|
| 877 | + cButton collapseButton; |
---|
| 878 | + cButton maximize3DButton; |
---|
| 879 | + |
---|
| 880 | + void ToggleFullScreen() |
---|
638 | 881 | { |
---|
639 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
| 882 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 883 | + |
---|
| 884 | + cameraView.ToggleFullScreen(); |
---|
| 885 | + |
---|
| 886 | + if (!CameraPane.FULLSCREEN) |
---|
| 887 | + { |
---|
| 888 | + device.setFullScreenWindow(null); |
---|
| 889 | + frame.dispose(); |
---|
| 890 | + frame.setUndecorated(false); |
---|
| 891 | + frame.validate(); |
---|
| 892 | + frame.setVisible(true); |
---|
| 893 | + |
---|
| 894 | + //frame.setVisible(false); |
---|
| 895 | +// frame.removeNotify(); |
---|
| 896 | +// frame.setUndecorated(false); |
---|
| 897 | +// frame.addNotify(); |
---|
| 898 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 899 | + |
---|
| 900 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 901 | +// X framePanel.add(bigThree); |
---|
| 902 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 903 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
| 904 | + |
---|
| 905 | + //frame.setVisible(true); |
---|
| 906 | +// radio.layout = keepButton; |
---|
| 907 | + //theFrame = null; |
---|
| 908 | + keepButton = null; |
---|
| 909 | +// radio.layout.doClick(); |
---|
| 910 | + |
---|
| 911 | + } else |
---|
| 912 | + { |
---|
| 913 | + keepButton = radio.layout; |
---|
| 914 | + //keeprect = frame.getBounds(); |
---|
| 915 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 916 | +// frame.getToolkit().getScreenSize().height); |
---|
| 917 | + //frame.setVisible(false); |
---|
| 918 | + |
---|
| 919 | + frame.dispose(); |
---|
| 920 | + frame.setUndecorated(true); |
---|
| 921 | + device.setFullScreenWindow(frame); |
---|
| 922 | + frame.validate(); |
---|
| 923 | + frame.setVisible(true); |
---|
| 924 | +// frame.removeNotify(); |
---|
| 925 | +// frame.setUndecorated(true); |
---|
| 926 | +// frame.addNotify(); |
---|
| 927 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 928 | +// X framePanel.remove(bigThree); |
---|
| 929 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 930 | +// framePanel.setDividerLocation(0); |
---|
| 931 | + |
---|
| 932 | +// radio.layout = fullscreenLayout; |
---|
| 933 | +// radio.layout.doClick(); |
---|
| 934 | + //frame.setVisible(true); |
---|
| 935 | + } |
---|
| 936 | + frame.validate(); |
---|
| 937 | + |
---|
| 938 | + cameraView.requestFocusInWindow(); |
---|
640 | 939 | } |
---|
641 | 940 | |
---|
642 | | - return new JTextArea(); // textPane; |
---|
| 941 | + void CollapseToolbar() |
---|
| 942 | + { |
---|
| 943 | + framePanel.setDividerLocation(0); |
---|
| 944 | + //frame.validate(); |
---|
| 945 | + |
---|
| 946 | + cameraView.requestFocusInWindow(); |
---|
| 947 | + } |
---|
| 948 | + |
---|
| 949 | + private Object3D Duplicate(Object3D object) |
---|
| 950 | + { |
---|
| 951 | + boolean temp = CameraPane.SWITCH; |
---|
| 952 | + CameraPane.SWITCH = false; |
---|
| 953 | + |
---|
| 954 | + object.ExtractBigData(versiontable); |
---|
| 955 | + // if (copy == client) |
---|
| 956 | + |
---|
| 957 | + Object3D versions[] = object.versionlist; |
---|
| 958 | + object.versionlist = null; |
---|
| 959 | + |
---|
| 960 | + //byte[] compress = Compress(copy); |
---|
| 961 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
| 962 | + |
---|
| 963 | + object.versionlist = versions; |
---|
| 964 | + |
---|
| 965 | + object.RestoreBigData(versiontable); |
---|
| 966 | + |
---|
| 967 | + CameraPane.SWITCH = temp; |
---|
| 968 | + |
---|
| 969 | + return compress; |
---|
| 970 | + } |
---|
| 971 | + |
---|
| 972 | + private JTextPane createTextPane() |
---|
| 973 | + { |
---|
| 974 | +// TEXTAREA String[] initString = |
---|
| 975 | +// { |
---|
| 976 | +// "This is an editable JTextPane, ", //regular |
---|
| 977 | +// "another ", //italic |
---|
| 978 | +// "styled ", //bold |
---|
| 979 | +// "text ", //small |
---|
| 980 | +// "component, ", //large |
---|
| 981 | +// "which supports embedded components..." + newline,//regular |
---|
| 982 | +// " " + newline, //button |
---|
| 983 | +// "...and embedded icons..." + newline, //regular |
---|
| 984 | +// " ", //icon |
---|
| 985 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 986 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 987 | +// + "cover methods for interacting with those objects." |
---|
| 988 | +// }; |
---|
| 989 | +// |
---|
| 990 | +// String[] initStyles = |
---|
| 991 | +// { |
---|
| 992 | +// "regular", "italic", "bold", "small", "large", |
---|
| 993 | +// "regular", "button", "regular", "icon", |
---|
| 994 | +// "regular" |
---|
| 995 | +// }; |
---|
| 996 | +// |
---|
| 997 | +// JTextPane textPane = new JTextPane(); |
---|
| 998 | +// textPane.setEditable(true); |
---|
| 999 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 1000 | +// addStylesToDocument(doc); |
---|
| 1001 | +// |
---|
| 1002 | +// try |
---|
| 1003 | +// { |
---|
| 1004 | +// for (int j = 0; j < 2; j++) |
---|
| 1005 | +// { |
---|
| 1006 | +// for (int i = 0; i < initString.length; i++) |
---|
| 1007 | +// { |
---|
| 1008 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 1009 | +// doc.getStyle(initStyles[i])); |
---|
| 1010 | +// } |
---|
| 1011 | +// } |
---|
| 1012 | +// } catch (BadLocationException ble) |
---|
| 1013 | +// { |
---|
| 1014 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 1015 | +// } |
---|
| 1016 | + |
---|
| 1017 | + return new JTextPane(); // textPane; |
---|
643 | 1018 | } |
---|
644 | 1019 | |
---|
645 | 1020 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
692 | 1067 | protected static ImageIcon createImageIcon(String path, |
---|
693 | 1068 | String description) |
---|
694 | 1069 | { |
---|
695 | | - java.net.URL imgURL = GraphreeD.class.getResource(path); |
---|
| 1070 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
696 | 1071 | if (imgURL != null) |
---|
697 | 1072 | { |
---|
698 | 1073 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
715 | 1090 | { |
---|
716 | 1091 | SetupMaterial(materialPanel); |
---|
717 | 1092 | } |
---|
| 1093 | + |
---|
718 | 1094 | //SetupName(); |
---|
719 | 1095 | //SetupViews(); |
---|
720 | 1096 | } |
---|
.. | .. |
---|
724 | 1100 | // NumberSlider vDivsField; |
---|
725 | 1101 | // JCheckBox endcaps; |
---|
726 | 1102 | JCheckBox liveCB; |
---|
| 1103 | + JCheckBox selectableCB; |
---|
727 | 1104 | JCheckBox hideCB; |
---|
728 | 1105 | JCheckBox link2masterCB; |
---|
729 | 1106 | JCheckBox markCB; |
---|
.. | .. |
---|
731 | 1108 | JCheckBox speedupCB; |
---|
732 | 1109 | JCheckBox rewindCB; |
---|
733 | 1110 | JCheckBox flipVCB; |
---|
| 1111 | + |
---|
| 1112 | + cCheckBox toggleTextureCB; |
---|
| 1113 | + cCheckBox toggleSwitchCB; |
---|
| 1114 | + |
---|
734 | 1115 | JComboBox texresMenu; |
---|
| 1116 | + |
---|
735 | 1117 | JButton resetButton; |
---|
736 | 1118 | JButton stepButton; |
---|
737 | 1119 | JButton stepAllButton; |
---|
.. | .. |
---|
739 | 1121 | JButton slowerButton; |
---|
740 | 1122 | JButton fasterButton; |
---|
741 | 1123 | JButton remarkButton; |
---|
| 1124 | + |
---|
| 1125 | + cGridBag editPanel; |
---|
| 1126 | + cGridBag editCommandsPanel; |
---|
| 1127 | + |
---|
| 1128 | + cGridBag namePanel; |
---|
| 1129 | + cGridBag setupPanel; |
---|
| 1130 | + cGridBag setupPanel2; |
---|
| 1131 | + cGridBag objectCommandsPanel; |
---|
| 1132 | + cGridBag pushPanel; |
---|
| 1133 | + cGridBag fillPanel; |
---|
742 | 1134 | |
---|
743 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 1135 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
744 | 1136 | { |
---|
745 | 1137 | JCheckBox cb; |
---|
746 | 1138 | |
---|
747 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
748 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
749 | | -// oe.aConstraints.weightx = 1; |
---|
750 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
751 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1139 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
752 | 1140 | cb.addItemListener(this); |
---|
753 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
754 | | - oe.aConstraints.gridwidth = 1; |
---|
755 | | - oe.aConstraints.gridx += 1; |
---|
756 | 1141 | |
---|
757 | 1142 | return cb; |
---|
758 | 1143 | } |
---|
759 | 1144 | |
---|
760 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 1145 | + cButton AddButton(cGridBag panel, String label) |
---|
761 | 1146 | { |
---|
762 | 1147 | cButton cb; |
---|
763 | 1148 | |
---|
764 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
765 | | - oe.aConstraints.gridwidth = 1; |
---|
766 | | -// oe.aConstraints.weightx = 1; |
---|
767 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
768 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 1149 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
769 | 1150 | cb.addActionListener(this); |
---|
770 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
771 | | - oe.aConstraints.gridwidth = 1; |
---|
772 | | - oe.aConstraints.gridx += 1; |
---|
773 | 1151 | |
---|
774 | 1152 | return cb; |
---|
775 | 1153 | } |
---|
776 | 1154 | |
---|
777 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 1155 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
778 | 1156 | { |
---|
779 | 1157 | JComboBox combo; |
---|
780 | 1158 | |
---|
781 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
782 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
783 | | - oe.aConstraints.gridx += 1; |
---|
| 1159 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
784 | 1160 | combo.addActionListener(this); |
---|
785 | 1161 | |
---|
786 | 1162 | return combo; |
---|
787 | 1163 | } |
---|
788 | 1164 | |
---|
789 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 1165 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
790 | 1166 | { |
---|
791 | | - NumberSlider combo; |
---|
| 1167 | + cGridBag control = new cGridBag(); |
---|
| 1168 | + |
---|
| 1169 | + cNumberSlider combo; |
---|
792 | 1170 | |
---|
793 | 1171 | JLabel jlabel = new JLabel(label); |
---|
794 | | - |
---|
795 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
796 | 1172 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
797 | | - aConstraints.gridwidth = 2; |
---|
798 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
799 | | - aConstraints.gridx += 1; |
---|
800 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
801 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
802 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
803 | | - aConstraints.gridx += 1; |
---|
804 | | - aConstraints.gridwidth = 1; |
---|
805 | | - |
---|
| 1173 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1174 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
806 | 1175 | combo.setFloat(current); |
---|
807 | | - |
---|
808 | | - combo.label = jlabel; |
---|
809 | | - |
---|
810 | | - combo.addChangeListener(this); |
---|
811 | | - |
---|
812 | | - return combo; |
---|
| 1176 | + |
---|
| 1177 | + panel.add(control); |
---|
| 1178 | + |
---|
| 1179 | + return control; |
---|
813 | 1180 | } |
---|
814 | 1181 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 1182 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
816 | 1183 | { |
---|
817 | | - NumberSlider combo; |
---|
| 1184 | + cGridBag control = new cGridBag(); |
---|
| 1185 | + |
---|
| 1186 | + cNumberSlider combo; |
---|
818 | 1187 | |
---|
819 | 1188 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 1189 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
823 | | - aConstraints.gridwidth = 2; |
---|
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), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
829 | | - aConstraints.gridx += 1; |
---|
830 | | - aConstraints.gridwidth = 1; |
---|
831 | | - |
---|
| 1190 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1191 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 1192 | combo.setInteger(current); |
---|
833 | 1193 | |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 1194 | + panel.add(control); |
---|
| 1195 | + |
---|
| 1196 | + return control; |
---|
839 | 1197 | } |
---|
840 | 1198 | |
---|
841 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 1199 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
842 | 1200 | { |
---|
843 | 1201 | JTextArea text; |
---|
844 | 1202 | |
---|
845 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
846 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
847 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1203 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
848 | 1204 | text.addCaretListener(this); |
---|
849 | | - aConstraints.gridx += 1; |
---|
850 | | - aConstraints.gridwidth = 1; |
---|
851 | 1205 | |
---|
852 | 1206 | return text; |
---|
853 | 1207 | } |
---|
.. | .. |
---|
877 | 1231 | objEditor.ctrlPanel.remove(j); |
---|
878 | 1232 | } |
---|
879 | 1233 | |
---|
| 1234 | + void Remove(cNumberSlider j) |
---|
| 1235 | + { |
---|
| 1236 | + j.removeChangeListener(this); |
---|
| 1237 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 1238 | + objEditor.ctrlPanel.remove(j); |
---|
| 1239 | + } |
---|
| 1240 | + |
---|
880 | 1241 | /* |
---|
881 | 1242 | */ |
---|
882 | | - void Return() // ObjEditor oe) |
---|
| 1243 | + void Return0() // ObjEditor oe) |
---|
883 | 1244 | { |
---|
884 | 1245 | aConstraints.gridy += 1; |
---|
885 | 1246 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
934 | 1295 | |
---|
935 | 1296 | void SetupUI2(ObjEditor oe) |
---|
936 | 1297 | { |
---|
937 | | -// oe.aConstraints.weightx = 0; |
---|
938 | | -// oe.aConstraints.weighty = 0; |
---|
939 | | -// oe.aConstraints.gridx = 0; |
---|
940 | | -// oe.aConstraints.gridy = 0; |
---|
941 | | - SetupName(oe); |
---|
| 1298 | + //SetupName(oe); |
---|
942 | 1299 | |
---|
943 | | - if (!GroupEditor.allparams) |
---|
| 1300 | + namePanel = new cGridBag(); |
---|
| 1301 | + |
---|
| 1302 | + //if (copy.pinned) |
---|
| 1303 | + { |
---|
| 1304 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1305 | + pinButton.setSelected(copy.pinned); |
---|
| 1306 | + cGridBag t = new cGridBag(); |
---|
| 1307 | + t.preferredWidth = 2; |
---|
| 1308 | + t.add(pinButton); |
---|
| 1309 | + namePanel.add(t); |
---|
| 1310 | + |
---|
| 1311 | + pinButton.addItemListener(this); |
---|
| 1312 | + } |
---|
| 1313 | + |
---|
| 1314 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 1315 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
| 1316 | + oe.ctrlPanel.add(namePanel); |
---|
| 1317 | + |
---|
| 1318 | + oe.ctrlPanel.Return(); |
---|
| 1319 | + |
---|
| 1320 | + if (!allparams) |
---|
944 | 1321 | return; |
---|
945 | 1322 | |
---|
946 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
947 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
948 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1323 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1324 | + |
---|
| 1325 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1326 | + liveCB.setToolTipText("Animate object"); |
---|
| 1327 | + markCB = AddCheckBox(setupPanel, "Anim", copy.marked); |
---|
| 1328 | + markCB.setToolTipText("Set target transform"); |
---|
| 1329 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1330 | + selectableCB.setToolTipText("Make object selectable"); |
---|
949 | 1331 | // Return(); |
---|
950 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
951 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
952 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
953 | | - Return(); |
---|
954 | | - resetButton = AddButton(oe, "Reset"); |
---|
955 | | - stepButton = AddButton(oe, "Step"); |
---|
| 1332 | + |
---|
| 1333 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1334 | + hideCB.setToolTipText("Hide object"); |
---|
| 1335 | + |
---|
| 1336 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
| 1337 | + |
---|
| 1338 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1339 | + |
---|
| 1340 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1341 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1342 | + |
---|
| 1343 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1344 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
| 1345 | + |
---|
| 1346 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1347 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1348 | + |
---|
| 1349 | + if (Globals.ADVANCED) |
---|
| 1350 | + { |
---|
| 1351 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1352 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1353 | + } |
---|
| 1354 | + |
---|
| 1355 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1356 | + oe.ctrlPanel.Return(); |
---|
| 1357 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1358 | + oe.ctrlPanel.Return(); |
---|
| 1359 | + |
---|
| 1360 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
| 1361 | + |
---|
| 1362 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1363 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1364 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1365 | + stepButton.setToolTipText("Step one frame"); |
---|
956 | 1366 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
957 | 1367 | // stepAllButton = AddButton(oe, "Step All"); |
---|
958 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
959 | 1368 | // Return(); |
---|
960 | | - slowerButton = AddButton(oe, "Slow"); |
---|
961 | | - fasterButton = AddButton(oe, "Fast"); |
---|
962 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1369 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1370 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1371 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1372 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1373 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1374 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
963 | 1375 | |
---|
964 | | - Return(); |
---|
| 1376 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
| 1377 | + oe.ctrlPanel.Return(); |
---|
965 | 1378 | |
---|
| 1379 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1380 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1381 | + //Return(); |
---|
| 1382 | + |
---|
| 1383 | + oe.ctrlPanel.Return(); |
---|
| 1384 | + |
---|
966 | 1385 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
967 | 1386 | // ObjEditor.aConstraints.gridx += 1; |
---|
968 | 1387 | |
---|
.. | .. |
---|
1056 | 1475 | oe.aConstraints.gridwidth = 1; |
---|
1057 | 1476 | /**/ |
---|
1058 | 1477 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1059 | | - Return(); |
---|
| 1478 | + oe.ctrlPanel.Return(); |
---|
1060 | 1479 | |
---|
1061 | 1480 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1062 | 1481 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1107 | 1526 | //frontScroll.setLabel("------------------------------ XZ (front) ---------------------------------------------------"); |
---|
1108 | 1527 | //sideScroll.setLabel("------------------------------- YZ (side) ---------------------------------------------------"); |
---|
1109 | 1528 | |
---|
1110 | | -// GridBagConstraints gbc = (GridBagConstraints) GraphreeD.clone(aConstraints); |
---|
| 1529 | +// GridBagConstraints gbc = (GridBagConstraints) GrafreeD.clone(aConstraints); |
---|
1111 | 1530 | Camera cam = GetCamera(copy, 0); |
---|
1112 | 1531 | |
---|
1113 | 1532 | Composite cams = null; |
---|
1114 | 1533 | |
---|
1115 | 1534 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1116 | 1535 | { |
---|
| 1536 | + if (Globals.DEBUG) |
---|
1117 | 1537 | System.out.println("CREATE CAMERAS"); |
---|
1118 | 1538 | cams = new cTemplate(); |
---|
1119 | 1539 | cams.name = "Cameras"; |
---|
.. | .. |
---|
1158 | 1578 | //JPanel worldPanel = |
---|
1159 | 1579 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1160 | 1580 | //worldPanel.setName("World"); |
---|
1161 | | - /*JPanel*/ cameraPanel = |
---|
1162 | | - new JPanel(new BorderLayout()); |
---|
1163 | | - cameraPanel.add(cameraView); |
---|
| 1581 | + centralPanel = new cGridBag(); |
---|
| 1582 | + centralPanel.preferredWidth = 20; |
---|
| 1583 | + |
---|
| 1584 | + if (Globals.ADVANCED) |
---|
| 1585 | + { |
---|
| 1586 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1587 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1164 | 1588 | |
---|
| 1589 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1590 | + cameraPanel.setContinuousLayout(true); |
---|
| 1591 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1592 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1593 | +// cameraPanel.setDividerSize(9); |
---|
| 1594 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1595 | + |
---|
| 1596 | + } |
---|
| 1597 | + |
---|
| 1598 | + centralPanel.add(cameraView); |
---|
| 1599 | + centralPanel.setFocusable(true); |
---|
| 1600 | + //frame.setJMenuBar(timelineMenubar); |
---|
| 1601 | + //centralPanel.add(timelinePanel); |
---|
| 1602 | + |
---|
1165 | 1603 | //topView.camera = ; |
---|
1166 | 1604 | //frontView.camera = new Camera(2); |
---|
1167 | 1605 | //sideView.camera = new Camera(3); |
---|
.. | .. |
---|
1177 | 1615 | //frontView.object = copy; |
---|
1178 | 1616 | //sideView.object = copy; |
---|
1179 | 1617 | |
---|
1180 | | - XYZPanel = new JPanel(); |
---|
1181 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1618 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1619 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1182 | 1620 | |
---|
1183 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1184 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1185 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1621 | + XYZPanel.preferredWidth = 5; |
---|
| 1622 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1623 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1624 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1625 | + //XYZPanel.setName("XYZ"); |
---|
1186 | 1626 | |
---|
1187 | 1627 | /* |
---|
1188 | 1628 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1191 | 1631 | gridPanel.add(cameraView); |
---|
1192 | 1632 | gridPanel.add(XYZPanel); |
---|
1193 | 1633 | */ |
---|
1194 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout()); |
---|
| 1634 | + gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1195 | 1635 | gridPanel.setContinuousLayout(true); |
---|
1196 | 1636 | gridPanel.setOneTouchExpandable(true); |
---|
1197 | 1637 | gridPanel.setDividerLocation(1.0); |
---|
.. | .. |
---|
1220 | 1660 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1221 | 1661 | //tmp.setName("Edit"); |
---|
1222 | 1662 | objectPanel.add(materialPanel); |
---|
1223 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1224 | | - north.setName("Edit"); |
---|
1225 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1226 | | - objectPanel.add(north); |
---|
1227 | | - objectPanel.add(infoPanel); |
---|
| 1663 | + objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1664 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1665 | + |
---|
| 1666 | + objectPanel.add(toolboxPanel); |
---|
| 1667 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1668 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
1228 | 1669 | |
---|
| 1670 | + objectPanel.add(skyboxPanel); |
---|
| 1671 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1672 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1673 | + |
---|
| 1674 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1675 | +// north.setName("Edit"); |
---|
| 1676 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1677 | +// objectPanel.add(north); |
---|
| 1678 | + objectPanel.add(editPanel); |
---|
| 1679 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1680 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
| 1681 | + |
---|
| 1682 | + objectPanel.add(XYZPanel); |
---|
| 1683 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1684 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
| 1685 | + |
---|
1229 | 1686 | /* |
---|
1230 | 1687 | aConstraints.gridx = 0; |
---|
1231 | 1688 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1233 | 1690 | aConstraints.gridy += 1; |
---|
1234 | 1691 | aConstraints.gridwidth = 1; |
---|
1235 | 1692 | mainPanel.add(objectPanel, aConstraints); |
---|
1236 | | - */ |
---|
| 1693 | + */ |
---|
1237 | 1694 | |
---|
1238 | 1695 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1239 | 1696 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1244 | 1701 | scrollpane.setWheelScrollingEnabled(true); |
---|
1245 | 1702 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1246 | 1703 | |
---|
1247 | | - /*JTabbedPane*/ jtp = new JTabbedPane(); |
---|
1248 | | - jtp.add(scrollpane); |
---|
| 1704 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1705 | + scenePanel.preferredWidth = 5; |
---|
| 1706 | + |
---|
| 1707 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1708 | + tabbedPane.add(scrollpane); |
---|
1249 | 1709 | |
---|
1250 | | - jtp.add(FSPane = new cFileSystemPane(this)); |
---|
1251 | | - |
---|
1252 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1710 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1253 | 1711 | |
---|
1254 | 1712 | optionsPanel.setName("Options"); |
---|
1255 | | - jtp.add(optionsPanel); |
---|
| 1713 | + |
---|
| 1714 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1715 | + |
---|
| 1716 | + tabbedPane.add(optionsPanel); |
---|
| 1717 | + |
---|
| 1718 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1256 | 1719 | |
---|
| 1720 | + scenePanel.add(tabbedPane); |
---|
1257 | 1721 | |
---|
| 1722 | + //if (Globals.ADVANCED) |
---|
| 1723 | +// tabbedPane.add(infoPanel); |
---|
| 1724 | +// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1725 | +// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1726 | + |
---|
1258 | 1727 | /* |
---|
1259 | 1728 | cTree jTree = new cTree(null); |
---|
1260 | 1729 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1275 | 1744 | jtp.add(tree); |
---|
1276 | 1745 | */ |
---|
1277 | 1746 | |
---|
1278 | | - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel); |
---|
| 1747 | + bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
1279 | 1748 | bigPanel.setContinuousLayout(true); |
---|
1280 | 1749 | bigPanel.setOneTouchExpandable(true); |
---|
1281 | 1750 | bigPanel.setDividerLocation(0.8); |
---|
.. | .. |
---|
1287 | 1756 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1288 | 1757 | //bigPanel.add(ctrlPanel); |
---|
1289 | 1758 | //bigPanel.add(gridPanel); |
---|
| 1759 | + /** |
---|
1290 | 1760 | bigThree = new JPanel(); |
---|
1291 | 1761 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1292 | 1762 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1297 | 1767 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1298 | 1768 | aWindowConstraints.weightx = 0; |
---|
1299 | 1769 | aWindowConstraints.weighty = 1; |
---|
1300 | | - bigThree.add(jtp, aWindowConstraints); |
---|
| 1770 | + bigThree.add(scenePanel, aWindowConstraints); |
---|
1301 | 1771 | aWindowConstraints.weightx = 1; |
---|
1302 | 1772 | aWindowConstraints.gridwidth = 3; |
---|
1303 | 1773 | // aConstraints.gridheight = 3; |
---|
1304 | 1774 | aWindowConstraints.gridx = 1; |
---|
1305 | 1775 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
1306 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 1776 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
1307 | 1777 | aWindowConstraints.weightx = 0; |
---|
1308 | 1778 | aWindowConstraints.gridx = 4; |
---|
1309 | 1779 | aWindowConstraints.gridwidth = 1; |
---|
1310 | 1780 | // aConstraints.gridheight = 3; |
---|
1311 | 1781 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1312 | 1782 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1783 | + /**/ |
---|
1313 | 1784 | |
---|
| 1785 | + bigThree = new cGridBag(); |
---|
| 1786 | + bigThree.addComponent(scenePanel); |
---|
| 1787 | + bigThree.addComponent(centralPanel); |
---|
| 1788 | + //bigThree.addComponent(XYZPanel); |
---|
| 1789 | + |
---|
1314 | 1790 | // // SIDE EFFECT!!! |
---|
1315 | 1791 | // aConstraints.gridx = 0; |
---|
1316 | 1792 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1318 | 1794 | // aConstraints.gridheight = 1; |
---|
1319 | 1795 | |
---|
1320 | 1796 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1321 | | - framePanel.setContinuousLayout(true); |
---|
1322 | | - framePanel.setOneTouchExpandable(true); |
---|
1323 | | - framePanel.setDividerLocation(0.8); |
---|
| 1797 | + |
---|
| 1798 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1799 | + new java.beans.PropertyChangeListener() |
---|
| 1800 | + { |
---|
| 1801 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1802 | + { |
---|
| 1803 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1804 | + { |
---|
| 1805 | + if (radio.layout != expandedLayout) |
---|
| 1806 | + { |
---|
| 1807 | + radio.layout = expandedLayout; |
---|
| 1808 | + radio.layout.doClick(); |
---|
| 1809 | + } |
---|
| 1810 | + } |
---|
| 1811 | + } |
---|
| 1812 | + }); |
---|
| 1813 | + |
---|
| 1814 | + framePanel.setContinuousLayout(false); |
---|
| 1815 | + framePanel.setOneTouchExpandable(false); |
---|
| 1816 | + //.setDividerLocation(0.8); |
---|
1324 | 1817 | //framePanel.setDividerSize(15); |
---|
1325 | 1818 | //framePanel.setResizeWeight(0.15); |
---|
1326 | 1819 | framePanel.setName("Frame"); |
---|
1327 | 1820 | |
---|
1328 | 1821 | frame.getContentPane().setLayout(new BorderLayout()); |
---|
1329 | 1822 | /**/ |
---|
1330 | | - JTabbedPane worldPane = new JTabbedPane(); |
---|
| 1823 | + //JTabbedPane worldPane = new JTabbedPane(); |
---|
1331 | 1824 | //worldPane.add(bigPanel); |
---|
1332 | 1825 | //worldPane.add(worldPanel); |
---|
1333 | 1826 | /**/ |
---|
1334 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1827 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1828 | + frame.add(/*"Center",*/framePanel); |
---|
1335 | 1829 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1336 | 1830 | |
---|
1337 | | -// aConstraints = gbc; // (GridBagConstraints) GraphreeD.clone(gbc); |
---|
| 1831 | +// aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1338 | 1832 | |
---|
1339 | | - frame.setSize(1024, 768); |
---|
1340 | | - frame.show(); |
---|
1341 | | - |
---|
| 1833 | + frame.setSize(1280, 860); |
---|
| 1834 | + |
---|
| 1835 | + cameraView.requestFocusInWindow(); |
---|
| 1836 | + |
---|
1342 | 1837 | gridPanel.setDividerLocation(1.0); |
---|
| 1838 | + |
---|
| 1839 | + frame.validate(); |
---|
| 1840 | + |
---|
| 1841 | + frame.setVisible(true); |
---|
1343 | 1842 | |
---|
1344 | 1843 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1345 | 1844 | frame.addWindowListener(new WindowAdapter() |
---|
1346 | 1845 | { |
---|
1347 | | - |
---|
1348 | 1846 | public void windowClosing(WindowEvent e) |
---|
1349 | 1847 | { |
---|
1350 | 1848 | Close(); |
---|
.. | .. |
---|
1352 | 1850 | }); |
---|
1353 | 1851 | } |
---|
1354 | 1852 | |
---|
| 1853 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1854 | + { |
---|
| 1855 | + } |
---|
| 1856 | + |
---|
1355 | 1857 | JTree GetTree() |
---|
1356 | 1858 | { |
---|
1357 | 1859 | return objEditor.jTree; |
---|
.. | .. |
---|
1363 | 1865 | ctrlPanel.removeAll(); |
---|
1364 | 1866 | } |
---|
1365 | 1867 | |
---|
1366 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1868 | + void SetupMaterial(cGridBag materialpanel) |
---|
1367 | 1869 | { |
---|
1368 | | - aConstraints.weighty = 0; |
---|
1369 | | - //aConstraints.weightx = 1; |
---|
1370 | | - /* |
---|
| 1870 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1871 | + |
---|
| 1872 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1873 | + skin.setToolTipText("Skin"); |
---|
| 1874 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1875 | + { |
---|
| 1876 | + public void mouseClicked(MouseEvent e) |
---|
| 1877 | + { |
---|
| 1878 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1879 | + cMaterial material = object.material; |
---|
| 1880 | + |
---|
| 1881 | + // Skin |
---|
| 1882 | + colorField.setFloat(material.color); |
---|
| 1883 | + saturationField.setFloat(material.modulation); |
---|
| 1884 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1885 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1886 | + diffusenessField.setFloat(material.factor); |
---|
| 1887 | + shininessField.setFloat(material.shininess); |
---|
| 1888 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1889 | + diffuseField.setFloat(material.diffuse); |
---|
| 1890 | + specularField.setFloat(material.specular); |
---|
| 1891 | + |
---|
| 1892 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1893 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1894 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1895 | + |
---|
| 1896 | + materialtouched = true; |
---|
| 1897 | + applySelf(); |
---|
| 1898 | + } |
---|
| 1899 | + }); |
---|
| 1900 | + presetpanel.add(skin); |
---|
| 1901 | + |
---|
| 1902 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1903 | + lambert.setToolTipText("Diffuse"); |
---|
| 1904 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1905 | + { |
---|
| 1906 | + public void mouseClicked(MouseEvent e) |
---|
| 1907 | + { |
---|
| 1908 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1909 | + cMaterial material = object.material; |
---|
| 1910 | + |
---|
| 1911 | + diffusenessField.setFloat(material.factor); |
---|
| 1912 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1913 | + |
---|
| 1914 | + materialtouched = true; |
---|
| 1915 | + applySelf(); |
---|
| 1916 | + } |
---|
| 1917 | + }); |
---|
| 1918 | + presetpanel.add(lambert); |
---|
| 1919 | + |
---|
| 1920 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1921 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1922 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1923 | + { |
---|
| 1924 | + public void mouseClicked(MouseEvent e) |
---|
| 1925 | + { |
---|
| 1926 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1927 | + cMaterial material = object.material; |
---|
| 1928 | + |
---|
| 1929 | + diffusenessField.setFloat(material.factor); |
---|
| 1930 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1931 | + |
---|
| 1932 | + materialtouched = true; |
---|
| 1933 | + applySelf(); |
---|
| 1934 | + } |
---|
| 1935 | + }); |
---|
| 1936 | + presetpanel.add(diffuse2); |
---|
| 1937 | + |
---|
| 1938 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1939 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1940 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1941 | + { |
---|
| 1942 | + public void mouseClicked(MouseEvent e) |
---|
| 1943 | + { |
---|
| 1944 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1945 | + cMaterial material = object.material; |
---|
| 1946 | + |
---|
| 1947 | + diffusenessField.setFloat(material.factor); |
---|
| 1948 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1949 | + |
---|
| 1950 | + materialtouched = true; |
---|
| 1951 | + applySelf(); |
---|
| 1952 | + } |
---|
| 1953 | + }); |
---|
| 1954 | + presetpanel.add(diffusemoon); |
---|
| 1955 | + |
---|
| 1956 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1957 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1958 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1959 | + { |
---|
| 1960 | + public void mouseClicked(MouseEvent e) |
---|
| 1961 | + { |
---|
| 1962 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1963 | + cMaterial material = object.material; |
---|
| 1964 | + |
---|
| 1965 | + diffusenessField.setFloat(material.factor); |
---|
| 1966 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1967 | + |
---|
| 1968 | + materialtouched = true; |
---|
| 1969 | + applySelf(); |
---|
| 1970 | + } |
---|
| 1971 | + }); |
---|
| 1972 | + presetpanel.add(diffusemoon2); |
---|
| 1973 | + |
---|
| 1974 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1975 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1976 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1977 | + { |
---|
| 1978 | + public void mouseClicked(MouseEvent e) |
---|
| 1979 | + { |
---|
| 1980 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1981 | + cMaterial material = object.material; |
---|
| 1982 | + |
---|
| 1983 | + diffusenessField.setFloat(material.factor); |
---|
| 1984 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1985 | + |
---|
| 1986 | + materialtouched = true; |
---|
| 1987 | + applySelf(); |
---|
| 1988 | + } |
---|
| 1989 | + }); |
---|
| 1990 | + presetpanel.add(diffusemoon3); |
---|
| 1991 | + |
---|
| 1992 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1993 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 1994 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 1995 | + { |
---|
| 1996 | + public void mouseClicked(MouseEvent e) |
---|
| 1997 | + { |
---|
| 1998 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 1999 | + cMaterial material = object.material; |
---|
| 2000 | + |
---|
| 2001 | + sheenField.setFloat(material.sheen); |
---|
| 2002 | + |
---|
| 2003 | + materialtouched = true; |
---|
| 2004 | + applySelf(); |
---|
| 2005 | + } |
---|
| 2006 | + }); |
---|
| 2007 | + presetpanel.add(diffusesheen); |
---|
| 2008 | + |
---|
| 2009 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2010 | + rough.setToolTipText("Rough metal"); |
---|
| 2011 | + rough.addMouseListener(new MouseAdapter() |
---|
| 2012 | + { |
---|
| 2013 | + public void mouseClicked(MouseEvent e) |
---|
| 2014 | + { |
---|
| 2015 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 2016 | + cMaterial material = object.material; |
---|
| 2017 | + |
---|
| 2018 | + shininessField.setFloat(material.shininess); |
---|
| 2019 | + velvetField.setFloat(material.velvet); |
---|
| 2020 | + |
---|
| 2021 | + materialtouched = true; |
---|
| 2022 | + applySelf(); |
---|
| 2023 | + } |
---|
| 2024 | + }); |
---|
| 2025 | + presetpanel.add(rough); |
---|
| 2026 | + |
---|
| 2027 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2028 | + rough2.setToolTipText("Medium metal"); |
---|
| 2029 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 2030 | + { |
---|
| 2031 | + public void mouseClicked(MouseEvent e) |
---|
| 2032 | + { |
---|
| 2033 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 2034 | + cMaterial material = object.material; |
---|
| 2035 | + |
---|
| 2036 | + shininessField.setFloat(material.shininess); |
---|
| 2037 | + lightareaField.setFloat(material.lightarea); |
---|
| 2038 | + |
---|
| 2039 | + materialtouched = true; |
---|
| 2040 | + applySelf(); |
---|
| 2041 | + } |
---|
| 2042 | + }); |
---|
| 2043 | + presetpanel.add(rough2); |
---|
| 2044 | + |
---|
| 2045 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2046 | + shini0.setToolTipText("Shiny"); |
---|
| 2047 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 2048 | + { |
---|
| 2049 | + public void mouseClicked(MouseEvent e) |
---|
| 2050 | + { |
---|
| 2051 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 2052 | + cMaterial material = object.material; |
---|
| 2053 | + |
---|
| 2054 | + shininessField.setFloat(material.shininess); |
---|
| 2055 | + lightareaField.setFloat(material.lightarea); |
---|
| 2056 | + |
---|
| 2057 | + materialtouched = true; |
---|
| 2058 | + applySelf(); |
---|
| 2059 | + } |
---|
| 2060 | + }); |
---|
| 2061 | + presetpanel.add(shini0); |
---|
| 2062 | + |
---|
| 2063 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2064 | + shini1.setToolTipText("Shiny2"); |
---|
| 2065 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 2066 | + { |
---|
| 2067 | + public void mouseClicked(MouseEvent e) |
---|
| 2068 | + { |
---|
| 2069 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 2070 | + cMaterial material = object.material; |
---|
| 2071 | + |
---|
| 2072 | + shininessField.setFloat(material.shininess); |
---|
| 2073 | + lightareaField.setFloat(material.lightarea); |
---|
| 2074 | + |
---|
| 2075 | + materialtouched = true; |
---|
| 2076 | + applySelf(); |
---|
| 2077 | + } |
---|
| 2078 | + }); |
---|
| 2079 | + presetpanel.add(shini1); |
---|
| 2080 | + |
---|
| 2081 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2082 | + shini2.setToolTipText("Shiny3"); |
---|
| 2083 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2084 | + { |
---|
| 2085 | + public void mouseClicked(MouseEvent e) |
---|
| 2086 | + { |
---|
| 2087 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2088 | + cMaterial material = object.material; |
---|
| 2089 | + |
---|
| 2090 | + shininessField.setFloat(material.shininess); |
---|
| 2091 | + lightareaField.setFloat(material.lightarea); |
---|
| 2092 | + |
---|
| 2093 | + materialtouched = true; |
---|
| 2094 | + applySelf(); |
---|
| 2095 | + } |
---|
| 2096 | + }); |
---|
| 2097 | + presetpanel.add(shini2); |
---|
| 2098 | + |
---|
| 2099 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2100 | + aniso.setToolTipText("AnisoU"); |
---|
| 2101 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2102 | + { |
---|
| 2103 | + public void mouseClicked(MouseEvent e) |
---|
| 2104 | + { |
---|
| 2105 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2106 | + cMaterial material = object.material; |
---|
| 2107 | + |
---|
| 2108 | + anisoField.setFloat(material.aniso); |
---|
| 2109 | + anisoVField.setFloat(material.anisoV); |
---|
| 2110 | + |
---|
| 2111 | + materialtouched = true; |
---|
| 2112 | + applySelf(); |
---|
| 2113 | + } |
---|
| 2114 | + }); |
---|
| 2115 | + presetpanel.add(aniso); |
---|
| 2116 | + |
---|
| 2117 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2118 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2119 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2120 | + { |
---|
| 2121 | + public void mouseClicked(MouseEvent e) |
---|
| 2122 | + { |
---|
| 2123 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2124 | + cMaterial material = object.material; |
---|
| 2125 | + |
---|
| 2126 | + anisoField.setFloat(material.aniso); |
---|
| 2127 | + anisoVField.setFloat(material.anisoV); |
---|
| 2128 | + |
---|
| 2129 | + materialtouched = true; |
---|
| 2130 | + applySelf(); |
---|
| 2131 | + } |
---|
| 2132 | + }); |
---|
| 2133 | + presetpanel.add(aniso2); |
---|
| 2134 | + |
---|
| 2135 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2136 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2137 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2138 | + { |
---|
| 2139 | + public void mouseClicked(MouseEvent e) |
---|
| 2140 | + { |
---|
| 2141 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2142 | + cMaterial material = object.material; |
---|
| 2143 | + |
---|
| 2144 | + anisoField.setFloat(material.aniso); |
---|
| 2145 | + anisoVField.setFloat(material.anisoV); |
---|
| 2146 | + |
---|
| 2147 | + materialtouched = true; |
---|
| 2148 | + applySelf(); |
---|
| 2149 | + } |
---|
| 2150 | + }); |
---|
| 2151 | + presetpanel.add(aniso3); |
---|
| 2152 | + |
---|
| 2153 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2154 | + velvet0.setToolTipText("Velvet"); |
---|
| 2155 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2156 | + { |
---|
| 2157 | + public void mouseClicked(MouseEvent e) |
---|
| 2158 | + { |
---|
| 2159 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2160 | + cMaterial material = object.material; |
---|
| 2161 | + |
---|
| 2162 | + diffusenessField.setFloat(material.factor); |
---|
| 2163 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2164 | + sheenField.setFloat(material.sheen); |
---|
| 2165 | + shininessField.setFloat(material.shininess); |
---|
| 2166 | + velvetField.setFloat(material.velvet); |
---|
| 2167 | + shiftField.setFloat(material.shift); |
---|
| 2168 | + |
---|
| 2169 | + materialtouched = true; |
---|
| 2170 | + applySelf(); |
---|
| 2171 | + } |
---|
| 2172 | + }); |
---|
| 2173 | + presetpanel.add(velvet0); |
---|
| 2174 | + |
---|
| 2175 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2176 | + bump0.setToolTipText("Bump texture"); |
---|
| 2177 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2178 | + { |
---|
| 2179 | + public void mouseClicked(MouseEvent e) |
---|
| 2180 | + { |
---|
| 2181 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2182 | + cMaterial material = object.material; |
---|
| 2183 | + |
---|
| 2184 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2185 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2186 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2187 | + |
---|
| 2188 | + materialtouched = true; |
---|
| 2189 | + applySelf(); |
---|
| 2190 | + } |
---|
| 2191 | + }); |
---|
| 2192 | + presetpanel.add(bump0); |
---|
| 2193 | + |
---|
| 2194 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF); |
---|
| 2195 | + borderShader.setToolTipText("Border fade"); |
---|
| 2196 | + borderShader.addMouseListener(new MouseAdapter() |
---|
| 2197 | + { |
---|
| 2198 | + public void mouseClicked(MouseEvent e) |
---|
| 2199 | + { |
---|
| 2200 | + borderfadeField.setFloat(0.5); |
---|
| 2201 | + opacityField.setFloat(0.75); |
---|
| 2202 | + |
---|
| 2203 | + materialtouched = true; |
---|
| 2204 | + applySelf(); |
---|
| 2205 | + } |
---|
| 2206 | + }); |
---|
| 2207 | + presetpanel.add(borderShader); |
---|
| 2208 | + |
---|
| 2209 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2210 | + halo.setToolTipText("Halo"); |
---|
| 2211 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2212 | + { |
---|
| 2213 | + public void mouseClicked(MouseEvent e) |
---|
| 2214 | + { |
---|
| 2215 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2216 | + cMaterial material = object.material; |
---|
| 2217 | + |
---|
| 2218 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2219 | + |
---|
| 2220 | + materialtouched = true; |
---|
| 2221 | + applySelf(); |
---|
| 2222 | + } |
---|
| 2223 | + }); |
---|
| 2224 | + presetpanel.add(halo); |
---|
| 2225 | + |
---|
| 2226 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2227 | + candle.setToolTipText("Candle"); |
---|
| 2228 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2229 | + { |
---|
| 2230 | + public void mouseClicked(MouseEvent e) |
---|
| 2231 | + { |
---|
| 2232 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2233 | + cMaterial material = object.material; |
---|
| 2234 | + |
---|
| 2235 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2236 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2237 | + ambientField.setFloat(material.ambient); |
---|
| 2238 | + specularField.setFloat(material.specular); |
---|
| 2239 | + lightareaField.setFloat(material.lightarea); |
---|
| 2240 | + shininessField.setFloat(material.shininess); |
---|
| 2241 | + |
---|
| 2242 | + materialtouched = true; |
---|
| 2243 | + applySelf(); |
---|
| 2244 | + } |
---|
| 2245 | + }); |
---|
| 2246 | + presetpanel.add(candle); |
---|
| 2247 | + |
---|
| 2248 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2249 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2250 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2251 | + { |
---|
| 2252 | + public void mouseClicked(MouseEvent e) |
---|
| 2253 | + { |
---|
| 2254 | + diffuseField.setFloat(0.001); |
---|
| 2255 | + ambientField.setFloat(0.001); |
---|
| 2256 | + cameraField.setFloat(0.001); |
---|
| 2257 | + specularField.setFloat(0.001); |
---|
| 2258 | + fakedepthField.setFloat(0.001); |
---|
| 2259 | + opacityField.setFloat(0.6); |
---|
| 2260 | + |
---|
| 2261 | + materialtouched = true; |
---|
| 2262 | + applySelf(); |
---|
| 2263 | + } |
---|
| 2264 | + }); |
---|
| 2265 | + presetpanel.add(shadowShader); |
---|
| 2266 | + |
---|
| 2267 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2268 | + |
---|
| 2269 | + presetpanel.preferredWidth = 1; |
---|
| 2270 | + |
---|
| 2271 | + materialpanel.add(presetpanel); |
---|
| 2272 | + materialpanel.add(panel); |
---|
| 2273 | + |
---|
| 2274 | + panel.preferredWidth = 8; |
---|
| 2275 | + |
---|
| 2276 | + /* |
---|
1371 | 2277 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1372 | 2278 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1373 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1374 | | - aConstraints.gridx += 1; |
---|
1375 | | - */ |
---|
| 2279 | + */ |
---|
1376 | 2280 | |
---|
1377 | | - aConstraints.gridwidth = 1; |
---|
1378 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1379 | | - aConstraints.gridx += 1; |
---|
1380 | | - aConstraints.weighty = 0; |
---|
1381 | | - aConstraints.gridwidth = 1; |
---|
| 2281 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 2282 | + |
---|
| 2283 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2284 | + createMaterialButton.setToolTipText("Create material"); |
---|
1382 | 2285 | |
---|
1383 | 2286 | /* |
---|
1384 | 2287 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1385 | | - aConstraints.gridx += 1; |
---|
1386 | | - aConstraints.weighty = 0; |
---|
1387 | | - aConstraints.gridwidth = 1; |
---|
1388 | 2288 | */ |
---|
1389 | 2289 | |
---|
1390 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1391 | | - aConstraints.gridx += 1; |
---|
| 2290 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2291 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 2292 | + |
---|
| 2293 | + if (Globals.ADVANCED) |
---|
| 2294 | + { |
---|
| 2295 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2296 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 2297 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 2298 | + } |
---|
1392 | 2299 | |
---|
1393 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1394 | | - |
---|
1395 | | - aConstraints.gridx += 1; |
---|
1396 | | - |
---|
1397 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1398 | | - |
---|
1399 | | - aConstraints.gridx += 1; |
---|
1400 | | - |
---|
1401 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1402 | | - |
---|
1403 | | - aConstraints.gridx = 0; |
---|
1404 | | - aConstraints.gridy += 1; |
---|
1405 | | - aConstraints.weighty = 0; |
---|
1406 | | - aConstraints.gridwidth = 1; |
---|
| 2300 | + editBar.preferredHeight = 15; |
---|
| 2301 | + |
---|
| 2302 | + panel.add(editBar); |
---|
| 2303 | + |
---|
1407 | 2304 | /**/ |
---|
1408 | 2305 | //aConstraints.weighty = 0; |
---|
1409 | 2306 | ////aConstraints.weightx = 1; |
---|
1410 | 2307 | //aConstraints.weighty = 1; |
---|
1411 | 2308 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1412 | 2309 | //aConstraints.gridx += 1; |
---|
1413 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1414 | | - aConstraints.weighty = 0; |
---|
1415 | | - aConstraints.gridx = 0; |
---|
1416 | | - aConstraints.gridy += 1; |
---|
1417 | | - aConstraints.gridwidth = 1; |
---|
| 2310 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1418 | 2311 | |
---|
1419 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1420 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1421 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1422 | | - aConstraints.gridx += 1; |
---|
1423 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1424 | | - //aConstraints.weightx = 0; |
---|
1425 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1426 | | - aConstraints.gridx = 0; |
---|
1427 | | - aConstraints.gridy += 1; |
---|
1428 | | - aConstraints.gridwidth = 1; |
---|
| 2312 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
1429 | 2313 | |
---|
1430 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1431 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1432 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1433 | | - aConstraints.gridx += 1; |
---|
1434 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1435 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1436 | | - aConstraints.gridx = 0; |
---|
1437 | | - aConstraints.gridy += 1; |
---|
1438 | | - aConstraints.gridwidth = 1; |
---|
| 2314 | + cGridBag huepanel = new cGridBag(); |
---|
| 2315 | + cGridBag huelabel = new cGridBag(); |
---|
| 2316 | + cLabel hue = GetLabel("icons/hue.png", false); |
---|
| 2317 | + hue.fit = true; |
---|
| 2318 | + |
---|
| 2319 | + hue.addMouseListener(new MouseAdapter() |
---|
| 2320 | + { |
---|
| 2321 | + public void mousePressed(MouseEvent e) |
---|
| 2322 | + { |
---|
| 2323 | + int x = e.getX(); |
---|
| 2324 | + |
---|
| 2325 | + colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth()); |
---|
| 2326 | + } |
---|
| 2327 | + }); |
---|
| 2328 | + |
---|
| 2329 | + huelabel.add(hue); |
---|
| 2330 | + huelabel.preferredWidth = 20; |
---|
| 2331 | + huepanel.add(new cGridBag()); // Label |
---|
| 2332 | + huepanel.add(huelabel); // Field/slider |
---|
| 2333 | + |
---|
| 2334 | + huepanel.preferredHeight = 7; |
---|
1439 | 2335 | |
---|
1440 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1441 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1442 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1443 | | - aConstraints.gridx += 1; |
---|
1444 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1445 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1446 | | - aConstraints.gridx = 0; |
---|
1447 | | - aConstraints.gridy += 1; |
---|
1448 | | - aConstraints.gridwidth = 1; |
---|
| 2336 | + colorSection.add(huepanel); |
---|
| 2337 | + |
---|
| 2338 | + cGridBag color = new cGridBag(); |
---|
| 2339 | + |
---|
| 2340 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2341 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2342 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1449 | 2343 | |
---|
1450 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1451 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1452 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1453 | | - aConstraints.gridx += 1; |
---|
1454 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1455 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1456 | | - aConstraints.gridx = 0; |
---|
1457 | | - aConstraints.gridy += 1; |
---|
1458 | | - aConstraints.gridwidth = 1; |
---|
| 2344 | + //colorField.preferredWidth = 200; |
---|
| 2345 | + colorSection.add(color); |
---|
1459 | 2346 | |
---|
1460 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1461 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1462 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1463 | | - aConstraints.gridx += 1; |
---|
1464 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1465 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1466 | | - aConstraints.gridx = 0; |
---|
1467 | | - aConstraints.gridy += 1; |
---|
1468 | | - aConstraints.gridwidth = 1; |
---|
| 2347 | + cGridBag modulation = new cGridBag(); |
---|
| 2348 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 2349 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2350 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2351 | + colorSection.add(modulation); |
---|
1469 | 2352 | |
---|
1470 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1471 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1472 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1473 | | - aConstraints.gridx += 1; |
---|
1474 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1475 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1476 | | - aConstraints.gridx = 0; |
---|
1477 | | - aConstraints.gridy += 1; |
---|
1478 | | - aConstraints.gridwidth = 1; |
---|
| 2353 | + cGridBag opacity = new cGridBag(); |
---|
| 2354 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2355 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2356 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2357 | + colorSection.add(opacity); |
---|
1479 | 2358 | |
---|
1480 | | - //aConstraints.weighty = 1; |
---|
1481 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1482 | | - //aConstraints.gridx += 1; |
---|
1483 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1484 | | - aConstraints.weighty = 0; |
---|
1485 | | - aConstraints.gridx = 0; |
---|
1486 | | - aConstraints.gridy += 1; |
---|
1487 | | - aConstraints.gridwidth = 1; |
---|
| 2359 | + colorSection.add(GetSeparator()); |
---|
| 2360 | + |
---|
| 2361 | + cGridBag texture = new cGridBag(); |
---|
| 2362 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 2363 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2364 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2365 | + colorSection.add(texture); |
---|
1488 | 2366 | |
---|
1489 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1490 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1491 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1492 | | - aConstraints.gridx += 1; |
---|
1493 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1494 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1495 | | - aConstraints.gridx = 0; |
---|
1496 | | - aConstraints.gridy += 1; |
---|
1497 | | - aConstraints.gridwidth = 1; |
---|
| 2367 | + panel.add(GetSeparator()); |
---|
| 2368 | + |
---|
| 2369 | + panel.add(colorSection); |
---|
| 2370 | + |
---|
| 2371 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2372 | + |
---|
| 2373 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 2374 | + |
---|
| 2375 | + cGridBag diffuse = new cGridBag(); |
---|
| 2376 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 2377 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2378 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2379 | + diffuseSection.add(diffuse); |
---|
1498 | 2380 | |
---|
1499 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1500 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1501 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1502 | | - aConstraints.gridx += 1; |
---|
1503 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1504 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1505 | | - aConstraints.gridx = 0; |
---|
1506 | | - aConstraints.gridy += 1; |
---|
1507 | | - aConstraints.gridwidth = 1; |
---|
| 2381 | + cGridBag diffuseness = new cGridBag(); |
---|
| 2382 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 2383 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2384 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2385 | + diffuseSection.add(diffuseness); |
---|
1508 | 2386 | |
---|
1509 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1510 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1511 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1512 | | - aConstraints.gridx += 1; |
---|
1513 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1514 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1515 | | - aConstraints.gridx = 0; |
---|
1516 | | - aConstraints.gridy += 1; |
---|
1517 | | - aConstraints.gridwidth = 1; |
---|
| 2387 | + cGridBag selfshadow = new cGridBag(); |
---|
| 2388 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 2389 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2390 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2391 | + diffuseSection.add(selfshadow); |
---|
1518 | 2392 | |
---|
1519 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1520 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1521 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1522 | | - aConstraints.gridx += 1; |
---|
1523 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1524 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1525 | | - aConstraints.gridx = 0; |
---|
1526 | | - aConstraints.gridy += 1; |
---|
1527 | | - aConstraints.gridwidth = 1; |
---|
| 2393 | + cGridBag sheen = new cGridBag(); |
---|
| 2394 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 2395 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2396 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2397 | + diffuseSection.add(sheen); |
---|
1528 | 2398 | |
---|
1529 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1530 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1531 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1532 | | - aConstraints.gridx += 1; |
---|
1533 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1534 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1535 | | - aConstraints.gridx = 0; |
---|
1536 | | - aConstraints.gridy += 1; |
---|
1537 | | - aConstraints.gridwidth = 1; |
---|
| 2399 | + cGridBag subsurface = new cGridBag(); |
---|
| 2400 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 2401 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2402 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2403 | + diffuseSection.add(subsurface); |
---|
1538 | 2404 | |
---|
1539 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1540 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1541 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1542 | | - aConstraints.gridx += 1; |
---|
1543 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1544 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1545 | | - aConstraints.gridx = 0; |
---|
1546 | | - aConstraints.gridy += 1; |
---|
1547 | | - aConstraints.gridwidth = 1; |
---|
| 2405 | + cGridBag shadow = new cGridBag(); |
---|
| 2406 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 2407 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2408 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2409 | + diffuseSection.add(shadow); |
---|
1548 | 2410 | |
---|
1549 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1550 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1551 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1552 | | - aConstraints.gridx += 1; |
---|
1553 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1554 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1555 | | - aConstraints.gridx = 0; |
---|
1556 | | - aConstraints.gridy += 1; |
---|
1557 | | - aConstraints.gridwidth = 1; |
---|
| 2411 | + cGridBag fakedepth = new cGridBag(); |
---|
| 2412 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 2413 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2414 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2415 | + diffuseSection.add(fakedepth); |
---|
1558 | 2416 | |
---|
1559 | | - //aConstraints.weighty = 1; |
---|
1560 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1561 | | - //aConstraints.gridx += 1; |
---|
1562 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1563 | | - aConstraints.weighty = 0; |
---|
1564 | | - aConstraints.gridx = 0; |
---|
1565 | | - aConstraints.gridy += 1; |
---|
1566 | | - aConstraints.gridwidth = 1; |
---|
| 2417 | + cGridBag shadowbias = new cGridBag(); |
---|
| 2418 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 2419 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2420 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2421 | + diffuseSection.add(shadowbias); |
---|
1567 | 2422 | |
---|
1568 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1569 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1570 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1571 | | - aConstraints.gridx += 1; |
---|
1572 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1573 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1574 | | - aConstraints.gridx = 0; |
---|
1575 | | - aConstraints.gridy += 1; |
---|
1576 | | - aConstraints.gridwidth = 1; |
---|
| 2423 | + panel.add(GetSeparator()); |
---|
| 2424 | + |
---|
| 2425 | + panel.add(diffuseSection); |
---|
| 2426 | + |
---|
| 2427 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2428 | + |
---|
| 2429 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1577 | 2430 | |
---|
1578 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1579 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1580 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1581 | | - aConstraints.gridx += 1; |
---|
1582 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1583 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1584 | | - aConstraints.gridx = 0; |
---|
1585 | | - aConstraints.gridy += 1; |
---|
1586 | | - aConstraints.gridwidth = 1; |
---|
| 2431 | + cGridBag specular = new cGridBag(); |
---|
| 2432 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 2433 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2434 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2435 | + specularSection.add(specular); |
---|
1587 | 2436 | |
---|
1588 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1589 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1590 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1591 | | - aConstraints.gridx += 1; |
---|
1592 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1593 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1594 | | - aConstraints.gridx = 0; |
---|
1595 | | - aConstraints.gridy += 1; |
---|
1596 | | - aConstraints.gridwidth = 1; |
---|
| 2437 | + cGridBag lightarea = new cGridBag(); |
---|
| 2438 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 2439 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2440 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2441 | + specularSection.add(lightarea); |
---|
1597 | 2442 | |
---|
1598 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1599 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1600 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1601 | | - aConstraints.gridx += 1; |
---|
1602 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1603 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1604 | | - aConstraints.gridx = 0; |
---|
1605 | | - aConstraints.gridy += 1; |
---|
1606 | | - aConstraints.gridwidth = 1; |
---|
| 2443 | + cGridBag shininess = new cGridBag(); |
---|
| 2444 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 2445 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2446 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2447 | + specularSection.add(shininess); |
---|
1607 | 2448 | |
---|
1608 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1609 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1610 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1611 | | - aConstraints.gridx += 1; |
---|
1612 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1613 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1614 | | - aConstraints.gridx = 0; |
---|
1615 | | - aConstraints.gridy += 1; |
---|
1616 | | - aConstraints.gridwidth = 1; |
---|
| 2449 | + cGridBag metalness = new cGridBag(); |
---|
| 2450 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 2451 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2452 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2453 | + specularSection.add(metalness); |
---|
1617 | 2454 | |
---|
1618 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1619 | | - Return(); |
---|
| 2455 | + cGridBag velvet = new cGridBag(); |
---|
| 2456 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 2457 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2458 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2459 | + specularSection.add(velvet); |
---|
| 2460 | + |
---|
| 2461 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 2462 | + //Return(); |
---|
1620 | 2463 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1621 | 2464 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1622 | 2465 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1627 | 2470 | // aConstraints.gridy += 1; |
---|
1628 | 2471 | // aConstraints.gridwidth = 1; |
---|
1629 | 2472 | |
---|
1630 | | - //aConstraints.weighty = 1; |
---|
1631 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1632 | | - //aConstraints.gridx += 1; |
---|
1633 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1634 | | - aConstraints.weighty = 0; |
---|
1635 | | - aConstraints.gridx = 0; |
---|
1636 | | - aConstraints.gridy += 1; |
---|
1637 | | - aConstraints.gridwidth = 1; |
---|
| 2473 | + cGridBag anisoU = new cGridBag(); |
---|
| 2474 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 2475 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2476 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2477 | + specularSection.add(anisoU); |
---|
1638 | 2478 | |
---|
1639 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1640 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1641 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1642 | | - aConstraints.gridx += 1; |
---|
1643 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1644 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1645 | | - aConstraints.gridx = 0; |
---|
1646 | | - aConstraints.gridy += 1; |
---|
1647 | | - aConstraints.gridwidth = 1; |
---|
| 2479 | + cGridBag anisoV = new cGridBag(); |
---|
| 2480 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 2481 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2482 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2483 | + specularSection.add(anisoV); |
---|
1648 | 2484 | |
---|
1649 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1650 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1651 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1652 | | - aConstraints.gridx += 1; |
---|
1653 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1654 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1655 | | - aConstraints.gridx = 0; |
---|
1656 | | - aConstraints.gridy += 1; |
---|
1657 | | - aConstraints.gridwidth = 1; |
---|
1658 | 2485 | |
---|
1659 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1660 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1661 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1662 | | - aConstraints.gridx += 1; |
---|
1663 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1664 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1665 | | - aConstraints.gridx = 0; |
---|
1666 | | - aConstraints.gridy += 1; |
---|
1667 | | - aConstraints.gridwidth = 1; |
---|
| 2486 | + panel.add(GetSeparator()); |
---|
| 2487 | + |
---|
| 2488 | + panel.add(specularSection); |
---|
| 2489 | + |
---|
| 2490 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2491 | + |
---|
| 2492 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1668 | 2493 | |
---|
1669 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1670 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1671 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1672 | | - aConstraints.gridx += 1; |
---|
1673 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1674 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1675 | | - aConstraints.gridx = 0; |
---|
1676 | | - aConstraints.gridy += 1; |
---|
1677 | | - aConstraints.gridwidth = 1; |
---|
1678 | | - aConstraints.weighty = 0; |
---|
| 2494 | + cGridBag camera = new cGridBag(); |
---|
| 2495 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 2496 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2497 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2498 | + colorSection.add(camera); |
---|
1679 | 2499 | |
---|
1680 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1681 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1682 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1683 | | - aConstraints.gridx += 1; |
---|
1684 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1685 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1686 | | - aConstraints.gridx = 0; |
---|
1687 | | - aConstraints.gridy += 1; |
---|
1688 | | - aConstraints.gridwidth = 1; |
---|
| 2500 | + cGridBag ambient = new cGridBag(); |
---|
| 2501 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 2502 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2503 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2504 | + colorSection.add(ambient); |
---|
1689 | 2505 | |
---|
1690 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1691 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1692 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1693 | | - aConstraints.gridx += 1; |
---|
1694 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1695 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1696 | | - aConstraints.gridx = 0; |
---|
1697 | | - aConstraints.gridy += 1; |
---|
1698 | | - aConstraints.gridwidth = 1; |
---|
| 2506 | + cGridBag backlit = new cGridBag(); |
---|
| 2507 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 2508 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2509 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2510 | + colorSection.add(backlit); |
---|
1699 | 2511 | |
---|
1700 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1701 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1702 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1703 | | - aConstraints.gridx += 1; |
---|
1704 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1705 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1706 | | - aConstraints.gridx = 0; |
---|
1707 | | - aConstraints.gridy += 1; |
---|
1708 | | - aConstraints.gridwidth = 1; |
---|
| 2512 | + //panel.add(new JSeparator()); |
---|
| 2513 | + |
---|
| 2514 | + //panel.add(globalSection); |
---|
| 2515 | + |
---|
| 2516 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2517 | + |
---|
| 2518 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1709 | 2519 | |
---|
1710 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1711 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1712 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1713 | | - aConstraints.gridx += 1; |
---|
1714 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1715 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1716 | | - aConstraints.gridx = 0; |
---|
1717 | | - aConstraints.gridy += 1; |
---|
1718 | | - aConstraints.gridwidth = 1; |
---|
| 2520 | + cGridBag bump = new cGridBag(); |
---|
| 2521 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 2522 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2523 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2524 | + textureSection.add(bump); |
---|
1719 | 2525 | |
---|
1720 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1721 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1722 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1723 | | - aConstraints.gridx += 1; |
---|
1724 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1725 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1726 | | - aConstraints.gridx = 0; |
---|
1727 | | - aConstraints.gridy += 1; |
---|
1728 | | - aConstraints.gridwidth = 1; |
---|
| 2526 | + cGridBag noise = new cGridBag(); |
---|
| 2527 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 2528 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2529 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 2530 | + textureSection.add(noise); |
---|
1729 | 2531 | |
---|
1730 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1731 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1732 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1733 | | - aConstraints.gridx += 1; |
---|
1734 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1735 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1736 | | - aConstraints.gridx = 0; |
---|
1737 | | - aConstraints.gridy += 1; |
---|
1738 | | - aConstraints.gridwidth = 1; |
---|
| 2532 | + cGridBag power = new cGridBag(); |
---|
| 2533 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 2534 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2535 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 2536 | + textureSection.add(power); |
---|
1739 | 2537 | |
---|
1740 | | - //aConstraints.weighty = 1; |
---|
1741 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1742 | | - //aConstraints.gridx += 1; |
---|
1743 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1744 | | - aConstraints.weighty = 0; |
---|
| 2538 | + cGridBag borderfade = new cGridBag(); |
---|
| 2539 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 2540 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2541 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2542 | + textureSection.add(borderfade); |
---|
1745 | 2543 | |
---|
1746 | | - aConstraints.gridx = 0; |
---|
1747 | | - aConstraints.gridy = 0; |
---|
1748 | | - aConstraints.gridwidth = 1; |
---|
| 2544 | + cGridBag fog = new cGridBag(); |
---|
| 2545 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 2546 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2547 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 2548 | + textureSection.add(fog); |
---|
| 2549 | + |
---|
| 2550 | + cGridBag opacityPower = new cGridBag(); |
---|
| 2551 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 2552 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2553 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 2554 | + textureSection.add(opacityPower); |
---|
| 2555 | + |
---|
| 2556 | + panel.add(GetSeparator()); |
---|
| 2557 | + |
---|
| 2558 | + panel.add(textureSection); |
---|
| 2559 | + |
---|
| 2560 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1749 | 2561 | |
---|
1750 | 2562 | SetMaterial(copy); // .GetMaterial()); |
---|
1751 | 2563 | |
---|
1752 | | - colorField.addChangeListener(this); |
---|
1753 | | - modulationField.addChangeListener(this); |
---|
| 2564 | + //colorField.addChangeListener(this); |
---|
| 2565 | +// modulationField.addChangeListener(this); |
---|
1754 | 2566 | metalnessField.addChangeListener(this); |
---|
1755 | 2567 | diffuseField.addChangeListener(this); |
---|
1756 | 2568 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1780 | 2592 | opacityPowerField.addChangeListener(this); |
---|
1781 | 2593 | /**/ |
---|
1782 | 2594 | |
---|
1783 | | - resetSlidersButton.addActionListener(this); |
---|
1784 | 2595 | clearMaterialButton.addActionListener(this); |
---|
1785 | 2596 | createMaterialButton.addActionListener(this); |
---|
1786 | | - |
---|
1787 | | - propagateToggle.addItemListener(this); |
---|
1788 | | - multiplyToggle.addItemListener(this); |
---|
| 2597 | + |
---|
| 2598 | + if (Globals.ADVANCED) |
---|
| 2599 | + { |
---|
| 2600 | + resetSlidersButton.addActionListener(this); |
---|
| 2601 | + propagateToggle.addItemListener(this); |
---|
| 2602 | + multiplyToggle.addItemListener(this); |
---|
| 2603 | + } |
---|
1789 | 2604 | } |
---|
1790 | 2605 | |
---|
1791 | 2606 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1803 | 2618 | // 3D models |
---|
1804 | 2619 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1805 | 2620 | { |
---|
1806 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1807 | | - LoadFile(filename, lastConverter); |
---|
| 2621 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2622 | + //LoadFile(filename, lastConverter); |
---|
| 2623 | + LoadObjFile(filename); // New 3ds loader |
---|
1808 | 2624 | continue; |
---|
1809 | 2625 | } |
---|
1810 | 2626 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
1859 | 2675 | } |
---|
1860 | 2676 | |
---|
1861 | 2677 | // Images/textures |
---|
1862 | | - if (textures |
---|
1863 | | - && (filename.toLowerCase().endsWith(".jpg") |
---|
1864 | | - || filename.toLowerCase().endsWith(".jpeg") |
---|
1865 | | - || filename.toLowerCase().endsWith(".gif") |
---|
1866 | | - || filename.toLowerCase().endsWith(".png") |
---|
1867 | | - || filename.toLowerCase().endsWith(".tre") |
---|
1868 | | - || filename.toLowerCase().endsWith(".bmp") |
---|
1869 | | - || filename.toLowerCase().endsWith(".tga") |
---|
1870 | | - || filename.toLowerCase().endsWith(".sgi") |
---|
1871 | | - || filename.toLowerCase().endsWith(".tif") |
---|
1872 | | - || filename.toLowerCase().endsWith(".tiff"))) |
---|
| 2678 | + if (filename.toLowerCase().endsWith(".jpg") |
---|
| 2679 | + || filename.toLowerCase().endsWith(".jpeg") |
---|
| 2680 | + || filename.toLowerCase().endsWith(".gif") |
---|
| 2681 | + || filename.toLowerCase().endsWith(".png") |
---|
| 2682 | + || filename.toLowerCase().endsWith(".tre") |
---|
| 2683 | + || filename.toLowerCase().endsWith(".bmp") |
---|
| 2684 | + || filename.toLowerCase().endsWith(".tga") |
---|
| 2685 | + || filename.toLowerCase().endsWith(".sgi") |
---|
| 2686 | + || filename.toLowerCase().endsWith(".tif") |
---|
| 2687 | + || filename.toLowerCase().endsWith(".tiff")) |
---|
1873 | 2688 | { |
---|
1874 | | - DropTexture(filename); |
---|
| 2689 | + if (textures) |
---|
| 2690 | + DropTexture(filename); |
---|
| 2691 | + else |
---|
| 2692 | + CreateBillboard(filename); |
---|
1875 | 2693 | continue; |
---|
1876 | 2694 | } |
---|
1877 | 2695 | |
---|
.. | .. |
---|
1880 | 2698 | } |
---|
1881 | 2699 | |
---|
1882 | 2700 | ResetModel(); |
---|
| 2701 | + } |
---|
| 2702 | + |
---|
| 2703 | + void CreateBillboard(String filename) |
---|
| 2704 | + { |
---|
| 2705 | + Object3D source = null; |
---|
| 2706 | + Object3D group = copy; |
---|
| 2707 | + |
---|
| 2708 | + if (group.selection.size() > 0) |
---|
| 2709 | + { |
---|
| 2710 | + source = group.selection.get(0); |
---|
| 2711 | + } |
---|
| 2712 | + |
---|
| 2713 | + Grid grid = new Grid(1,1); |
---|
| 2714 | + grid.material = null; |
---|
| 2715 | + |
---|
| 2716 | + grid.toParent = LA.newMatrix(); |
---|
| 2717 | + grid.fromParent = LA.newMatrix(); |
---|
| 2718 | + LA.matYRotate(grid.toParent, Math.PI/2); |
---|
| 2719 | + LA.matXRotate(grid.toParent, -Math.PI/2); |
---|
| 2720 | + LA.matXRotate(grid.fromParent, Math.PI/2); |
---|
| 2721 | + LA.matYRotate(grid.fromParent, -Math.PI/2); |
---|
| 2722 | + |
---|
| 2723 | + BillboardNode bb = new BillboardNode(); |
---|
| 2724 | + bb.addChild(grid); |
---|
| 2725 | + |
---|
| 2726 | + Object3D newgroup = new Object3D(); |
---|
| 2727 | + newgroup.CreateMaterial(); |
---|
| 2728 | + |
---|
| 2729 | + File file = new File(filename); |
---|
| 2730 | + newgroup.name = file.getName(); |
---|
| 2731 | + newgroup.addChild(bb); |
---|
| 2732 | + |
---|
| 2733 | + Object3D main = newgroup; |
---|
| 2734 | + |
---|
| 2735 | + main.SetPigmentTexture(filename); |
---|
| 2736 | + |
---|
| 2737 | + if (source != null) |
---|
| 2738 | + { |
---|
| 2739 | + main.material = new cMaterial(source.material); |
---|
| 2740 | + if (main.projectedVertices.length < source.projectedVertices.length) |
---|
| 2741 | + { |
---|
| 2742 | + main.projectedVertices = new Object3D.cVector2[source.projectedVertices.length]; |
---|
| 2743 | + } |
---|
| 2744 | + |
---|
| 2745 | + for (int i=0; i<source.projectedVertices.length; i++) |
---|
| 2746 | + { |
---|
| 2747 | + main.projectedVertices[i].x = source.projectedVertices[i].x; |
---|
| 2748 | + main.projectedVertices[i].y = source.projectedVertices[i].y; |
---|
| 2749 | + } |
---|
| 2750 | + |
---|
| 2751 | + main.texres = source.texres; |
---|
| 2752 | + } |
---|
| 2753 | + |
---|
| 2754 | + makeSomething(newgroup, false); |
---|
1883 | 2755 | } |
---|
1884 | 2756 | |
---|
1885 | 2757 | Point location; |
---|
.. | .. |
---|
1900 | 2772 | |
---|
1901 | 2773 | //? flashIt = false; |
---|
1902 | 2774 | CameraPane pane = (CameraPane) cameraView; |
---|
1903 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2775 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1904 | 2776 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1905 | 2777 | |
---|
1906 | 2778 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1949 | 2821 | e2.printStackTrace(); |
---|
1950 | 2822 | } |
---|
1951 | 2823 | } |
---|
| 2824 | + |
---|
1952 | 2825 | LoadJMEThread loadThread; |
---|
1953 | 2826 | |
---|
1954 | 2827 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2006 | 2879 | //LoadFile0(filename, converter); |
---|
2007 | 2880 | } |
---|
2008 | 2881 | } |
---|
| 2882 | + |
---|
2009 | 2883 | LoadOBJThread loadObjThread; |
---|
2010 | 2884 | |
---|
2011 | 2885 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2084 | 2958 | |
---|
2085 | 2959 | void LoadObjFile(String fullname) |
---|
2086 | 2960 | { |
---|
2087 | | - /* |
---|
| 2961 | + System.out.println("Loading " + fullname); |
---|
| 2962 | + /**/ |
---|
2088 | 2963 | //lastFilename = fullname; |
---|
2089 | 2964 | if(loadObjThread == null) |
---|
2090 | 2965 | { |
---|
2091 | | - loadObjThread = new LoadOBJThread(); |
---|
2092 | | - loadObjThread.start(); |
---|
| 2966 | + loadObjThread = new LoadOBJThread(); |
---|
| 2967 | + loadObjThread.start(); |
---|
2093 | 2968 | } |
---|
2094 | 2969 | |
---|
2095 | 2970 | loadObjThread.add(fullname); |
---|
2096 | | - */ |
---|
| 2971 | + /**/ |
---|
2097 | 2972 | |
---|
2098 | | - System.out.println("Loading " + fullname); |
---|
2099 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2973 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2100 | 2974 | } |
---|
2101 | 2975 | |
---|
2102 | 2976 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2138 | 3012 | { |
---|
2139 | 3013 | Mocap sel = (Mocap) copy.selection.get(0); |
---|
2140 | 3014 | |
---|
| 3015 | + sel.SetCurrentBones(sel.frame); |
---|
| 3016 | + |
---|
2141 | 3017 | sel.fullname = fullname; |
---|
2142 | 3018 | |
---|
2143 | 3019 | if (changename) |
---|
.. | .. |
---|
2151 | 3027 | sel.smoothed = false; |
---|
2152 | 3028 | |
---|
2153 | 3029 | // if (!changename) |
---|
2154 | | - sel.SetPositionDelta(false, true, true, true/*?*/); // false |
---|
| 3030 | + //sel.SetPositionDelta(false, true, true, true/*?*/); // false |
---|
| 3031 | + sel.SetGlobalTransform(); |
---|
| 3032 | + sel.LoadData(); |
---|
| 3033 | + sel.Rewind(); |
---|
| 3034 | + sel.Fade(); |
---|
2155 | 3035 | // sel.setPose(0); |
---|
2156 | 3036 | refreshContents(); |
---|
2157 | 3037 | } else |
---|
2158 | 3038 | { |
---|
2159 | 3039 | mocap.Reset(); |
---|
2160 | 3040 | // new skeleton |
---|
2161 | | - makeSomething(mocap, false); // true); |
---|
| 3041 | + makeSomething(mocap, true); // true); |
---|
2162 | 3042 | } |
---|
2163 | 3043 | } catch (Exception e) |
---|
2164 | 3044 | { |
---|
.. | .. |
---|
2185 | 3065 | { |
---|
2186 | 3066 | Mocap sel = (Mocap) select; |
---|
2187 | 3067 | |
---|
| 3068 | + sel.SetCurrentBones(sel.frame); |
---|
| 3069 | + |
---|
2188 | 3070 | File file = new File(fullname); |
---|
2189 | 3071 | |
---|
2190 | 3072 | // Mocap mocap = new Mocap("Mocap" + file.getName()); |
---|
.. | .. |
---|
2251 | 3133 | |
---|
2252 | 3134 | if (!changename) |
---|
2253 | 3135 | { |
---|
2254 | | - sel.SetPositionDelta(false, true, true, true/*?*/); |
---|
| 3136 | + //sel.SetPositionDelta(false, true, true, true/*?*/); |
---|
| 3137 | + sel.SetGlobalTransform(); |
---|
| 3138 | + sel.LoadData(); |
---|
| 3139 | + sel.Rewind(); |
---|
| 3140 | + sel.Fade(); |
---|
2255 | 3141 | } |
---|
2256 | 3142 | |
---|
2257 | 3143 | // sel.setPose(0); |
---|
.. | .. |
---|
2345 | 3231 | |
---|
2346 | 3232 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2347 | 3233 | { |
---|
2348 | | - if (GraphreeD.standAlone) |
---|
| 3234 | + if (Grafreed.standAlone) |
---|
2349 | 3235 | { |
---|
2350 | 3236 | /**/ |
---|
2351 | 3237 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2352 | | - browser.show(); |
---|
| 3238 | + browser.setVisible(true); |
---|
2353 | 3239 | String filename = browser.getFile(); |
---|
2354 | 3240 | if (filename != null && filename.length() > 0) |
---|
2355 | 3241 | { |
---|
.. | .. |
---|
2460 | 3346 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2461 | 3347 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2462 | 3348 | } |
---|
| 3349 | + |
---|
2463 | 3350 | //cJME.count++; |
---|
2464 | 3351 | //cJME.count %= 12; |
---|
2465 | 3352 | if (gc) |
---|
.. | .. |
---|
2494 | 3381 | } |
---|
2495 | 3382 | if (input == null) |
---|
2496 | 3383 | { |
---|
| 3384 | + new Exception().printStackTrace(); |
---|
2497 | 3385 | System.exit(0); |
---|
2498 | 3386 | } |
---|
2499 | 3387 | |
---|
.. | .. |
---|
2642 | 3530 | } |
---|
2643 | 3531 | } |
---|
2644 | 3532 | } |
---|
| 3533 | + |
---|
2645 | 3534 | cFileSystemPane FSPane; |
---|
2646 | 3535 | |
---|
2647 | 3536 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2651 | 3540 | |
---|
2652 | 3541 | freezematerial = true; |
---|
2653 | 3542 | colorField.setFloat(mat.color); |
---|
2654 | | - modulationField.setFloat(mat.modulation); |
---|
| 3543 | + saturationField.setFloat(mat.modulation); |
---|
2655 | 3544 | metalnessField.setFloat(mat.metalness); |
---|
2656 | 3545 | diffuseField.setFloat(mat.diffuse); |
---|
2657 | 3546 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
2695 | 3584 | } |
---|
2696 | 3585 | } |
---|
2697 | 3586 | } |
---|
| 3587 | + |
---|
2698 | 3588 | freezematerial = false; |
---|
2699 | 3589 | } |
---|
2700 | 3590 | |
---|
2701 | 3591 | void SetMaterial(Object3D object) |
---|
2702 | 3592 | { |
---|
| 3593 | + latestObject = object; |
---|
| 3594 | + |
---|
2703 | 3595 | cMaterial mat = object.material; |
---|
2704 | 3596 | |
---|
2705 | 3597 | if (mat == null) |
---|
.. | .. |
---|
2708 | 3600 | return; |
---|
2709 | 3601 | } |
---|
2710 | 3602 | |
---|
2711 | | - multiplyToggle.setSelected(mat.multiply); |
---|
2712 | | - |
---|
2713 | | - assert (object.projectedVertices != null); |
---|
2714 | | - |
---|
2715 | | - if (object.projectedVertices.length <= 2) |
---|
2716 | | - { |
---|
2717 | | - // Side effect... |
---|
2718 | | - Object3D.cVector2[] keep = object.projectedVertices; |
---|
2719 | | - object.projectedVertices = new Object3D.cVector2[3]; |
---|
2720 | | - for (int i = 0; i < 3; i++) |
---|
2721 | | - { |
---|
2722 | | - if (i < keep.length) |
---|
2723 | | - { |
---|
2724 | | - object.projectedVertices[i] = keep[i]; |
---|
2725 | | - } else |
---|
2726 | | - { |
---|
2727 | | - object.projectedVertices[i] = new Object3D.cVector2(); |
---|
2728 | | - } |
---|
2729 | | - /* |
---|
2730 | | - if(keep.length == 0) |
---|
2731 | | - object.projectedVertices[0] = new Object3D.cVector2(); |
---|
2732 | | - else |
---|
2733 | | - object.projectedVertices[0] = keep[0]; |
---|
2734 | | - object.projectedVertices[1] = new Object3D.cVector2(); |
---|
2735 | | - */ |
---|
2736 | | - } |
---|
2737 | | - } |
---|
| 3603 | + if (multiplyToggle != null) |
---|
| 3604 | + multiplyToggle.setSelected(mat.multiply); |
---|
| 3605 | + |
---|
| 3606 | + AllocProjectedVertices(object); |
---|
2738 | 3607 | |
---|
2739 | 3608 | SetMaterial(mat, object.projectedVertices); |
---|
2740 | 3609 | } |
---|
.. | .. |
---|
2810 | 3679 | // } |
---|
2811 | 3680 | |
---|
2812 | 3681 | /**/ |
---|
2813 | | - if (deselect) |
---|
| 3682 | + if (deselect || child == null) |
---|
2814 | 3683 | { |
---|
2815 | 3684 | //group.deselectAll(); |
---|
2816 | 3685 | //freeze = true; |
---|
2817 | 3686 | GetTree().clearSelection(); |
---|
2818 | 3687 | //freeze = false; |
---|
| 3688 | + |
---|
| 3689 | + if (child == null) |
---|
| 3690 | + { |
---|
| 3691 | + return; |
---|
| 3692 | + } |
---|
2819 | 3693 | } |
---|
2820 | 3694 | |
---|
2821 | 3695 | //group.addSelectee(child); |
---|
.. | .. |
---|
2849 | 3723 | public void itemStateChanged(ItemEvent event) |
---|
2850 | 3724 | { |
---|
2851 | 3725 | // System.out.println("Propagate = " + propagate); |
---|
| 3726 | + if (event.getSource() == pinButton) |
---|
| 3727 | + { |
---|
| 3728 | + copy.pinned ^= true; |
---|
| 3729 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3730 | + { |
---|
| 3731 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3732 | + copy.CloseUI(); |
---|
| 3733 | + //copy.editWindow.refreshContents(); |
---|
| 3734 | + } |
---|
| 3735 | + } |
---|
| 3736 | + else |
---|
2852 | 3737 | if (event.getSource() == propagateToggle) |
---|
2853 | 3738 | { |
---|
2854 | 3739 | propagate ^= true; |
---|
.. | .. |
---|
2884 | 3769 | cameraView.ToggleDL(); |
---|
2885 | 3770 | cameraView.repaint(); |
---|
2886 | 3771 | return; |
---|
2887 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3772 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2888 | 3773 | { |
---|
2889 | 3774 | cameraView.ToggleTexture(); |
---|
2890 | 3775 | // june 2013 copy.HardTouch(); |
---|
2891 | 3776 | cameraView.repaint(); |
---|
2892 | 3777 | return; |
---|
2893 | | - } else if (event.getSource() == toggleFullItem) |
---|
| 3778 | + } else if (event.getSource() == toggleTimelineItem) |
---|
2894 | 3779 | { |
---|
2895 | | - if (CameraPane.FULLSCREEN) |
---|
| 3780 | + timeline ^= true; |
---|
| 3781 | + |
---|
| 3782 | + if (timeline) |
---|
2896 | 3783 | { |
---|
2897 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
2898 | | - framePanel.add(bigThree); |
---|
2899 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
2900 | | - } else |
---|
2901 | | - { |
---|
2902 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
2903 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 3784 | + centralPanel.remove(cameraView); |
---|
| 3785 | + cameraPanel.add(cameraView); |
---|
| 3786 | + centralPanel.add(cameraPanel); |
---|
| 3787 | + frame.setJMenuBar(timelineMenubar); |
---|
| 3788 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 3789 | + if (!CameraPane.FULLSCREEN) |
---|
| 3790 | + ToggleFullScreen(); |
---|
| 3791 | + toggleFullScreenItem.setEnabled(false); |
---|
2904 | 3792 | } |
---|
| 3793 | + else |
---|
| 3794 | + { |
---|
| 3795 | + centralPanel.remove(cameraPanel); |
---|
| 3796 | + centralPanel.add(cameraView); |
---|
| 3797 | + frame.setJMenuBar(null); |
---|
| 3798 | + if (!wasFullScreen) |
---|
| 3799 | + ToggleFullScreen(); |
---|
| 3800 | + toggleFullScreenItem.setEnabled(true); |
---|
| 3801 | + } |
---|
| 3802 | + |
---|
2905 | 3803 | frame.validate(); |
---|
2906 | | - cameraView.ToggleFullScreen(); |
---|
| 3804 | + return; |
---|
| 3805 | + } else if (event.getSource() == toggleFullScreenItem) |
---|
| 3806 | + { |
---|
| 3807 | + ToggleFullScreen(); |
---|
| 3808 | + frame.validate(); |
---|
2907 | 3809 | |
---|
2908 | 3810 | return; |
---|
2909 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3811 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
2910 | 3812 | { |
---|
2911 | | - cameraView.ToggleRandom(); |
---|
| 3813 | + cameraView.ToggleSwitch(); |
---|
2912 | 3814 | cameraView.repaint(); |
---|
2913 | 3815 | return; |
---|
2914 | 3816 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
2936 | 3838 | } else if (event.getSource() == liveCB) |
---|
2937 | 3839 | { |
---|
2938 | 3840 | copy.live ^= true; |
---|
| 3841 | + objEditor.refreshContents(true); // To show item colors |
---|
| 3842 | + return; |
---|
| 3843 | + } else if (event.getSource() == selectableCB) |
---|
| 3844 | + { |
---|
| 3845 | + copy.dontselect ^= true; |
---|
2939 | 3846 | return; |
---|
2940 | 3847 | } else if (event.getSource() == hideCB) |
---|
2941 | 3848 | { |
---|
2942 | 3849 | copy.hide ^= true; |
---|
2943 | 3850 | copy.Touch(); // display list issue |
---|
2944 | | - objEditor.refreshContents(); |
---|
| 3851 | + objEditor.refreshContents(true); // To show item colors |
---|
2945 | 3852 | return; |
---|
2946 | 3853 | } else if (event.getSource() == link2masterCB) |
---|
2947 | 3854 | { |
---|
.. | .. |
---|
2951 | 3858 | if (event.getSource() == randomCB) |
---|
2952 | 3859 | { |
---|
2953 | 3860 | copy.random ^= true; |
---|
| 3861 | + objEditor.refreshContents(); |
---|
2954 | 3862 | return; |
---|
2955 | 3863 | } |
---|
2956 | 3864 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
2974 | 3882 | |
---|
2975 | 3883 | public void actionPerformed(ActionEvent event) |
---|
2976 | 3884 | { |
---|
| 3885 | + Object source = event.getSource(); |
---|
2977 | 3886 | // SCRIPT DIALOG |
---|
2978 | | - if (event.getSource() == okbutton) |
---|
| 3887 | + if (source == okbutton) |
---|
2979 | 3888 | { |
---|
2980 | 3889 | textpanel.setVisible(false); |
---|
2981 | 3890 | textpanel.remove(textarea); |
---|
.. | .. |
---|
2987 | 3896 | textarea = null; |
---|
2988 | 3897 | textpanel = null; |
---|
2989 | 3898 | } |
---|
2990 | | - if (event.getSource() == cancelbutton) |
---|
| 3899 | + if (source == cancelbutton) |
---|
2991 | 3900 | { |
---|
2992 | 3901 | textpanel.setVisible(false); |
---|
2993 | 3902 | textpanel.remove(textarea); |
---|
.. | .. |
---|
2999 | 3908 | //applySelf(); |
---|
3000 | 3909 | //client.refreshEditWindow(); |
---|
3001 | 3910 | //refreshContents(); |
---|
3002 | | - if (event.getSource() == nameField) |
---|
| 3911 | + if (source == nameField) |
---|
3003 | 3912 | { |
---|
3004 | 3913 | //System.out.println("ObjEditor " + event); |
---|
3005 | 3914 | applySelf0(true); |
---|
3006 | 3915 | //parent.applySelf(); |
---|
3007 | 3916 | objEditor.refreshContents(); |
---|
3008 | | - } else if (event.getSource() == resetButton) |
---|
| 3917 | + } else if (source == resetButton) |
---|
3009 | 3918 | { |
---|
3010 | 3919 | CameraPane.fullreset = true; |
---|
3011 | 3920 | copy.Reset(); // ResetMeshes(); |
---|
3012 | 3921 | copy.Touch(); |
---|
3013 | 3922 | objEditor.refreshContents(); |
---|
3014 | | - } else if (event.getSource() == stepItem) |
---|
| 3923 | + } else if (source == stepItem) |
---|
3015 | 3924 | { |
---|
3016 | | - cameraView.ONESTEP = true; |
---|
| 3925 | + //cameraView.ONESTEP = true; |
---|
| 3926 | + Globals.ONESTEP = true; |
---|
3017 | 3927 | cameraView.repaint(); |
---|
3018 | 3928 | return; |
---|
3019 | | - } else if (event.getSource() == stepButton) |
---|
| 3929 | + } else if (source == stepButton) |
---|
3020 | 3930 | { |
---|
3021 | 3931 | copy.Step(); |
---|
3022 | 3932 | copy.Touch(); |
---|
3023 | 3933 | objEditor.refreshContents(); |
---|
3024 | | - } else if (event.getSource() == slowerButton) |
---|
| 3934 | + } else if (source == slowerButton) |
---|
3025 | 3935 | { |
---|
3026 | 3936 | copy.Slower(); |
---|
3027 | 3937 | copy.Touch(); |
---|
3028 | 3938 | objEditor.refreshContents(); |
---|
3029 | | - } else if (event.getSource() == fasterButton) |
---|
| 3939 | + } else if (source == fasterButton) |
---|
3030 | 3940 | { |
---|
3031 | 3941 | copy.Faster(); |
---|
3032 | 3942 | copy.Touch(); |
---|
3033 | 3943 | objEditor.refreshContents(); |
---|
3034 | | - } else if (event.getSource() == remarkButton) |
---|
| 3944 | + } else if (source == remarkButton) |
---|
3035 | 3945 | { |
---|
3036 | 3946 | copy.Remark(); |
---|
3037 | 3947 | copy.Touch(); |
---|
3038 | 3948 | objEditor.refreshContents(); |
---|
3039 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3949 | + } else if (source == stepAllButton) |
---|
3040 | 3950 | { |
---|
3041 | 3951 | copy.StepAll(); |
---|
3042 | 3952 | copy.Touch(); |
---|
3043 | 3953 | objEditor.refreshContents(); |
---|
3044 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3954 | + } else if (source == resetAllButton) |
---|
3045 | 3955 | { |
---|
3046 | 3956 | //CameraPane.fullreset = true; |
---|
3047 | 3957 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3074 | 3984 | // Close(); |
---|
3075 | 3985 | // } |
---|
3076 | 3986 | // else |
---|
3077 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3987 | + if (source == resetSlidersButton) |
---|
3078 | 3988 | { |
---|
3079 | 3989 | ResetSliders(); |
---|
3080 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3990 | + } else if (source == clearMaterialButton) |
---|
3081 | 3991 | { |
---|
3082 | 3992 | ClearMaterial(); |
---|
3083 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3993 | + } else if (source == createMaterialButton) |
---|
3084 | 3994 | { |
---|
3085 | 3995 | CreateMaterial(); |
---|
3086 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3996 | + } else if (source == clearPanelButton) |
---|
3087 | 3997 | { |
---|
3088 | 3998 | copy.ClearUI(); |
---|
3089 | 3999 | refreshContents(true); |
---|
3090 | | - } /* |
---|
3091 | | - } |
---|
3092 | | - |
---|
3093 | | - public boolean action(Event event, Object arg) |
---|
3094 | | - { |
---|
3095 | | - */ else if (event.getSource() == closeItem) |
---|
| 4000 | + } else if (source == importGFDItem) |
---|
| 4001 | + { |
---|
| 4002 | + ImportGFD(); |
---|
| 4003 | + } else |
---|
| 4004 | + if (source == importVRMLX3DItem) |
---|
| 4005 | + { |
---|
| 4006 | + ImportVRMLX3D(); |
---|
| 4007 | + } else |
---|
| 4008 | + if (source == import3DSItem) |
---|
| 4009 | + { |
---|
| 4010 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 4011 | + } else |
---|
| 4012 | + if (source == importOBJItem) |
---|
| 4013 | + { |
---|
| 4014 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 4015 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 4016 | + browser.setVisible(true); |
---|
| 4017 | + String filename = browser.getFile(); |
---|
| 4018 | + if (filename != null && filename.length() > 0) |
---|
| 4019 | + { |
---|
| 4020 | + String fullname = browser.getDirectory() + filename; |
---|
| 4021 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 4022 | + } |
---|
| 4023 | + } else |
---|
| 4024 | + if (source == closeItem) |
---|
3096 | 4025 | { |
---|
3097 | 4026 | Close(); |
---|
3098 | 4027 | //return true; |
---|
3099 | | - } else if (event.getSource() == loadItem) |
---|
| 4028 | + } else if (source == openItem) |
---|
3100 | 4029 | { |
---|
3101 | | - load(); |
---|
| 4030 | + Open(); |
---|
3102 | 4031 | //return true; |
---|
3103 | | - } else if (event.getSource() == saveItem) |
---|
| 4032 | + } else if (source == newItem) |
---|
| 4033 | + { |
---|
| 4034 | + New(); |
---|
| 4035 | + } else if (source == saveItem) |
---|
3104 | 4036 | { |
---|
3105 | 4037 | save(); |
---|
3106 | 4038 | //return true; |
---|
3107 | | - } else if (event.getSource() == saveAsItem) |
---|
| 4039 | + } else if (source == saveAsItem) |
---|
3108 | 4040 | { |
---|
3109 | 4041 | saveAs(); |
---|
3110 | 4042 | //return true; |
---|
3111 | | - } else if (event.getSource() == reexportItem) |
---|
| 4043 | + } else if (source == reexportItem) |
---|
3112 | 4044 | { |
---|
3113 | 4045 | reexport(); |
---|
3114 | 4046 | //return true; |
---|
3115 | | - } else if (event.getSource() == exportAsItem) |
---|
| 4047 | + } else if (source == exportAsItem) |
---|
3116 | 4048 | { |
---|
3117 | 4049 | export(); |
---|
3118 | 4050 | //return true; |
---|
3119 | | - } else if (event.getSource() == povItem) |
---|
| 4051 | + } else if (source == povItem) |
---|
3120 | 4052 | { |
---|
3121 | 4053 | generatePOV(); |
---|
3122 | 4054 | //return true; |
---|
3123 | | - } else if (event.getSource() == zBufferItem) |
---|
| 4055 | + } else if (event.getSource() == archiveItem) |
---|
| 4056 | + { |
---|
| 4057 | + cTools.Archive(frame); |
---|
| 4058 | + return; |
---|
| 4059 | + } else if (source == zBufferItem) |
---|
3124 | 4060 | { |
---|
3125 | 4061 | try |
---|
3126 | 4062 | { |
---|
.. | .. |
---|
3142 | 4078 | cameraView.repaint(); |
---|
3143 | 4079 | //return true; |
---|
3144 | 4080 | } |
---|
3145 | | - */ else if (event.getSource() == editCameraItem) |
---|
3146 | | - { |
---|
3147 | | - cameraView.ProtectCamera(); |
---|
3148 | | - cameraView.repaint(); |
---|
3149 | | - return; |
---|
3150 | | - } else if (event.getSource() == revertCameraItem) |
---|
3151 | | - { |
---|
3152 | | - cameraView.RevertCamera(); |
---|
3153 | | - cameraView.repaint(); |
---|
3154 | | - return; |
---|
3155 | | - } else if (event.getSource() == textureButton) |
---|
3156 | | - { |
---|
3157 | | - return; // true; |
---|
3158 | | - } else // combos... |
---|
3159 | | - if (event.getSource() == texresMenu) |
---|
| 4081 | + */ else // combos... |
---|
| 4082 | + if (source == texresMenu) |
---|
3160 | 4083 | { |
---|
3161 | 4084 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3162 | 4085 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3168 | 4091 | } |
---|
3169 | 4092 | } |
---|
3170 | 4093 | |
---|
3171 | | - void ToggleAnimation() |
---|
| 4094 | + void New() |
---|
3172 | 4095 | { |
---|
3173 | | - if (!CameraPane.ANIMATION) |
---|
| 4096 | + while (copy.Size() > 1) |
---|
3174 | 4097 | { |
---|
3175 | | - FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 4098 | + copy.remove(1); |
---|
| 4099 | + } |
---|
| 4100 | + |
---|
| 4101 | + ResetModel(); |
---|
| 4102 | + objEditor.refreshContents(); |
---|
| 4103 | + } |
---|
| 4104 | + |
---|
| 4105 | + static public byte[] Compress(Object3D o) |
---|
| 4106 | + { |
---|
| 4107 | + // Slower to actually compress. |
---|
| 4108 | + try |
---|
| 4109 | + { |
---|
| 4110 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4111 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 4112 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
| 4113 | + |
---|
| 4114 | + Object3D parent = o.parent; |
---|
| 4115 | + o.parent = null; |
---|
| 4116 | + |
---|
| 4117 | + out.writeObject(o); |
---|
| 4118 | + |
---|
| 4119 | + o.parent = parent; |
---|
| 4120 | + |
---|
| 4121 | + out.flush(); |
---|
| 4122 | + |
---|
| 4123 | + baos //zstream |
---|
| 4124 | + .close(); |
---|
| 4125 | + out.close(); |
---|
| 4126 | + |
---|
| 4127 | + byte[] bytes = baos.toByteArray(); |
---|
| 4128 | + |
---|
| 4129 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 4130 | + return bytes; |
---|
| 4131 | + } catch (Exception e) |
---|
| 4132 | + { |
---|
| 4133 | + System.err.println(e); |
---|
| 4134 | + return null; |
---|
| 4135 | + } |
---|
| 4136 | + } |
---|
| 4137 | + |
---|
| 4138 | + static public Object Uncompress(byte[] bytes) |
---|
| 4139 | + { |
---|
| 4140 | + System.out.println("restore #bytes = " + bytes.length); |
---|
| 4141 | + try |
---|
| 4142 | + { |
---|
| 4143 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4144 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 4145 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
| 4146 | + Object obj = in.readObject(); |
---|
| 4147 | + |
---|
| 4148 | + bais //istream |
---|
| 4149 | + .close(); |
---|
| 4150 | + in.close(); |
---|
| 4151 | + |
---|
| 4152 | + return obj; |
---|
| 4153 | + } catch (Exception e) |
---|
| 4154 | + { |
---|
| 4155 | + System.err.println(e); |
---|
| 4156 | + return null; |
---|
| 4157 | + } |
---|
| 4158 | + } |
---|
| 4159 | + |
---|
| 4160 | + static public Object clone(Object o) |
---|
| 4161 | + { |
---|
| 4162 | + try |
---|
| 4163 | + { |
---|
| 4164 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4165 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 4166 | + |
---|
| 4167 | + out.writeObject(o); |
---|
| 4168 | + |
---|
| 4169 | + out.flush(); |
---|
| 4170 | + out.close(); |
---|
| 4171 | + |
---|
| 4172 | + byte[] bytes = baos.toByteArray(); |
---|
| 4173 | + |
---|
| 4174 | + System.out.println("clone = " + bytes.length); |
---|
| 4175 | + |
---|
| 4176 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4177 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 4178 | + Object obj = in.readObject(); |
---|
| 4179 | + in.close(); |
---|
| 4180 | + |
---|
| 4181 | + return obj; |
---|
| 4182 | + } catch (Exception e) |
---|
| 4183 | + { |
---|
| 4184 | + System.err.println(e); |
---|
| 4185 | + return null; |
---|
| 4186 | + } |
---|
| 4187 | + } |
---|
| 4188 | + |
---|
| 4189 | + cRadio GetCurrentTab() |
---|
| 4190 | + { |
---|
| 4191 | + cRadio ab; |
---|
| 4192 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4193 | + { |
---|
| 4194 | + ab = (cRadio)e.nextElement(); |
---|
| 4195 | + if(ab.GetObject() == copy) |
---|
| 4196 | + { |
---|
| 4197 | + return ab; |
---|
| 4198 | + } |
---|
| 4199 | + } |
---|
| 4200 | + |
---|
| 4201 | + return null; |
---|
| 4202 | + } |
---|
| 4203 | + |
---|
| 4204 | + |
---|
| 4205 | + public void Save() |
---|
| 4206 | + { |
---|
| 4207 | + //Save(true); |
---|
| 4208 | + Replace(); |
---|
| 4209 | + SetVersionStates(); |
---|
| 4210 | + } |
---|
| 4211 | + |
---|
| 4212 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 4213 | + { |
---|
| 4214 | + if (compress.length != name.length) |
---|
| 4215 | + { |
---|
| 4216 | + return false; |
---|
| 4217 | + } |
---|
| 4218 | + |
---|
| 4219 | + for (int i=compress.length; --i>=0;) |
---|
| 4220 | + { |
---|
| 4221 | + if (compress[i] != name[i]) |
---|
| 4222 | + return false; |
---|
| 4223 | + } |
---|
| 4224 | + |
---|
| 4225 | + return true; |
---|
| 4226 | + } |
---|
| 4227 | + |
---|
| 4228 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 4229 | + |
---|
| 4230 | + void DeleteVersion() |
---|
| 4231 | + { |
---|
| 4232 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4233 | + { |
---|
| 4234 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4235 | + } |
---|
| 4236 | + |
---|
| 4237 | + CopyChanged(); |
---|
| 4238 | + |
---|
| 4239 | + SetVersionStates(); |
---|
| 4240 | + } |
---|
| 4241 | + |
---|
| 4242 | + public boolean Save(boolean user) |
---|
| 4243 | + { |
---|
| 4244 | + System.err.println("Save"); |
---|
| 4245 | + Replace(); |
---|
| 4246 | + |
---|
| 4247 | + //cRadio tab = GetCurrentTab(); |
---|
| 4248 | + |
---|
| 4249 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
| 4250 | + |
---|
| 4251 | + boolean thesame = false; |
---|
| 4252 | + |
---|
| 4253 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4254 | +// { |
---|
| 4255 | +// thesame = true; |
---|
| 4256 | +// } |
---|
| 4257 | + |
---|
| 4258 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 4259 | + if (!thesame) |
---|
| 4260 | + { |
---|
| 4261 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4262 | + { |
---|
| 4263 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4264 | + } |
---|
| 4265 | + |
---|
| 4266 | + //tab.user[tab.versionindex] = user; |
---|
| 4267 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 4268 | + |
---|
| 4269 | + copy.versionlist[++copy.versionindex] = compress; |
---|
| 4270 | + |
---|
| 4271 | + // if (increment) |
---|
| 4272 | + // tab.versionindex++; |
---|
| 4273 | + } |
---|
| 4274 | + |
---|
| 4275 | + //copy.RestoreBigData(versiontable); |
---|
| 4276 | + |
---|
| 4277 | + //assert(hashtable.isEmpty()); |
---|
| 4278 | + |
---|
| 4279 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4280 | +// { |
---|
| 4281 | +// //tab.user[i] = false; |
---|
| 4282 | +// copy.versionlist[i] = null; |
---|
| 4283 | +// } |
---|
| 4284 | + |
---|
| 4285 | + SetVersionStates(); |
---|
| 4286 | + |
---|
| 4287 | + // test save |
---|
| 4288 | + if (false) |
---|
| 4289 | + { |
---|
| 4290 | + try |
---|
| 4291 | + { |
---|
| 4292 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
| 4293 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4294 | + |
---|
| 4295 | + p.writeObject(copy); |
---|
| 4296 | + |
---|
| 4297 | + p.flush(); |
---|
| 4298 | + |
---|
| 4299 | + ostream.close(); |
---|
| 4300 | + } catch (Exception e) |
---|
| 4301 | + { |
---|
| 4302 | + e.printStackTrace(); |
---|
| 4303 | + } |
---|
| 4304 | + } |
---|
| 4305 | + |
---|
| 4306 | + return !thesame; |
---|
| 4307 | + } |
---|
| 4308 | + |
---|
| 4309 | + boolean flashIt = true; |
---|
| 4310 | + |
---|
| 4311 | + void RefreshSelection() |
---|
| 4312 | + { |
---|
| 4313 | + Object3D selection = new Object3D(); |
---|
| 4314 | + |
---|
| 4315 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4316 | + { |
---|
| 4317 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4318 | + |
---|
| 4319 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4320 | + |
---|
| 4321 | + if (obj == null) |
---|
| 4322 | + { |
---|
| 4323 | + copy.selection.remove(i--); |
---|
| 4324 | + } |
---|
| 4325 | + else |
---|
| 4326 | + { |
---|
| 4327 | + selection.add(obj); |
---|
| 4328 | + copy.selection.setElementAt(obj, i); |
---|
| 4329 | + } |
---|
| 4330 | + } |
---|
| 4331 | + |
---|
| 4332 | + flashIt = false; |
---|
| 4333 | + GetTree().clearSelection(); |
---|
| 4334 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4335 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4336 | + flashIt = true; |
---|
| 4337 | + |
---|
| 4338 | + //refreshContents(false); |
---|
| 4339 | + } |
---|
| 4340 | + |
---|
| 4341 | + void CopyChanged() |
---|
| 4342 | + { |
---|
| 4343 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4344 | + |
---|
| 4345 | + SetVersionStates(); |
---|
| 4346 | + |
---|
| 4347 | + boolean temp = CameraPane.SWITCH; |
---|
| 4348 | + CameraPane.SWITCH = false; |
---|
| 4349 | + |
---|
| 4350 | + copy.ExtractBigData(versiontable); |
---|
| 4351 | + |
---|
| 4352 | + copy.clear(); |
---|
| 4353 | + |
---|
| 4354 | + copy.skyboxname = obj.skyboxname; |
---|
| 4355 | + copy.skyboxext = obj.skyboxext; |
---|
| 4356 | + |
---|
| 4357 | + for (int i=0; i<obj.Size(); i++) |
---|
| 4358 | + { |
---|
| 4359 | + copy.add(obj.get(i)); |
---|
| 4360 | + } |
---|
| 4361 | + |
---|
| 4362 | + copy.RestoreBigData(versiontable); |
---|
| 4363 | + |
---|
| 4364 | + CameraPane.SWITCH = temp; |
---|
| 4365 | + |
---|
| 4366 | + RefreshSelection(); |
---|
| 4367 | + //assert(hashtable.isEmpty()); |
---|
| 4368 | + |
---|
| 4369 | + copy.Touch(); |
---|
| 4370 | + |
---|
| 4371 | + ResetModel(); |
---|
| 4372 | + copy.HardTouch(); // recompile? |
---|
| 4373 | + |
---|
| 4374 | + cRadio ab; |
---|
| 4375 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4376 | + { |
---|
| 4377 | + ab = (cRadio)e.nextElement(); |
---|
| 4378 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 4379 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 4380 | + if (test != null) |
---|
| 4381 | + { |
---|
| 4382 | + test.editWindow = ab.object.editWindow; |
---|
| 4383 | + ab.object = test; |
---|
| 4384 | + } |
---|
| 4385 | + } |
---|
| 4386 | + |
---|
| 4387 | + refreshContents(true); |
---|
| 4388 | + } |
---|
| 4389 | + |
---|
| 4390 | + cButton previousVersionButton; |
---|
| 4391 | + cButton restoreButton; |
---|
| 4392 | + cButton replaceButton; |
---|
| 4393 | + cButton nextVersionButton; |
---|
| 4394 | + cButton saveVersionButton; |
---|
| 4395 | + cButton deleteVersionButton; |
---|
| 4396 | + |
---|
| 4397 | + boolean muteSlider; |
---|
| 4398 | + |
---|
| 4399 | + int VersionCount() |
---|
| 4400 | + { |
---|
| 4401 | + int count = 0; |
---|
| 4402 | + |
---|
| 4403 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 4404 | + { |
---|
| 4405 | + if (copy.versionlist[i] != null) |
---|
| 4406 | + count++; |
---|
| 4407 | + } |
---|
| 4408 | + |
---|
| 4409 | + return count; |
---|
| 4410 | + } |
---|
| 4411 | + |
---|
| 4412 | + void SetVersionStates() |
---|
| 4413 | + { |
---|
| 4414 | + //if (true) |
---|
| 4415 | + // return; |
---|
| 4416 | + |
---|
| 4417 | + //cRadio tab = GetCurrentTab(); |
---|
| 4418 | + |
---|
| 4419 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4420 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 4421 | + |
---|
| 4422 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4423 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4424 | + |
---|
| 4425 | + deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
| 4426 | + copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4427 | + |
---|
| 4428 | + muteSlider = true; |
---|
| 4429 | + versionSlider.setMinimum(0); |
---|
| 4430 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4431 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4432 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
| 4433 | + muteSlider = false; |
---|
| 4434 | + } |
---|
| 4435 | + |
---|
| 4436 | + public boolean PreviousVersion() |
---|
| 4437 | + { |
---|
| 4438 | + // Option? |
---|
| 4439 | + Replace(); |
---|
| 4440 | + |
---|
| 4441 | + System.err.println("Undo"); |
---|
| 4442 | + |
---|
| 4443 | + //cRadio tab = GetCurrentTab(); |
---|
| 4444 | + |
---|
| 4445 | + if (copy.versionindex == 0) |
---|
| 4446 | + { |
---|
| 4447 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4448 | + return false; |
---|
| 4449 | + } |
---|
| 4450 | + |
---|
| 4451 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 4452 | +// { |
---|
| 4453 | +// if (Save(false)) |
---|
| 4454 | +// tab.versionindex -= 1; |
---|
| 4455 | +// else |
---|
| 4456 | +// { |
---|
| 4457 | +// if (tab.versionindex <= 0) |
---|
| 4458 | +// return false; |
---|
| 4459 | +// else |
---|
| 4460 | +// tab.versionindex -= 1; |
---|
| 4461 | +// } |
---|
| 4462 | +// } |
---|
| 4463 | + |
---|
| 4464 | + copy.versionindex -= 1; |
---|
| 4465 | + |
---|
| 4466 | + CopyChanged(); |
---|
| 4467 | + |
---|
| 4468 | + return true; |
---|
| 4469 | + } |
---|
| 4470 | + |
---|
| 4471 | + public boolean Restore() |
---|
| 4472 | + { |
---|
| 4473 | + System.err.println("Restore"); |
---|
| 4474 | + |
---|
| 4475 | + //cRadio tab = GetCurrentTab(); |
---|
| 4476 | + |
---|
| 4477 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4478 | + { |
---|
| 4479 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4480 | + return false; |
---|
| 4481 | + } |
---|
| 4482 | + |
---|
| 4483 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4484 | + CopyChanged(); |
---|
| 4485 | + |
---|
| 4486 | + return true; |
---|
| 4487 | + } |
---|
| 4488 | + |
---|
| 4489 | + public boolean Replace() |
---|
| 4490 | + { |
---|
| 4491 | + System.err.println("Replace"); |
---|
| 4492 | + |
---|
| 4493 | + //cRadio tab = GetCurrentTab(); |
---|
| 4494 | + |
---|
| 4495 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4496 | + { |
---|
| 4497 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4498 | + return false; |
---|
| 4499 | + } |
---|
| 4500 | + |
---|
| 4501 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
| 4502 | + |
---|
| 4503 | + return true; |
---|
| 4504 | + } |
---|
| 4505 | + |
---|
| 4506 | + public void NextVersion() |
---|
| 4507 | + { |
---|
| 4508 | + // Option? |
---|
| 4509 | + Replace(); |
---|
| 4510 | + |
---|
| 4511 | + //cRadio tab = GetCurrentTab(); |
---|
| 4512 | + |
---|
| 4513 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
| 4514 | + { |
---|
| 4515 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4516 | + return; |
---|
| 4517 | + } |
---|
| 4518 | + |
---|
| 4519 | + copy.versionindex += 1; |
---|
| 4520 | + |
---|
| 4521 | + CopyChanged(); |
---|
| 4522 | + |
---|
| 4523 | + //if (!tab.user[tab.versionindex]) |
---|
| 4524 | + // tab.graphs[tab.versionindex] = null; |
---|
| 4525 | + } |
---|
| 4526 | + |
---|
| 4527 | + void ImportGFD() |
---|
| 4528 | + { |
---|
| 4529 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
3176 | 4530 | browser.show(); |
---|
3177 | 4531 | String filename = browser.getFile(); |
---|
3178 | 4532 | if (filename != null && filename.length() > 0) |
---|
3179 | 4533 | { |
---|
3180 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 4534 | + String fullname = browser.getDirectory() + filename; |
---|
| 4535 | + |
---|
| 4536 | + //Object3D readobj = |
---|
| 4537 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 4538 | + //makeSomething(readobj); |
---|
| 4539 | + } |
---|
| 4540 | + } |
---|
| 4541 | + |
---|
| 4542 | + void ImportVRMLX3D() |
---|
| 4543 | + { |
---|
| 4544 | + if (Grafreed.standAlone) |
---|
| 4545 | + { |
---|
| 4546 | + /**/ |
---|
| 4547 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 4548 | + browser.show(); |
---|
| 4549 | + String filename = browser.getFile(); |
---|
| 4550 | + if (filename != null && filename.length() > 0) |
---|
| 4551 | + { |
---|
| 4552 | + String fullname = browser.getDirectory() + filename; |
---|
| 4553 | + LoadVRMLX3D(fullname); |
---|
| 4554 | + } |
---|
| 4555 | + /**/ |
---|
| 4556 | + } |
---|
| 4557 | + } |
---|
| 4558 | + |
---|
| 4559 | + void ToggleAnimation() |
---|
| 4560 | + { |
---|
| 4561 | + if (!Globals.ANIMATION) |
---|
| 4562 | + { |
---|
| 4563 | + FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 4564 | + browser.setVisible(true); |
---|
| 4565 | + String filename = browser.getFile(); |
---|
| 4566 | + if (filename != null && filename.length() > 0) |
---|
| 4567 | + { |
---|
| 4568 | + Globals.filename = browser.getDirectory() + filename; |
---|
3181 | 4569 | //CameraPane.framecount = 0; |
---|
3182 | | - CameraPane.imagecount = 0; |
---|
| 4570 | + Globals.imagecount = 0; |
---|
3183 | 4571 | |
---|
3184 | | - CameraPane.ANIMATION ^= true; |
---|
| 4572 | + Globals.ANIMATION ^= true; |
---|
3185 | 4573 | |
---|
3186 | | - GraphreeD.wav.cursor = 0; |
---|
3187 | | - GraphreeD.wav.loop = 0; |
---|
| 4574 | + Grafreed.wav.cursor = 0; |
---|
| 4575 | + Grafreed.wav.loop = 0; |
---|
3188 | 4576 | } |
---|
3189 | 4577 | } else |
---|
3190 | 4578 | { |
---|
3191 | | - CameraPane.ANIMATION ^= true; |
---|
| 4579 | + Globals.ANIMATION ^= true; |
---|
3192 | 4580 | } |
---|
3193 | 4581 | } |
---|
3194 | 4582 | |
---|
.. | .. |
---|
3234 | 4622 | void CreateMaterial() |
---|
3235 | 4623 | { |
---|
3236 | 4624 | //copy.ClearMaterial(); // PATCH |
---|
3237 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 4625 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3238 | 4626 | if (copy.selection.size() > 0) |
---|
3239 | 4627 | //SetMaterial(copy); |
---|
3240 | 4628 | { |
---|
.. | .. |
---|
3285 | 4673 | assert false; |
---|
3286 | 4674 | } |
---|
3287 | 4675 | |
---|
3288 | | - void EditSelection() |
---|
| 4676 | + void EditSelection(boolean newWindow) |
---|
3289 | 4677 | { |
---|
3290 | 4678 | } |
---|
3291 | 4679 | |
---|
.. | .. |
---|
3293 | 4681 | { |
---|
3294 | 4682 | copy.ResetBlockLoop(); // temporary problem |
---|
3295 | 4683 | |
---|
3296 | | - boolean random = CameraPane.RANDOM; |
---|
3297 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 4684 | + boolean random = CameraPane.SWITCH; |
---|
| 4685 | + CameraPane.SWITCH = false; // parse everything |
---|
3298 | 4686 | copy.ResetDisplayList(); |
---|
3299 | 4687 | copy.HardTouch(); |
---|
3300 | | - CameraPane.RANDOM = random; |
---|
| 4688 | + CameraPane.SWITCH = random; |
---|
3301 | 4689 | } |
---|
3302 | 4690 | |
---|
3303 | 4691 | // public void applySelf() |
---|
.. | .. |
---|
3344 | 4732 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
3345 | 4733 | |
---|
3346 | 4734 | current.color = (float) colorField.getFloat(); |
---|
3347 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4735 | + current.modulation = (float) saturationField.getFloat(); |
---|
3348 | 4736 | current.metalness = (float) metalnessField.getFloat(); |
---|
3349 | 4737 | current.diffuse = (float) diffuseField.getFloat(); |
---|
3350 | 4738 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
3367 | 4755 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3368 | 4756 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3369 | 4757 | |
---|
3370 | | - if (!NumberSlider.frozen) |
---|
| 4758 | + if (!cNumberSlider.frozen) |
---|
3371 | 4759 | { |
---|
3372 | 4760 | //System.out.println("Propagate = " + propagate); |
---|
3373 | 4761 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 4762 | + |
---|
| 4763 | + if (copy.material != null) |
---|
| 4764 | + { |
---|
| 4765 | + cMaterial mat = copy.material; |
---|
| 4766 | + |
---|
| 4767 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4768 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4769 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4770 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4771 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4772 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4773 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4774 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4775 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4776 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4777 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4778 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4779 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4780 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4781 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4782 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4783 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4784 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4785 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4786 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4787 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4788 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4789 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4790 | + } |
---|
| 4791 | + |
---|
3374 | 4792 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3375 | 4793 | { |
---|
3376 | 4794 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3399 | 4817 | //copy.Touch(); |
---|
3400 | 4818 | } |
---|
3401 | 4819 | |
---|
| 4820 | + cNumberSlider versionSlider; |
---|
| 4821 | + |
---|
3402 | 4822 | public void stateChanged(ChangeEvent e) |
---|
3403 | 4823 | { |
---|
3404 | 4824 | // assert(false); |
---|
| 4825 | + if (e.getSource() == versionSlider) |
---|
| 4826 | + { |
---|
| 4827 | + if (muteSlider) |
---|
| 4828 | + return; |
---|
| 4829 | + |
---|
| 4830 | + Replace(); |
---|
| 4831 | + |
---|
| 4832 | + int version = versionSlider.getInteger(); |
---|
| 4833 | + |
---|
| 4834 | + if (version != -1 && copy.versionlist[version] != null) |
---|
| 4835 | + { |
---|
| 4836 | + copy.versionindex = version; |
---|
| 4837 | + CopyChanged(); |
---|
| 4838 | + } |
---|
| 4839 | + |
---|
| 4840 | + return; |
---|
| 4841 | + } |
---|
3405 | 4842 | |
---|
3406 | 4843 | if (freezematerial) |
---|
3407 | 4844 | { |
---|
.. | .. |
---|
3415 | 4852 | || e.getSource() == apertureField |
---|
3416 | 4853 | || e.getSource() == shadowblurField) |
---|
3417 | 4854 | { |
---|
| 4855 | + new Exception().printStackTrace(); |
---|
3418 | 4856 | System.exit(0); |
---|
3419 | 4857 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3420 | 4858 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3436 | 4874 | { |
---|
3437 | 4875 | //System.out.println("stateChanged = " + this); |
---|
3438 | 4876 | materialtouched = true; |
---|
| 4877 | + |
---|
| 4878 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4879 | + { |
---|
| 4880 | + saturationField.setFloat(1); |
---|
| 4881 | + } |
---|
| 4882 | + |
---|
3439 | 4883 | applySelf(); |
---|
3440 | 4884 | //System.out.println("this = " + this); |
---|
3441 | 4885 | //System.out.println("PARENT = " + parent); |
---|
3442 | 4886 | //if (parent != null) |
---|
3443 | 4887 | // parent.applySelf(); |
---|
3444 | | - refreshContents(); |
---|
| 4888 | + if (e.getSource() == normalpushField) |
---|
| 4889 | + { |
---|
| 4890 | + objEditor.refreshContents(); |
---|
| 4891 | + //Refresh(); |
---|
| 4892 | + } |
---|
| 4893 | + else |
---|
| 4894 | + refreshContents(); |
---|
3445 | 4895 | // ??? client.refreshEditWindow(); |
---|
3446 | 4896 | } |
---|
3447 | 4897 | //else |
---|
.. | .. |
---|
3453 | 4903 | //group.name = nameField.getText(); |
---|
3454 | 4904 | //objEditor.applySelf(); |
---|
3455 | 4905 | |
---|
3456 | | - assert (objEditor == this); |
---|
| 4906 | + // OCT2018: assert (objEditor == this); |
---|
3457 | 4907 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3458 | 4908 | //super.applySelf() |
---|
3459 | 4909 | ; else |
---|
.. | .. |
---|
3477 | 4927 | objEditor.copy = keep; |
---|
3478 | 4928 | } |
---|
3479 | 4929 | } |
---|
| 4930 | + |
---|
| 4931 | + if (normalpushField != null) |
---|
| 4932 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3480 | 4933 | } |
---|
3481 | 4934 | |
---|
3482 | 4935 | void SnapObject() |
---|
3483 | 4936 | { |
---|
3484 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3485 | | - SnapObject(obj); |
---|
| 4937 | + if (copy.selection.size() > 0) |
---|
| 4938 | + { |
---|
| 4939 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 4940 | + SnapObject(obj); |
---|
| 4941 | + } |
---|
3486 | 4942 | } |
---|
3487 | 4943 | |
---|
3488 | 4944 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
3596 | 5052 | |
---|
3597 | 5053 | if (obj.parent != null) |
---|
3598 | 5054 | { |
---|
3599 | | - obj.parent.TransformToWorld(interest); |
---|
| 5055 | +// obj.parent.TransformToWorld(interest); |
---|
3600 | 5056 | } |
---|
3601 | 5057 | |
---|
3602 | 5058 | if (!CameraPane.TRACK) |
---|
.. | .. |
---|
3723 | 5179 | { |
---|
3724 | 5180 | if (GetTree() != null) |
---|
3725 | 5181 | { |
---|
| 5182 | + GetTree().revalidate(); |
---|
3726 | 5183 | GetTree().repaint(); |
---|
3727 | 5184 | } |
---|
3728 | 5185 | |
---|
3729 | 5186 | radioPanel.revalidate(); |
---|
3730 | 5187 | radioPanel.repaint(); |
---|
3731 | | - ctrlPanel.revalidate(); // ? new |
---|
| 5188 | + ctrlPanel.validate(); // ? new |
---|
3732 | 5189 | ctrlPanel.repaint(); |
---|
3733 | 5190 | } |
---|
| 5191 | + |
---|
| 5192 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5193 | + SetVersionStates(); |
---|
| 5194 | + |
---|
| 5195 | + cameraView.requestFocusInWindow(); |
---|
3734 | 5196 | } |
---|
3735 | 5197 | |
---|
3736 | 5198 | static TweenManager tweenManager = new TweenManager(); |
---|
3737 | 5199 | |
---|
3738 | 5200 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3739 | 5201 | { |
---|
| 5202 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
| 5203 | + Save(); |
---|
3740 | 5204 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3741 | 5205 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3742 | 5206 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3760 | 5224 | // group = (Composite) group.get(0); |
---|
3761 | 5225 | // } |
---|
3762 | 5226 | |
---|
3763 | | - System.out.println("makeSomething of " + thing); |
---|
| 5227 | + //System.out.println("makeSomething of " + thing); |
---|
3764 | 5228 | |
---|
3765 | 5229 | /* |
---|
3766 | 5230 | if (deselect && jList != null) |
---|
.. | .. |
---|
3823 | 5287 | { |
---|
3824 | 5288 | ResetModel(); |
---|
3825 | 5289 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 5290 | + |
---|
| 5291 | + if (thing.Size() == 0) |
---|
| 5292 | + { |
---|
| 5293 | + //EditSelection(false); |
---|
| 5294 | + } |
---|
| 5295 | + |
---|
3826 | 5296 | refreshContents(); |
---|
3827 | 5297 | } |
---|
3828 | 5298 | |
---|
.. | .. |
---|
3940 | 5410 | } |
---|
3941 | 5411 | } |
---|
3942 | 5412 | } |
---|
| 5413 | + |
---|
3943 | 5414 | LoadGFDThread loadGFDThread; |
---|
3944 | 5415 | |
---|
3945 | 5416 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
3959 | 5430 | |
---|
3960 | 5431 | try |
---|
3961 | 5432 | { |
---|
| 5433 | + // Try compressed version first. |
---|
3962 | 5434 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
3963 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5435 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 5436 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
3964 | 5437 | |
---|
3965 | 5438 | readobj = (Object3D) p.readObject(); |
---|
3966 | 5439 | istream.close(); |
---|
.. | .. |
---|
3968 | 5441 | readobj.ResetDisplayList(); |
---|
3969 | 5442 | } catch (Exception e) |
---|
3970 | 5443 | { |
---|
3971 | | - e.printStackTrace(); |
---|
| 5444 | + if (!e.toString().contains("GZIP")) |
---|
| 5445 | + e.printStackTrace(); |
---|
| 5446 | + |
---|
| 5447 | + try |
---|
| 5448 | + { |
---|
| 5449 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 5450 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5451 | + |
---|
| 5452 | + readobj = (Object3D) p.readObject(); |
---|
| 5453 | + istream.close(); |
---|
| 5454 | + |
---|
| 5455 | + readobj.ResetDisplayList(); |
---|
| 5456 | + } catch (Exception e2) |
---|
| 5457 | + { |
---|
| 5458 | + e2.printStackTrace(); |
---|
| 5459 | + } |
---|
3972 | 5460 | } |
---|
3973 | 5461 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
3974 | 5462 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4014 | 5502 | |
---|
4015 | 5503 | void LoadIt(Object obj) |
---|
4016 | 5504 | { |
---|
| 5505 | + if (obj == null) |
---|
| 5506 | + { |
---|
| 5507 | + // Invalid file |
---|
| 5508 | + return; |
---|
| 5509 | + } |
---|
| 5510 | + |
---|
4017 | 5511 | System.out.println("Loaded " + obj); |
---|
4018 | 5512 | //new Exception().printStackTrace(); |
---|
4019 | 5513 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4023 | 5517 | |
---|
4024 | 5518 | if (readobj != null) |
---|
4025 | 5519 | { |
---|
| 5520 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 5521 | + // Save(); |
---|
4026 | 5522 | try |
---|
4027 | 5523 | { |
---|
4028 | 5524 | //readobj.deepCopySelf(copy); |
---|
4029 | 5525 | copy.clear(); // june 2014 |
---|
| 5526 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5527 | + copy.skyboxext = readobj.skyboxext; |
---|
4030 | 5528 | for (int i = 0; i < readobj.size(); i++) |
---|
4031 | 5529 | { |
---|
4032 | 5530 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4067 | 5565 | } |
---|
4068 | 5566 | } catch (ClassCastException e) |
---|
4069 | 5567 | { |
---|
| 5568 | + e.printStackTrace(); |
---|
4070 | 5569 | assert (false); |
---|
4071 | 5570 | Composite c = (Composite) copy; |
---|
4072 | 5571 | c.children.clear(); |
---|
.. | .. |
---|
4077 | 5576 | c.addChild(csg); |
---|
4078 | 5577 | } |
---|
4079 | 5578 | |
---|
| 5579 | + copy.versionlist = readobj.versionlist; |
---|
| 5580 | + copy.versionindex = readobj.versionindex; |
---|
| 5581 | + |
---|
| 5582 | + if (copy.versionlist == null) |
---|
| 5583 | + { |
---|
| 5584 | + // Backward compatibility |
---|
| 5585 | + copy.versionlist = new Object3D[100]; |
---|
| 5586 | + copy.versionindex = -1; |
---|
| 5587 | + |
---|
| 5588 | + //Save(true); |
---|
| 5589 | + } |
---|
| 5590 | + |
---|
| 5591 | + //? SetUndoStates(); |
---|
| 5592 | + |
---|
4080 | 5593 | ResetModel(); |
---|
4081 | 5594 | copy.HardTouch(); // recompile? |
---|
4082 | 5595 | refreshContents(); |
---|
4083 | 5596 | } |
---|
4084 | 5597 | } |
---|
4085 | 5598 | |
---|
4086 | | - void load() // throws ClassNotFoundException |
---|
| 5599 | + void Open() // throws ClassNotFoundException |
---|
4087 | 5600 | { |
---|
4088 | | - if (GraphreeD.standAlone) |
---|
| 5601 | + if (Grafreed.standAlone) |
---|
4089 | 5602 | { |
---|
4090 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5603 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4091 | 5604 | browser.show(); |
---|
4092 | 5605 | String filename = browser.getFile(); |
---|
4093 | 5606 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4164 | 5677 | |
---|
4165 | 5678 | void save() |
---|
4166 | 5679 | { |
---|
| 5680 | + Replace(); |
---|
| 5681 | + |
---|
4167 | 5682 | if (lastname == null) |
---|
4168 | 5683 | { |
---|
4169 | 5684 | return; |
---|
.. | .. |
---|
4172 | 5687 | try |
---|
4173 | 5688 | { |
---|
4174 | 5689 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4175 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 5690 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5691 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4176 | 5692 | |
---|
4177 | 5693 | p.writeObject(copy); |
---|
4178 | 5694 | p.flush(); |
---|
4179 | 5695 | |
---|
| 5696 | + zstream.close(); |
---|
4180 | 5697 | ostream.close(); |
---|
4181 | 5698 | |
---|
4182 | 5699 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4184 | 5701 | //ps.print(buffer.toString()); |
---|
4185 | 5702 | } catch (IOException e) |
---|
4186 | 5703 | { |
---|
| 5704 | + e.printStackTrace(); |
---|
4187 | 5705 | } |
---|
4188 | 5706 | } |
---|
| 5707 | + |
---|
4189 | 5708 | String lastname; |
---|
4190 | 5709 | |
---|
4191 | 5710 | void saveAs() |
---|
4192 | 5711 | { |
---|
4193 | | - if (GraphreeD.standAlone) |
---|
| 5712 | + if (Grafreed.standAlone) |
---|
4194 | 5713 | { |
---|
4195 | 5714 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4196 | 5715 | browser.setVisible(true); |
---|
4197 | 5716 | String filename = browser.getFile(); |
---|
4198 | 5717 | if (filename != null && filename.length() > 0) |
---|
4199 | 5718 | { |
---|
| 5719 | + if (!filename.endsWith(".gfd")) |
---|
| 5720 | + filename += ".gfd"; |
---|
4200 | 5721 | lastname = browser.getDirectory() + filename; |
---|
4201 | 5722 | save(); |
---|
4202 | 5723 | } |
---|
.. | .. |
---|
4213 | 5734 | |
---|
4214 | 5735 | Object3D object = copy.selection.get(0); |
---|
4215 | 5736 | |
---|
| 5737 | + FileObject fileobj = null; |
---|
| 5738 | + |
---|
| 5739 | + if (object instanceof FileObject) |
---|
| 5740 | + fileobj = (FileObject)object; |
---|
| 5741 | + |
---|
4216 | 5742 | if (object.fileparent != null) |
---|
4217 | 5743 | { |
---|
4218 | | - FileObject fileobj = (FileObject) object.fileparent; |
---|
| 5744 | + assert(fileobj == null); |
---|
4219 | 5745 | |
---|
| 5746 | + fileobj = (FileObject) object.fileparent; |
---|
| 5747 | + } |
---|
| 5748 | + |
---|
| 5749 | + if (fileobj != null) |
---|
| 5750 | + { |
---|
4220 | 5751 | System.out.println("WriteObject " + object + " : " + fileobj.name); |
---|
4221 | 5752 | WriteObject(object, fileobj.name); |
---|
4222 | 5753 | } |
---|
.. | .. |
---|
4259 | 5790 | } |
---|
4260 | 5791 | } |
---|
4261 | 5792 | else |
---|
4262 | | - //if (GraphreeD.standAlone) |
---|
| 5793 | + //if (GrafreeD.standAlone) |
---|
4263 | 5794 | { |
---|
4264 | 5795 | FileDialog browser = new FileDialog(frame, "Export", FileDialog.SAVE); |
---|
4265 | 5796 | browser.setVisible(true); |
---|
.. | .. |
---|
4285 | 5816 | try |
---|
4286 | 5817 | { |
---|
4287 | 5818 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4288 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4289 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 5819 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5820 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4290 | 5821 | |
---|
4291 | 5822 | Object3D objectparent = obj.parent; |
---|
4292 | 5823 | obj.parent = null; |
---|
4293 | 5824 | |
---|
4294 | | - Object3D object = (Object3D) GraphreeD.clone(obj); |
---|
| 5825 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4295 | 5826 | |
---|
4296 | 5827 | obj.parent = objectparent; |
---|
4297 | 5828 | |
---|
.. | .. |
---|
4303 | 5834 | p.writeObject(object); |
---|
4304 | 5835 | p.flush(); |
---|
4305 | 5836 | |
---|
| 5837 | + zstream.close(); |
---|
4306 | 5838 | ostream.close(); |
---|
4307 | | - // zstream.close(); |
---|
4308 | 5839 | |
---|
4309 | 5840 | // group.selection.get(0).parent = parent; |
---|
4310 | 5841 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4325 | 5856 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4326 | 5857 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4327 | 5858 | copy.generatePOV(buffer); |
---|
4328 | | - if (GraphreeD.standAlone) |
---|
| 5859 | + if (Grafreed.standAlone) |
---|
4329 | 5860 | { |
---|
4330 | 5861 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4331 | 5862 | browser.show(); |
---|
.. | .. |
---|
4351 | 5882 | Object3D client; |
---|
4352 | 5883 | Object3D copy; |
---|
4353 | 5884 | MenuBar menuBar; |
---|
4354 | | - Menu windowMenu; |
---|
4355 | | - MenuItem loadItem; |
---|
| 5885 | + Menu fileMenu; |
---|
| 5886 | + MenuItem newItem; |
---|
| 5887 | + MenuItem openItem; |
---|
4356 | 5888 | MenuItem saveItem; |
---|
4357 | 5889 | MenuItem saveAsItem; |
---|
4358 | 5890 | MenuItem exportAsItem; |
---|
4359 | 5891 | MenuItem reexportItem; |
---|
4360 | 5892 | MenuItem povItem; |
---|
4361 | 5893 | MenuItem closeItem; |
---|
4362 | | - Menu cameraMenu; |
---|
| 5894 | + |
---|
4363 | 5895 | CheckboxMenuItem zBufferItem; |
---|
4364 | 5896 | //MenuItem normalLensItem; |
---|
4365 | | - MenuItem editCameraItem; |
---|
4366 | | - MenuItem revertCameraItem; |
---|
4367 | | - CheckboxMenuItem toggleLiveItem; |
---|
4368 | 5897 | MenuItem stepItem; |
---|
4369 | | - CheckboxMenuItem toggleFullItem; |
---|
| 5898 | + CheckboxMenuItem toggleLiveItem; |
---|
| 5899 | + CheckboxMenuItem toggleFullScreenItem; |
---|
| 5900 | + CheckboxMenuItem toggleTimelineItem; |
---|
4370 | 5901 | CheckboxMenuItem toggleRenderItem; |
---|
4371 | 5902 | CheckboxMenuItem toggleDebugItem; |
---|
4372 | 5903 | CheckboxMenuItem toggleFrustumItem; |
---|
4373 | 5904 | CheckboxMenuItem toggleFootContactItem; |
---|
4374 | 5905 | CheckboxMenuItem toggleDLItem; |
---|
4375 | 5906 | CheckboxMenuItem toggleTextureItem; |
---|
4376 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 5907 | + CheckboxMenuItem toggleSwitchItem; |
---|
4377 | 5908 | CheckboxMenuItem toggleRootItem; |
---|
4378 | 5909 | CheckboxMenuItem animationItem; |
---|
| 5910 | + MenuItem archiveItem; |
---|
4379 | 5911 | CheckboxMenuItem toggleHandleItem; |
---|
4380 | 5912 | CheckboxMenuItem togglePaintItem; |
---|
4381 | 5913 | JSplitPane mainPanel; |
---|
4382 | 5914 | JScrollPane scrollpane; |
---|
| 5915 | + |
---|
4383 | 5916 | JPanel toolbarPanel; |
---|
4384 | | - JPanel treePanel; |
---|
| 5917 | + |
---|
| 5918 | + cGridBag treePanel; |
---|
| 5919 | + |
---|
4385 | 5920 | JPanel radioPanel; |
---|
4386 | 5921 | ButtonGroup buttonGroup; |
---|
4387 | | - JPanel ctrlPanel; |
---|
4388 | | - JPanel materialPanel; |
---|
| 5922 | + |
---|
| 5923 | + cGridBag toolboxPanel; |
---|
| 5924 | + cGridBag skyboxPanel; |
---|
| 5925 | + cGridBag materialPanel; |
---|
| 5926 | + cGridBag ctrlPanel; |
---|
| 5927 | + |
---|
4389 | 5928 | JScrollPane infoPanel; |
---|
4390 | | - JPanel optionsPanel; |
---|
| 5929 | + |
---|
| 5930 | + cGridBag optionsPanel; |
---|
| 5931 | + |
---|
4391 | 5932 | JTabbedPane objectPanel; |
---|
4392 | | - JPanel XYZPanel; |
---|
| 5933 | + boolean materialFlushed; |
---|
| 5934 | + Object3D latestObject; |
---|
| 5935 | + |
---|
| 5936 | + cGridBag XYZPanel; |
---|
| 5937 | + |
---|
4393 | 5938 | JSplitPane gridPanel; |
---|
4394 | 5939 | JSplitPane bigPanel; |
---|
4395 | | - JPanel bigThree; |
---|
4396 | | - JTabbedPane jtp; |
---|
4397 | | - JPanel cameraPanel; |
---|
| 5940 | + |
---|
| 5941 | + cGridBag bigThree; |
---|
| 5942 | + cGridBag scenePanel; |
---|
| 5943 | + cGridBag centralPanel; |
---|
| 5944 | + JSplitPane cameraPanel; |
---|
| 5945 | + JPanel timelinePanel; |
---|
| 5946 | + JMenuBar timelineMenubar; |
---|
4398 | 5947 | JSplitPane framePanel; |
---|
4399 | 5948 | JTextArea/*Field*/ nameField; |
---|
4400 | | - cButton textureButton; |
---|
| 5949 | + //cButton textureButton; |
---|
4401 | 5950 | cButton okButton; |
---|
4402 | 5951 | cButton applyButton; |
---|
4403 | 5952 | cButton cancelButton; |
---|
.. | .. |
---|
4444 | 5993 | // MATERIAL |
---|
4445 | 5994 | JLabel materialLabel; |
---|
4446 | 5995 | JLabel colorLabel; |
---|
4447 | | - NumberSlider colorField; |
---|
| 5996 | + cNumberSlider colorField; |
---|
4448 | 5997 | JLabel modulationLabel; |
---|
4449 | | - NumberSlider modulationField; |
---|
| 5998 | + cNumberSlider saturationField; |
---|
4450 | 5999 | JLabel metalnessLabel; |
---|
4451 | | - NumberSlider metalnessField; |
---|
| 6000 | + cNumberSlider metalnessField; |
---|
4452 | 6001 | JLabel diffuseLabel; |
---|
4453 | | - NumberSlider diffuseField; |
---|
| 6002 | + cNumberSlider diffuseField; |
---|
4454 | 6003 | JLabel specularLabel; |
---|
4455 | | - NumberSlider specularField; |
---|
| 6004 | + cNumberSlider specularField; |
---|
4456 | 6005 | JLabel shininessLabel; |
---|
4457 | | - NumberSlider shininessField; |
---|
| 6006 | + cNumberSlider shininessField; |
---|
4458 | 6007 | JLabel shiftLabel; |
---|
4459 | | - NumberSlider shiftField; |
---|
| 6008 | + cNumberSlider shiftField; |
---|
4460 | 6009 | JLabel ambientLabel; |
---|
4461 | | - NumberSlider ambientField; |
---|
| 6010 | + cNumberSlider ambientField; |
---|
4462 | 6011 | JLabel lightareaLabel; |
---|
4463 | | - NumberSlider lightareaField; |
---|
| 6012 | + cNumberSlider lightareaField; |
---|
4464 | 6013 | JLabel diffusenessLabel; |
---|
4465 | | - NumberSlider diffusenessField; |
---|
| 6014 | + cNumberSlider diffusenessField; |
---|
4466 | 6015 | JLabel velvetLabel; |
---|
4467 | | - NumberSlider velvetField; |
---|
| 6016 | + cNumberSlider velvetField; |
---|
4468 | 6017 | JLabel sheenLabel; |
---|
4469 | | - NumberSlider sheenField; |
---|
| 6018 | + cNumberSlider sheenField; |
---|
4470 | 6019 | JLabel subsurfaceLabel; |
---|
4471 | | - NumberSlider subsurfaceField; |
---|
| 6020 | + cNumberSlider subsurfaceField; |
---|
4472 | 6021 | //JLabel bumpLabel; |
---|
4473 | 6022 | //NumberSlider bumpField; |
---|
4474 | 6023 | JLabel backlitLabel; |
---|
4475 | | - NumberSlider backlitField; |
---|
| 6024 | + cNumberSlider backlitField; |
---|
4476 | 6025 | JLabel anisoLabel; |
---|
4477 | | - NumberSlider anisoField; |
---|
| 6026 | + cNumberSlider anisoField; |
---|
4478 | 6027 | JLabel anisoVLabel; |
---|
4479 | | - NumberSlider anisoVField; |
---|
| 6028 | + cNumberSlider anisoVField; |
---|
| 6029 | + |
---|
4480 | 6030 | JLabel cameraLabel; |
---|
4481 | | - NumberSlider cameraField; |
---|
| 6031 | + cNumberSlider cameraField; |
---|
4482 | 6032 | JLabel selfshadowLabel; |
---|
4483 | | - NumberSlider selfshadowField; |
---|
| 6033 | + cNumberSlider selfshadowField; |
---|
4484 | 6034 | JLabel shadowLabel; |
---|
4485 | | - NumberSlider shadowField; |
---|
| 6035 | + cNumberSlider shadowField; |
---|
4486 | 6036 | JLabel textureLabel; |
---|
4487 | | - NumberSlider textureField; |
---|
| 6037 | + cNumberSlider textureField; |
---|
4488 | 6038 | JLabel opacityLabel; |
---|
4489 | | - NumberSlider opacityField; |
---|
| 6039 | + cNumberSlider opacityField; |
---|
4490 | 6040 | JLabel fakedepthLabel; |
---|
4491 | | - NumberSlider fakedepthField; |
---|
| 6041 | + cNumberSlider fakedepthField; |
---|
4492 | 6042 | JLabel shadowbiasLabel; |
---|
4493 | | - NumberSlider shadowbiasField; |
---|
| 6043 | + cNumberSlider shadowbiasField; |
---|
| 6044 | + |
---|
4494 | 6045 | JLabel bumpLabel; |
---|
4495 | | - NumberSlider bumpField; |
---|
| 6046 | + cNumberSlider bumpField; |
---|
4496 | 6047 | JLabel noiseLabel; |
---|
4497 | | - NumberSlider noiseField; |
---|
| 6048 | + cNumberSlider noiseField; |
---|
4498 | 6049 | JLabel powerLabel; |
---|
4499 | | - NumberSlider powerField; |
---|
| 6050 | + cNumberSlider powerField; |
---|
4500 | 6051 | JLabel borderfadeLabel; |
---|
4501 | | - NumberSlider borderfadeField; |
---|
| 6052 | + cNumberSlider borderfadeField; |
---|
4502 | 6053 | JLabel fogLabel; |
---|
4503 | | - NumberSlider fogField; |
---|
| 6054 | + cNumberSlider fogField; |
---|
4504 | 6055 | JLabel opacityPowerLabel; |
---|
4505 | | - NumberSlider opacityPowerField; |
---|
4506 | | - JTree jTree; |
---|
| 6056 | + cNumberSlider opacityPowerField; |
---|
| 6057 | + cTree jTree; |
---|
4507 | 6058 | //ObjectUI parent; |
---|
| 6059 | + |
---|
| 6060 | + cNumberSlider normalpushField; |
---|
| 6061 | + |
---|
| 6062 | + private MenuItem importGFDItem; |
---|
| 6063 | + private MenuItem importVRMLX3DItem; |
---|
| 6064 | + private MenuItem import3DSItem; |
---|
| 6065 | + private MenuItem importOBJItem; |
---|
4508 | 6066 | } |
---|