.. | .. |
---|
4 | 4 | |
---|
5 | 5 | import java.awt.*; |
---|
6 | 6 | import java.awt.event.*; |
---|
| 7 | +import java.awt.image.BufferedImage; |
---|
7 | 8 | import javax.swing.*; |
---|
8 | 9 | import javax.swing.event.*; |
---|
9 | 10 | import javax.swing.text.*; |
---|
.. | .. |
---|
14 | 15 | //import javax.swing.plaf.ColorUIResource; |
---|
15 | 16 | //import javax.swing.plaf.metal.DefaultMetalTheme; |
---|
16 | 17 | |
---|
| 18 | +import javax.swing.plaf.basic.BasicSplitPaneDivider; |
---|
| 19 | +import javax.swing.plaf.basic.BasicSplitPaneUI; |
---|
| 20 | + |
---|
17 | 21 | //import javax.media.opengl.GLCanvas; |
---|
18 | 22 | |
---|
19 | 23 | import //weka.core. |
---|
20 | 24 | matrix.Matrix; |
---|
| 25 | + |
---|
| 26 | +import grafeme.ui.*; |
---|
21 | 27 | |
---|
22 | 28 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 29 | ActionListener, ChangeListener, |
---|
.. | .. |
---|
28 | 34 | iSendInfo |
---|
29 | 35 | //KeyListener |
---|
30 | 36 | { |
---|
| 37 | + public cToggleButton pinButton; |
---|
31 | 38 | boolean timeline; |
---|
32 | 39 | boolean wasFullScreen; |
---|
33 | 40 | |
---|
| 41 | + GroupEditor callee; |
---|
| 42 | + JFrame frame; |
---|
| 43 | + |
---|
| 44 | + static ObjEditor theFrame; |
---|
| 45 | + |
---|
| 46 | + public cGridBag GetSeparator() |
---|
| 47 | + { |
---|
| 48 | + cGridBag separator = new cGridBag(); |
---|
| 49 | + separator.add(new JSeparator()); |
---|
| 50 | + separator.preferredHeight = 5; |
---|
| 51 | + return separator; |
---|
| 52 | + } |
---|
| 53 | + |
---|
| 54 | + cButton GetButton(String name, boolean border) |
---|
| 55 | + { |
---|
| 56 | + ImageIcon icon = GetIcon(name); |
---|
| 57 | + return new cButton(icon, border); |
---|
| 58 | + } |
---|
| 59 | + |
---|
| 60 | + cLabel GetLabel(String name, boolean border) |
---|
| 61 | + { |
---|
| 62 | + //ImageIcon icon = GetIcon(name); |
---|
| 63 | + return new cLabel(GetImage(name), border); |
---|
| 64 | + } |
---|
| 65 | + |
---|
| 66 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 67 | + { |
---|
| 68 | + ImageIcon icon = GetIcon(name); |
---|
| 69 | + return new cToggleButton(icon, border); |
---|
| 70 | + } |
---|
| 71 | + |
---|
| 72 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 73 | + { |
---|
| 74 | + ImageIcon icon = GetIcon(name); |
---|
| 75 | + return new cCheckBox(icon, border); |
---|
| 76 | + } |
---|
| 77 | + |
---|
| 78 | + ImageIcon GetIcon(String name) |
---|
| 79 | + { |
---|
| 80 | + try |
---|
| 81 | + { |
---|
| 82 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 83 | + |
---|
| 84 | +// if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
| 85 | +// { |
---|
| 86 | +// BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
| 87 | +// Graphics2D g = resized.createGraphics(); |
---|
| 88 | +// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 89 | +// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 90 | +// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 91 | +// g.dispose(); |
---|
| 92 | +// |
---|
| 93 | +// image = resized; |
---|
| 94 | +// } |
---|
| 95 | + |
---|
| 96 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 97 | + return icon; |
---|
| 98 | + } |
---|
| 99 | + catch (Exception e) |
---|
| 100 | + { |
---|
| 101 | + return null; |
---|
| 102 | + } |
---|
| 103 | + } |
---|
| 104 | + |
---|
| 105 | + BufferedImage GetImage(String name) |
---|
| 106 | + { |
---|
| 107 | + try |
---|
| 108 | + { |
---|
| 109 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 110 | + |
---|
| 111 | + return image; |
---|
| 112 | + } |
---|
| 113 | + catch (Exception e) |
---|
| 114 | + { |
---|
| 115 | + return null; |
---|
| 116 | + } |
---|
| 117 | + } |
---|
| 118 | + |
---|
34 | 119 | // SCRIPT |
---|
35 | 120 | |
---|
36 | 121 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
121 | 206 | void keyPressed(int key, int modifiers) |
---|
122 | 207 | { |
---|
123 | 208 | System.out.println("KEY PRESSED"); |
---|
124 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 209 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
125 | 210 | } |
---|
126 | 211 | */ |
---|
127 | 212 | |
---|
128 | 213 | static GridBagConstraints aConstraints; |
---|
129 | 214 | static GridBagConstraints aWindowConstraints; |
---|
130 | | - GroupEditor callee; |
---|
131 | | - JFrame frame; |
---|
| 215 | + |
---|
132 | 216 | static int GRIDWIDTH = 100; // 4; |
---|
133 | 217 | |
---|
134 | 218 | public void closeUI() |
---|
135 | 219 | { |
---|
136 | 220 | //new Exception().printStackTrace(); |
---|
137 | | - System.out.println("this = " + this); |
---|
138 | | - System.out.println("objEditor = " + objEditor); |
---|
| 221 | +// System.out.println("this = " + this); |
---|
| 222 | +// System.out.println("objEditor = " + objEditor); |
---|
139 | 223 | //nameField.removeActionListener(this); |
---|
140 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 224 | +// objEditor.ctrlPanel.remove(nameField); |
---|
141 | 225 | |
---|
142 | | - if (!GroupEditor.allparams) |
---|
| 226 | + objEditor.ctrlPanel.remove(namePanel); |
---|
| 227 | + |
---|
| 228 | + if (!allparams) |
---|
143 | 229 | return; |
---|
144 | 230 | |
---|
145 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
146 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
147 | | - objEditor.ctrlPanel.remove(markCB); |
---|
148 | | - |
---|
149 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
150 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
151 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
152 | | - |
---|
153 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
154 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
155 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
156 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
157 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
158 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
159 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
160 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
161 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
162 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 231 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 232 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 233 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 234 | +// |
---|
| 235 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 236 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 237 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 238 | +// |
---|
| 239 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 240 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 241 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 242 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 243 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 244 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 245 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 246 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 247 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 248 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
163 | 249 | |
---|
164 | | - Remove(normalpushField); |
---|
| 250 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 251 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 252 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
| 253 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 254 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 255 | + |
---|
| 256 | + //Remove(normalpushField); |
---|
165 | 257 | } |
---|
166 | 258 | |
---|
167 | 259 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
205 | 297 | client = inClient; |
---|
206 | 298 | copy = client; |
---|
207 | 299 | |
---|
| 300 | + if (copy.versionlist == null) |
---|
| 301 | + { |
---|
| 302 | + copy.versionlist = new Object3D[100]; |
---|
| 303 | + copy.versionindex = -1; |
---|
| 304 | + } |
---|
| 305 | + |
---|
208 | 306 | // "this" is not called: SetupUI2(objEditor); |
---|
209 | 307 | } |
---|
210 | 308 | |
---|
.. | .. |
---|
218 | 316 | client = inClient; |
---|
219 | 317 | copy = client; |
---|
220 | 318 | |
---|
| 319 | + if (copy.versionlist == null) |
---|
| 320 | + { |
---|
| 321 | + copy.versionlist = new Object3D[100]; |
---|
| 322 | + copy.versionindex = -1; |
---|
| 323 | + } |
---|
| 324 | + |
---|
221 | 325 | SetupUI2(callee.GetEditor()); |
---|
222 | 326 | } |
---|
223 | 327 | |
---|
.. | .. |
---|
232 | 336 | //localCopy.parent = null; |
---|
233 | 337 | |
---|
234 | 338 | frame = new JFrame(); |
---|
| 339 | + frame.setUndecorated(false); |
---|
235 | 340 | objEditor = this; |
---|
236 | 341 | this.callee = callee; |
---|
237 | 342 | |
---|
.. | .. |
---|
249 | 354 | copy = localCopy; |
---|
250 | 355 | copy.editWindow = this; |
---|
251 | 356 | |
---|
| 357 | + if (copy.versionlist == null) |
---|
| 358 | + { |
---|
| 359 | +// copy.versions = new byte[100][]; |
---|
| 360 | +// copy.versionindex = -1; |
---|
| 361 | + } |
---|
| 362 | + |
---|
252 | 363 | SetupMenu(); |
---|
253 | 364 | |
---|
254 | 365 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
262 | 373 | return frame.action(event, obj); |
---|
263 | 374 | } |
---|
264 | 375 | |
---|
| 376 | + // Cannot work without static |
---|
| 377 | + static boolean allparams = true; |
---|
| 378 | + |
---|
| 379 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 380 | + |
---|
265 | 381 | void SetupMenu() |
---|
266 | 382 | { |
---|
267 | 383 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
268 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
269 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
270 | | - windowMenu.add("-"); |
---|
271 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
272 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 384 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 385 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 386 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
| 387 | + |
---|
| 388 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 389 | + Menu menu = new Menu("Import"); |
---|
| 390 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 391 | + importOBJItem.addActionListener(this); |
---|
| 392 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 393 | + import3DSItem.addActionListener(this); |
---|
| 394 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 395 | + importVRMLX3DItem.addActionListener(this); |
---|
| 396 | + menu.add("-"); |
---|
| 397 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 398 | + importGFDItem.addActionListener(this); |
---|
| 399 | + fileMenu.add(menu); |
---|
| 400 | + fileMenu.add("-"); |
---|
| 401 | + |
---|
| 402 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 403 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
273 | 404 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
274 | | - windowMenu.add("-"); |
---|
275 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
276 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
277 | | - windowMenu.add("-"); |
---|
| 405 | + fileMenu.add("-"); |
---|
| 406 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 407 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 408 | + fileMenu.add("-"); |
---|
278 | 409 | if (client.parent != null) |
---|
279 | 410 | { |
---|
280 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 411 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
281 | 412 | } else |
---|
282 | 413 | { |
---|
283 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 414 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
284 | 415 | } |
---|
285 | 416 | |
---|
286 | | - loadItem.addActionListener(this); |
---|
| 417 | + newItem.addActionListener(this); |
---|
| 418 | + openItem.addActionListener(this); |
---|
287 | 419 | saveItem.addActionListener(this); |
---|
288 | 420 | saveAsItem.addActionListener(this); |
---|
289 | 421 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
291 | 423 | //povItem.addActionListener(this); |
---|
292 | 424 | closeItem.addActionListener(this); |
---|
293 | 425 | |
---|
294 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
295 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
296 | | - //zBufferItem.addActionListener(this); |
---|
297 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
298 | | - //normalLensItem.addActionListener(this); |
---|
299 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
300 | | - revertCameraItem.addActionListener(this); |
---|
301 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
302 | | - toggleTimelineItem.addItemListener(this); |
---|
303 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
304 | | - toggleFullScreenItem.addItemListener(this); |
---|
305 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
306 | | - cameraMenu.add("-"); |
---|
307 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
308 | | - toggleTextureItem.addItemListener(this); |
---|
309 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
310 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
311 | | - toggleLiveItem.addItemListener(this); |
---|
312 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
313 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
314 | | - stepItem.addActionListener(this); |
---|
315 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
316 | | -// toggleDLItem.addItemListener(this); |
---|
317 | | -// toggleDLItem.setState(false); |
---|
318 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
319 | | - toggleRenderItem.addItemListener(this); |
---|
320 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
321 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
322 | | - toggleDebugItem.addItemListener(this); |
---|
323 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
324 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
325 | | - toggleFrustumItem.addItemListener(this); |
---|
326 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
327 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
328 | | - toggleFootContactItem.addItemListener(this); |
---|
329 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
330 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
331 | | - toggleRandomItem.addItemListener(this); |
---|
332 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
333 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
334 | | - toggleHandleItem.addItemListener(this); |
---|
335 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
336 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
337 | | - togglePaintItem.addItemListener(this); |
---|
338 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
339 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
340 | | -// toggleRootItem.addItemListener(this); |
---|
341 | | -// toggleRootItem.setState(false); |
---|
342 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
343 | | -// animationItem.addItemListener(this); |
---|
344 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
345 | | - cameraMenu.add("-"); |
---|
346 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
347 | | - editCameraItem.addActionListener(this); |
---|
348 | | - |
---|
349 | 426 | objectPanel = new JTabbedPane(); |
---|
| 427 | + |
---|
| 428 | + ChangeListener changeListener = new ChangeListener() |
---|
| 429 | + { |
---|
| 430 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 431 | + { |
---|
| 432 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 433 | +// { |
---|
| 434 | +// if (latestObject != null) |
---|
| 435 | +// { |
---|
| 436 | +// refreshContents(true); |
---|
| 437 | +// SetMaterial(latestObject); |
---|
| 438 | +// } |
---|
| 439 | +// |
---|
| 440 | +// materialFlushed = true; |
---|
| 441 | +// } |
---|
| 442 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 443 | +// { |
---|
| 444 | +// if (listUI.size() == 0) |
---|
| 445 | +// EditSelection(false); |
---|
| 446 | +// } |
---|
| 447 | + |
---|
| 448 | + refreshContents(false); // To refresh Info tab |
---|
| 449 | + } |
---|
| 450 | + }; |
---|
| 451 | + objectPanel.addChangeListener(changeListener); |
---|
| 452 | + |
---|
350 | 453 | toolbarPanel = new JPanel(); |
---|
351 | 454 | toolbarPanel.setName("Toolbar"); |
---|
352 | | - treePanel = new JPanel(); |
---|
| 455 | + |
---|
| 456 | + treePanel = new cGridBag(); |
---|
353 | 457 | treePanel.setName("Tree"); |
---|
354 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
355 | | - ctrlPanel.setName("Edit"); |
---|
356 | | - materialPanel = new JPanel(); |
---|
357 | | - materialPanel.setName("Material"); |
---|
| 458 | + |
---|
| 459 | + editPanel = new cGridBag().setVertical(true); |
---|
| 460 | + //editPanel.setName("Edit"); |
---|
| 461 | + |
---|
| 462 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
| 463 | + |
---|
| 464 | + editCommandsPanel = new cGridBag(); |
---|
| 465 | + editPanel.add(editCommandsPanel); |
---|
| 466 | + editPanel.add(ctrlPanel); |
---|
| 467 | + |
---|
| 468 | + toolboxPanel = new cGridBag().setVertical(true); |
---|
| 469 | + //toolboxPanel.setName("Toolbox"); |
---|
| 470 | + |
---|
| 471 | + skyboxPanel = new cGridBag().setVertical(true); |
---|
| 472 | + |
---|
| 473 | + materialPanel = new cGridBag().setVertical(false); |
---|
| 474 | + //materialPanel.setName("Material"); |
---|
| 475 | + |
---|
358 | 476 | /*JTextPane*/ |
---|
359 | 477 | infoarea = createTextPane(); |
---|
| 478 | + doc = infoarea.getStyledDocument(); |
---|
| 479 | + |
---|
360 | 480 | infoarea.setEditable(true); |
---|
361 | 481 | SetText(); |
---|
| 482 | + |
---|
362 | 483 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
363 | 484 | // infoarea.setOpaque(false); |
---|
364 | 485 | // //infoarea.setForeground(textcolor); |
---|
365 | | - infoarea.setLineWrap(true); |
---|
366 | | - infoarea.setWrapStyleWord(true); |
---|
| 486 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 487 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
367 | 488 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
368 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
369 | | - infoPanel.setName("Info"); |
---|
| 489 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
| 490 | + //infoPanel.setName("Info"); |
---|
370 | 491 | //infoPanel.setLayout(new BorderLayout()); |
---|
371 | 492 | //infoPanel.add(createTextPane()); |
---|
372 | 493 | |
---|
.. | .. |
---|
374 | 495 | mainPanel.setName("Main"); |
---|
375 | 496 | mainPanel.setContinuousLayout(true); |
---|
376 | 497 | mainPanel.setOneTouchExpandable(true); |
---|
377 | | - mainPanel.setDividerLocation(1.0); |
---|
378 | 498 | mainPanel.setDividerSize(9); |
---|
379 | | - mainPanel.setResizeWeight(0); |
---|
380 | | - |
---|
| 499 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 500 | + mainPanel.setResizeWeight(0.5); |
---|
| 501 | + |
---|
| 502 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 503 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 504 | + divider.setDividerSize(15); |
---|
| 505 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 506 | + |
---|
| 507 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 508 | + |
---|
381 | 509 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
382 | 510 | //mainPanel.setLayout(new GridBagLayout()); |
---|
383 | 511 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
384 | | - treePanel.setLayout(new GridBagLayout()); |
---|
385 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
386 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 512 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 513 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 514 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
387 | 515 | |
---|
388 | 516 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
389 | 517 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
422 | 550 | static String newline = "\n"; |
---|
423 | 551 | protected static final String buttonString = "JButton"; |
---|
424 | 552 | StyledDocument doc; |
---|
425 | | - JTextArea infoarea; |
---|
| 553 | + JTextPane infoarea; |
---|
426 | 554 | |
---|
427 | 555 | void ClearInfo() |
---|
428 | 556 | { |
---|
.. | .. |
---|
445 | 573 | e.printStackTrace(); |
---|
446 | 574 | } |
---|
447 | 575 | |
---|
448 | | - String selection = infoarea.getText(); |
---|
449 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
450 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
451 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 576 | +// String selection = infoarea.getText(); |
---|
| 577 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 578 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 579 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
452 | 580 | //clipboard.setContents(data, data); |
---|
453 | 581 | } |
---|
454 | 582 | |
---|
.. | .. |
---|
471 | 599 | //SendInfo("Name:", "bold"); |
---|
472 | 600 | if (sel.GetTextures() != null || debug) |
---|
473 | 601 | { |
---|
474 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 602 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
475 | 603 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
476 | 604 | if (sel.Size() > 0) |
---|
477 | 605 | { |
---|
478 | 606 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
479 | 607 | } |
---|
480 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 608 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
481 | 609 | if (debug) |
---|
482 | 610 | { |
---|
483 | 611 | try |
---|
.. | .. |
---|
489 | 617 | } |
---|
490 | 618 | |
---|
491 | 619 | if (full) |
---|
492 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 620 | + { |
---|
| 621 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 622 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 623 | + } |
---|
493 | 624 | |
---|
494 | 625 | if (sel.bRep != null) |
---|
495 | 626 | { |
---|
.. | .. |
---|
516 | 647 | } |
---|
517 | 648 | if (sel.support != null) |
---|
518 | 649 | { |
---|
519 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 650 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
520 | 651 | } |
---|
521 | 652 | if (sel.scriptnode != null) |
---|
522 | 653 | { |
---|
.. | .. |
---|
587 | 718 | { |
---|
588 | 719 | CameraPane.pointflow = (PointFlow) sel; |
---|
589 | 720 | } |
---|
| 721 | + |
---|
| 722 | + si.SendInfo("_____________________", "regular"); |
---|
| 723 | + si.SendInfo("", "regular"); |
---|
590 | 724 | } |
---|
591 | 725 | } |
---|
592 | 726 | |
---|
.. | .. |
---|
602 | 736 | } |
---|
603 | 737 | } |
---|
604 | 738 | |
---|
| 739 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 740 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 741 | + |
---|
| 742 | + Rectangle keeprect; |
---|
| 743 | + cRadio radio; |
---|
| 744 | + |
---|
| 745 | +cButton keepButton; |
---|
| 746 | + cButton twoButton; // Full 3D |
---|
| 747 | + cButton sixButton; |
---|
| 748 | + cButton threeButton; |
---|
| 749 | + cButton sevenButton; |
---|
| 750 | + cButton fourButton; // full panel |
---|
| 751 | + cButton oneButton; // full XYZ |
---|
| 752 | + //cButton currentLayout; |
---|
| 753 | + |
---|
| 754 | + boolean maximized; |
---|
| 755 | + |
---|
| 756 | + cButton fullscreenLayout; |
---|
| 757 | + |
---|
| 758 | + void Minimize() |
---|
| 759 | + { |
---|
| 760 | + frame.setState(Frame.ICONIFIED); |
---|
| 761 | + frame.validate(); |
---|
| 762 | + } |
---|
| 763 | + |
---|
| 764 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 765 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 766 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
| 767 | + void Maximize() |
---|
| 768 | + { |
---|
| 769 | + if (CameraPane.FULLSCREEN) |
---|
| 770 | + { |
---|
| 771 | + ToggleFullScreen(); |
---|
| 772 | + } |
---|
| 773 | + |
---|
| 774 | + if (maximized) |
---|
| 775 | + { |
---|
| 776 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 777 | + } |
---|
| 778 | + else |
---|
| 779 | + { |
---|
| 780 | + keeprect = frame.getBounds(); |
---|
| 781 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 782 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 783 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 784 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 785 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
| 786 | + } |
---|
| 787 | + |
---|
| 788 | + maximized ^= true; |
---|
| 789 | + |
---|
| 790 | + frame.validate(); |
---|
| 791 | + } |
---|
| 792 | + |
---|
| 793 | + cButton minButton; |
---|
| 794 | + cButton maxButton; |
---|
| 795 | + cButton fullButton; |
---|
| 796 | + |
---|
605 | 797 | void ToggleFullScreen() |
---|
606 | 798 | { |
---|
607 | | - if (CameraPane.FULLSCREEN) |
---|
| 799 | +GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 800 | + |
---|
| 801 | + cameraView.ToggleFullScreen(); |
---|
| 802 | + |
---|
| 803 | + if (!CameraPane.FULLSCREEN) |
---|
608 | 804 | { |
---|
609 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
610 | | - framePanel.add(bigThree); |
---|
611 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 805 | + device.setFullScreenWindow(null); |
---|
| 806 | + frame.dispose(); |
---|
| 807 | + frame.setUndecorated(false); |
---|
| 808 | + frame.validate(); |
---|
| 809 | + frame.setVisible(true); |
---|
| 810 | + |
---|
| 811 | + //frame.setVisible(false); |
---|
| 812 | +// frame.removeNotify(); |
---|
| 813 | +// frame.setUndecorated(false); |
---|
| 814 | +// frame.addNotify(); |
---|
| 815 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 816 | + |
---|
| 817 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 818 | +// X framePanel.add(bigThree); |
---|
| 819 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 820 | + framePanel.setDividerLocation(46); |
---|
| 821 | + |
---|
| 822 | + //frame.setVisible(true); |
---|
| 823 | + radio.layout = keepButton; |
---|
| 824 | + //theFrame = null; |
---|
| 825 | + keepButton = null; |
---|
| 826 | + radio.layout.doClick(); |
---|
| 827 | + |
---|
612 | 828 | } else |
---|
613 | 829 | { |
---|
614 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
615 | | - framePanel.remove(bigThree); |
---|
616 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 830 | + keepButton = radio.layout; |
---|
| 831 | + //keeprect = frame.getBounds(); |
---|
| 832 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 833 | +// frame.getToolkit().getScreenSize().height); |
---|
| 834 | + //frame.setVisible(false); |
---|
| 835 | + |
---|
| 836 | + frame.dispose(); |
---|
| 837 | + frame.setUndecorated(true); |
---|
| 838 | + device.setFullScreenWindow(frame); |
---|
| 839 | + frame.validate(); |
---|
| 840 | + frame.setVisible(true); |
---|
| 841 | +// frame.removeNotify(); |
---|
| 842 | +// frame.setUndecorated(true); |
---|
| 843 | +// frame.addNotify(); |
---|
| 844 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 845 | +// X framePanel.remove(bigThree); |
---|
| 846 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 847 | + framePanel.setDividerLocation(0); |
---|
| 848 | + |
---|
| 849 | + radio.layout = fullscreenLayout; |
---|
| 850 | + radio.layout.doClick(); |
---|
| 851 | + //frame.setVisible(true); |
---|
617 | 852 | } |
---|
618 | | - cameraView.ToggleFullScreen(); |
---|
| 853 | + frame.validate(); |
---|
| 854 | + |
---|
| 855 | + cameraView.requestFocusInWindow(); |
---|
619 | 856 | } |
---|
620 | 857 | |
---|
621 | | - private JTextArea createTextPane() |
---|
| 858 | + private Object3D CompressCopy() |
---|
622 | 859 | { |
---|
623 | | - String[] initString = |
---|
624 | | - { |
---|
625 | | - "This is an editable JTextPane, ", //regular |
---|
626 | | - "another ", //italic |
---|
627 | | - "styled ", //bold |
---|
628 | | - "text ", //small |
---|
629 | | - "component, ", //large |
---|
630 | | - "which supports embedded components..." + newline,//regular |
---|
631 | | - " " + newline, //button |
---|
632 | | - "...and embedded icons..." + newline, //regular |
---|
633 | | - " ", //icon |
---|
634 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
635 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
636 | | - + "cover methods for interacting with those objects." |
---|
637 | | - }; |
---|
| 860 | + boolean temp = CameraPane.SWITCH; |
---|
| 861 | + CameraPane.SWITCH = false; |
---|
| 862 | + |
---|
| 863 | + copy.ExtractBigData(versiontable); |
---|
| 864 | + // if (copy == client) |
---|
| 865 | + |
---|
| 866 | + Object3D versions[] = copy.versionlist; |
---|
| 867 | + copy.versionlist = null; |
---|
| 868 | + |
---|
| 869 | + //byte[] compress = Compress(copy); |
---|
| 870 | + Object3D compress = (Object3D)Grafreed.clone(copy); |
---|
| 871 | + |
---|
| 872 | + copy.versionlist = versions; |
---|
| 873 | + |
---|
| 874 | + copy.RestoreBigData(versiontable); |
---|
| 875 | + |
---|
| 876 | + CameraPane.SWITCH = temp; |
---|
| 877 | + |
---|
| 878 | + return compress; |
---|
| 879 | + } |
---|
638 | 880 | |
---|
639 | | - String[] initStyles = |
---|
640 | | - { |
---|
641 | | - "regular", "italic", "bold", "small", "large", |
---|
642 | | - "regular", "button", "regular", "icon", |
---|
643 | | - "regular" |
---|
644 | | - }; |
---|
| 881 | + private JTextPane createTextPane() |
---|
| 882 | + { |
---|
| 883 | +// TEXTAREA String[] initString = |
---|
| 884 | +// { |
---|
| 885 | +// "This is an editable JTextPane, ", //regular |
---|
| 886 | +// "another ", //italic |
---|
| 887 | +// "styled ", //bold |
---|
| 888 | +// "text ", //small |
---|
| 889 | +// "component, ", //large |
---|
| 890 | +// "which supports embedded components..." + newline,//regular |
---|
| 891 | +// " " + newline, //button |
---|
| 892 | +// "...and embedded icons..." + newline, //regular |
---|
| 893 | +// " ", //icon |
---|
| 894 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 895 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 896 | +// + "cover methods for interacting with those objects." |
---|
| 897 | +// }; |
---|
| 898 | +// |
---|
| 899 | +// String[] initStyles = |
---|
| 900 | +// { |
---|
| 901 | +// "regular", "italic", "bold", "small", "large", |
---|
| 902 | +// "regular", "button", "regular", "icon", |
---|
| 903 | +// "regular" |
---|
| 904 | +// }; |
---|
| 905 | +// |
---|
| 906 | +// JTextPane textPane = new JTextPane(); |
---|
| 907 | +// textPane.setEditable(true); |
---|
| 908 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 909 | +// addStylesToDocument(doc); |
---|
| 910 | +// |
---|
| 911 | +// try |
---|
| 912 | +// { |
---|
| 913 | +// for (int j = 0; j < 2; j++) |
---|
| 914 | +// { |
---|
| 915 | +// for (int i = 0; i < initString.length; i++) |
---|
| 916 | +// { |
---|
| 917 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 918 | +// doc.getStyle(initStyles[i])); |
---|
| 919 | +// } |
---|
| 920 | +// } |
---|
| 921 | +// } catch (BadLocationException ble) |
---|
| 922 | +// { |
---|
| 923 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 924 | +// } |
---|
645 | 925 | |
---|
646 | | - JTextPane textPane = new JTextPane(); |
---|
647 | | - textPane.setEditable(true); |
---|
648 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
649 | | - addStylesToDocument(doc); |
---|
650 | | - |
---|
651 | | - try |
---|
652 | | - { |
---|
653 | | - for (int j = 0; j < 2; j++) |
---|
654 | | - { |
---|
655 | | - for (int i = 0; i < initString.length; i++) |
---|
656 | | - { |
---|
657 | | - doc.insertString(doc.getLength(), initString[i], |
---|
658 | | - doc.getStyle(initStyles[i])); |
---|
659 | | - } |
---|
660 | | - } |
---|
661 | | - } catch (BadLocationException ble) |
---|
662 | | - { |
---|
663 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
664 | | - } |
---|
665 | | - |
---|
666 | | - return new JTextArea(); // textPane; |
---|
| 926 | + return new JTextPane(); // textPane; |
---|
667 | 927 | } |
---|
668 | 928 | |
---|
669 | 929 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
716 | 976 | protected static ImageIcon createImageIcon(String path, |
---|
717 | 977 | String description) |
---|
718 | 978 | { |
---|
719 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 979 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
720 | 980 | if (imgURL != null) |
---|
721 | 981 | { |
---|
722 | 982 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
739 | 999 | { |
---|
740 | 1000 | SetupMaterial(materialPanel); |
---|
741 | 1001 | } |
---|
| 1002 | + |
---|
742 | 1003 | //SetupName(); |
---|
743 | 1004 | //SetupViews(); |
---|
744 | 1005 | } |
---|
.. | .. |
---|
748 | 1009 | // NumberSlider vDivsField; |
---|
749 | 1010 | // JCheckBox endcaps; |
---|
750 | 1011 | JCheckBox liveCB; |
---|
| 1012 | + JCheckBox selectableCB; |
---|
751 | 1013 | JCheckBox hideCB; |
---|
752 | 1014 | JCheckBox link2masterCB; |
---|
753 | 1015 | JCheckBox markCB; |
---|
.. | .. |
---|
755 | 1017 | JCheckBox speedupCB; |
---|
756 | 1018 | JCheckBox rewindCB; |
---|
757 | 1019 | JCheckBox flipVCB; |
---|
| 1020 | + |
---|
| 1021 | + cCheckBox toggleTextureCB; |
---|
| 1022 | + cCheckBox toggleSwitchCB; |
---|
| 1023 | + |
---|
758 | 1024 | JComboBox texresMenu; |
---|
| 1025 | + |
---|
759 | 1026 | JButton resetButton; |
---|
760 | 1027 | JButton stepButton; |
---|
761 | 1028 | JButton stepAllButton; |
---|
.. | .. |
---|
763 | 1030 | JButton slowerButton; |
---|
764 | 1031 | JButton fasterButton; |
---|
765 | 1032 | JButton remarkButton; |
---|
| 1033 | + |
---|
| 1034 | + cGridBag editPanel; |
---|
| 1035 | + cGridBag editCommandsPanel; |
---|
| 1036 | + |
---|
| 1037 | + cGridBag namePanel; |
---|
| 1038 | + cGridBag setupPanel; |
---|
| 1039 | + cGridBag setupPanel2; |
---|
| 1040 | + cGridBag objectCommandsPanel; |
---|
| 1041 | + cGridBag pushPanel; |
---|
| 1042 | + cGridBag fillPanel; |
---|
766 | 1043 | |
---|
767 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 1044 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
768 | 1045 | { |
---|
769 | 1046 | JCheckBox cb; |
---|
770 | 1047 | |
---|
771 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
772 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
773 | | -// oe.aConstraints.weightx = 1; |
---|
774 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
775 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1048 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
776 | 1049 | cb.addItemListener(this); |
---|
777 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
778 | | - oe.aConstraints.gridwidth = 1; |
---|
779 | | - oe.aConstraints.gridx += 1; |
---|
780 | 1050 | |
---|
781 | 1051 | return cb; |
---|
782 | 1052 | } |
---|
783 | 1053 | |
---|
784 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 1054 | + cButton AddButton(cGridBag panel, String label) |
---|
785 | 1055 | { |
---|
786 | 1056 | cButton cb; |
---|
787 | 1057 | |
---|
788 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
789 | | - oe.aConstraints.gridwidth = 1; |
---|
790 | | -// oe.aConstraints.weightx = 1; |
---|
791 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
792 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 1058 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
793 | 1059 | cb.addActionListener(this); |
---|
794 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
795 | | - oe.aConstraints.gridwidth = 1; |
---|
796 | | - oe.aConstraints.gridx += 1; |
---|
797 | 1060 | |
---|
798 | 1061 | return cb; |
---|
799 | 1062 | } |
---|
800 | 1063 | |
---|
801 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 1064 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
802 | 1065 | { |
---|
803 | 1066 | JComboBox combo; |
---|
804 | 1067 | |
---|
805 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
806 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
807 | | - oe.aConstraints.gridx += 1; |
---|
| 1068 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
808 | 1069 | combo.addActionListener(this); |
---|
809 | 1070 | |
---|
810 | 1071 | return combo; |
---|
811 | 1072 | } |
---|
812 | 1073 | |
---|
813 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 1074 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
814 | 1075 | { |
---|
815 | | - NumberSlider combo; |
---|
| 1076 | + cGridBag control = new cGridBag(); |
---|
| 1077 | + |
---|
| 1078 | + cNumberSlider combo; |
---|
816 | 1079 | |
---|
817 | 1080 | JLabel jlabel = new JLabel(label); |
---|
818 | | - |
---|
819 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
820 | 1081 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
821 | | - aConstraints.gridwidth = 1; |
---|
822 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
823 | | - aConstraints.gridx += 1; |
---|
824 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
825 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
826 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
827 | | - aConstraints.gridx += 1; |
---|
828 | | - aConstraints.gridwidth = 1; |
---|
829 | | - |
---|
| 1082 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1083 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
830 | 1084 | combo.setFloat(current); |
---|
831 | | - |
---|
832 | | - combo.label = jlabel; |
---|
833 | | - |
---|
834 | | - combo.addChangeListener(this); |
---|
835 | | - |
---|
836 | | - return combo; |
---|
| 1085 | + |
---|
| 1086 | + panel.add(control); |
---|
| 1087 | + |
---|
| 1088 | + return control; |
---|
837 | 1089 | } |
---|
838 | 1090 | |
---|
839 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 1091 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
840 | 1092 | { |
---|
841 | | - NumberSlider combo; |
---|
| 1093 | + cGridBag control = new cGridBag(); |
---|
| 1094 | + |
---|
| 1095 | + cNumberSlider combo; |
---|
842 | 1096 | |
---|
843 | 1097 | JLabel jlabel = new JLabel(label); |
---|
844 | | - |
---|
845 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
846 | 1098 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
847 | | - aConstraints.gridwidth = 2; |
---|
848 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
849 | | - aConstraints.gridx += 1; |
---|
850 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
851 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
852 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
853 | | - aConstraints.gridx += 1; |
---|
854 | | - aConstraints.gridwidth = 1; |
---|
855 | | - |
---|
| 1099 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1100 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
856 | 1101 | combo.setInteger(current); |
---|
857 | 1102 | |
---|
858 | | - combo.label = jlabel; |
---|
859 | | - |
---|
860 | | - combo.addChangeListener(this); |
---|
861 | | - |
---|
862 | | - return combo; |
---|
| 1103 | + panel.add(control); |
---|
| 1104 | + |
---|
| 1105 | + return control; |
---|
863 | 1106 | } |
---|
864 | 1107 | |
---|
865 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 1108 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
866 | 1109 | { |
---|
867 | 1110 | JTextArea text; |
---|
868 | 1111 | |
---|
869 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
870 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
871 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1112 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
872 | 1113 | text.addCaretListener(this); |
---|
873 | | - aConstraints.gridx += 1; |
---|
874 | | - aConstraints.gridwidth = 1; |
---|
875 | 1114 | |
---|
876 | 1115 | return text; |
---|
877 | 1116 | } |
---|
.. | .. |
---|
901 | 1140 | objEditor.ctrlPanel.remove(j); |
---|
902 | 1141 | } |
---|
903 | 1142 | |
---|
| 1143 | + void Remove(cNumberSlider j) |
---|
| 1144 | + { |
---|
| 1145 | + j.removeChangeListener(this); |
---|
| 1146 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 1147 | + objEditor.ctrlPanel.remove(j); |
---|
| 1148 | + } |
---|
| 1149 | + |
---|
904 | 1150 | /* |
---|
905 | 1151 | */ |
---|
906 | | - void Return() // ObjEditor oe) |
---|
| 1152 | + void Return0() // ObjEditor oe) |
---|
907 | 1153 | { |
---|
908 | 1154 | aConstraints.gridy += 1; |
---|
909 | 1155 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
958 | 1204 | |
---|
959 | 1205 | void SetupUI2(ObjEditor oe) |
---|
960 | 1206 | { |
---|
961 | | -// oe.aConstraints.weightx = 0; |
---|
962 | | -// oe.aConstraints.weighty = 0; |
---|
963 | | -// oe.aConstraints.gridx = 0; |
---|
964 | | -// oe.aConstraints.gridy = 0; |
---|
965 | | - SetupName(oe); |
---|
| 1207 | + //SetupName(oe); |
---|
966 | 1208 | |
---|
967 | | - if (!GroupEditor.allparams) |
---|
| 1209 | + namePanel = new cGridBag(); |
---|
| 1210 | + |
---|
| 1211 | + //if (copy.pinned) |
---|
| 1212 | + { |
---|
| 1213 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1214 | + pinButton.setSelected(copy.pinned); |
---|
| 1215 | + cGridBag t = new cGridBag(); |
---|
| 1216 | + t.preferredWidth = 2; |
---|
| 1217 | + t.add(pinButton); |
---|
| 1218 | + namePanel.add(t); |
---|
| 1219 | + |
---|
| 1220 | + pinButton.addItemListener(this); |
---|
| 1221 | + } |
---|
| 1222 | + |
---|
| 1223 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 1224 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
| 1225 | + oe.ctrlPanel.add(namePanel); |
---|
| 1226 | + |
---|
| 1227 | + oe.ctrlPanel.Return(); |
---|
| 1228 | + |
---|
| 1229 | + if (!allparams) |
---|
968 | 1230 | return; |
---|
969 | 1231 | |
---|
970 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
971 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
972 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1232 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1233 | + |
---|
| 1234 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1235 | + liveCB.setToolTipText("Animate object"); |
---|
| 1236 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1237 | + selectableCB.setToolTipText("Make object selectable"); |
---|
973 | 1238 | // Return(); |
---|
974 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
975 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
976 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
977 | | - Return(); |
---|
978 | | - resetButton = AddButton(oe, "Reset"); |
---|
979 | | - stepButton = AddButton(oe, "Step"); |
---|
| 1239 | + |
---|
| 1240 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1241 | + hideCB.setToolTipText("Hide object"); |
---|
| 1242 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 1243 | + markCB.setToolTipText("As animation target transform"); |
---|
| 1244 | + |
---|
| 1245 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
| 1246 | + |
---|
| 1247 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1248 | + |
---|
| 1249 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1250 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1251 | + |
---|
| 1252 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1253 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
| 1254 | + |
---|
| 1255 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1256 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1257 | + |
---|
| 1258 | + if (Globals.ADVANCED) |
---|
| 1259 | + { |
---|
| 1260 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1261 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1262 | + } |
---|
| 1263 | + |
---|
| 1264 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1265 | + oe.ctrlPanel.Return(); |
---|
| 1266 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1267 | + oe.ctrlPanel.Return(); |
---|
| 1268 | + |
---|
| 1269 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
| 1270 | + |
---|
| 1271 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1272 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1273 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1274 | + stepButton.setToolTipText("Step one frame"); |
---|
980 | 1275 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
981 | 1276 | // stepAllButton = AddButton(oe, "Step All"); |
---|
982 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
983 | 1277 | // Return(); |
---|
984 | | - slowerButton = AddButton(oe, "Slow"); |
---|
985 | | - fasterButton = AddButton(oe, "Fast"); |
---|
986 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1278 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1279 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1280 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1281 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1282 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1283 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
987 | 1284 | |
---|
988 | | - Return(); |
---|
| 1285 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
| 1286 | + oe.ctrlPanel.Return(); |
---|
989 | 1287 | |
---|
990 | | - normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
991 | | - Return(); |
---|
| 1288 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1289 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1290 | + //Return(); |
---|
| 1291 | + |
---|
| 1292 | + oe.ctrlPanel.Return(); |
---|
992 | 1293 | |
---|
993 | 1294 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
994 | 1295 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1083 | 1384 | oe.aConstraints.gridwidth = 1; |
---|
1084 | 1385 | /**/ |
---|
1085 | 1386 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1086 | | - Return(); |
---|
| 1387 | + oe.ctrlPanel.Return(); |
---|
1087 | 1388 | |
---|
1088 | 1389 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1089 | 1390 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1185 | 1486 | //JPanel worldPanel = |
---|
1186 | 1487 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1187 | 1488 | //worldPanel.setName("World"); |
---|
1188 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
1189 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1190 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1489 | + centralPanel = new cGridBag(); |
---|
| 1490 | + centralPanel.preferredWidth = 20; |
---|
| 1491 | + |
---|
| 1492 | + if (Globals.ADVANCED) |
---|
| 1493 | + { |
---|
| 1494 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1495 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1191 | 1496 | |
---|
1192 | 1497 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1193 | 1498 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1196 | 1501 | // cameraPanel.setDividerSize(9); |
---|
1197 | 1502 | cameraPanel.setResizeWeight(1.0); |
---|
1198 | 1503 | |
---|
| 1504 | + } |
---|
| 1505 | + |
---|
1199 | 1506 | centralPanel.add(cameraView); |
---|
| 1507 | + centralPanel.setFocusable(true); |
---|
1200 | 1508 | //frame.setJMenuBar(timelineMenubar); |
---|
1201 | 1509 | //centralPanel.add(timelinePanel); |
---|
1202 | 1510 | |
---|
.. | .. |
---|
1215 | 1523 | //frontView.object = copy; |
---|
1216 | 1524 | //sideView.object = copy; |
---|
1217 | 1525 | |
---|
1218 | | - XYZPanel = new JPanel(); |
---|
1219 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1526 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1527 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1220 | 1528 | |
---|
1221 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1222 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1223 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1529 | + XYZPanel.preferredWidth = 5; |
---|
| 1530 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1531 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1532 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1533 | + //XYZPanel.setName("XYZ"); |
---|
1224 | 1534 | |
---|
1225 | 1535 | /* |
---|
1226 | 1536 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1258 | 1568 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1259 | 1569 | //tmp.setName("Edit"); |
---|
1260 | 1570 | objectPanel.add(materialPanel); |
---|
1261 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1262 | | - north.setName("Edit"); |
---|
1263 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1264 | | - objectPanel.add(north); |
---|
1265 | | - objectPanel.add(infoPanel); |
---|
| 1571 | + objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1572 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1573 | + |
---|
| 1574 | + objectPanel.add(toolboxPanel); |
---|
| 1575 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1576 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
1266 | 1577 | |
---|
| 1578 | + objectPanel.add(skyboxPanel); |
---|
| 1579 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1580 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1581 | + |
---|
| 1582 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1583 | +// north.setName("Edit"); |
---|
| 1584 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1585 | +// objectPanel.add(north); |
---|
| 1586 | + objectPanel.add(editPanel); |
---|
| 1587 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1588 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
| 1589 | + |
---|
| 1590 | + objectPanel.add(XYZPanel); |
---|
| 1591 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1592 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
| 1593 | + |
---|
1267 | 1594 | /* |
---|
1268 | 1595 | aConstraints.gridx = 0; |
---|
1269 | 1596 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1271 | 1598 | aConstraints.gridy += 1; |
---|
1272 | 1599 | aConstraints.gridwidth = 1; |
---|
1273 | 1600 | mainPanel.add(objectPanel, aConstraints); |
---|
1274 | | - */ |
---|
| 1601 | + */ |
---|
1275 | 1602 | |
---|
1276 | 1603 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1277 | 1604 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1282 | 1609 | scrollpane.setWheelScrollingEnabled(true); |
---|
1283 | 1610 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1284 | 1611 | |
---|
1285 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1286 | | - scenePanel.add(scrollpane); |
---|
| 1612 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1613 | + scenePanel.preferredWidth = 5; |
---|
| 1614 | + |
---|
| 1615 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1616 | + tabbedPane.add(scrollpane); |
---|
1287 | 1617 | |
---|
1288 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
1289 | | - |
---|
1290 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1618 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1291 | 1619 | |
---|
1292 | 1620 | optionsPanel.setName("Options"); |
---|
1293 | | - scenePanel.add(optionsPanel); |
---|
| 1621 | + |
---|
| 1622 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1623 | + |
---|
| 1624 | + tabbedPane.add(optionsPanel); |
---|
| 1625 | + |
---|
| 1626 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1294 | 1627 | |
---|
| 1628 | + scenePanel.add(tabbedPane); |
---|
1295 | 1629 | |
---|
| 1630 | + //if (Globals.ADVANCED) |
---|
| 1631 | + tabbedPane.add(infoPanel); |
---|
| 1632 | + tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1633 | + tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1634 | + |
---|
1296 | 1635 | /* |
---|
1297 | 1636 | cTree jTree = new cTree(null); |
---|
1298 | 1637 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1325 | 1664 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1326 | 1665 | //bigPanel.add(ctrlPanel); |
---|
1327 | 1666 | //bigPanel.add(gridPanel); |
---|
| 1667 | + /** |
---|
1328 | 1668 | bigThree = new JPanel(); |
---|
1329 | 1669 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1330 | 1670 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1348 | 1688 | // aConstraints.gridheight = 3; |
---|
1349 | 1689 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1350 | 1690 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1691 | + /**/ |
---|
1351 | 1692 | |
---|
| 1693 | + bigThree = new cGridBag(); |
---|
| 1694 | + bigThree.addComponent(scenePanel); |
---|
| 1695 | + bigThree.addComponent(centralPanel); |
---|
| 1696 | + //bigThree.addComponent(XYZPanel); |
---|
| 1697 | + |
---|
1352 | 1698 | // // SIDE EFFECT!!! |
---|
1353 | 1699 | // aConstraints.gridx = 0; |
---|
1354 | 1700 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1356 | 1702 | // aConstraints.gridheight = 1; |
---|
1357 | 1703 | |
---|
1358 | 1704 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1359 | | - framePanel.setContinuousLayout(true); |
---|
1360 | | - framePanel.setOneTouchExpandable(true); |
---|
1361 | | - framePanel.setDividerLocation(0.8); |
---|
| 1705 | + framePanel.setContinuousLayout(false); |
---|
| 1706 | + framePanel.setOneTouchExpandable(false); |
---|
| 1707 | + //.setDividerLocation(0.8); |
---|
1362 | 1708 | //framePanel.setDividerSize(15); |
---|
1363 | 1709 | //framePanel.setResizeWeight(0.15); |
---|
1364 | 1710 | framePanel.setName("Frame"); |
---|
.. | .. |
---|
1369 | 1715 | //worldPane.add(bigPanel); |
---|
1370 | 1716 | //worldPane.add(worldPanel); |
---|
1371 | 1717 | /**/ |
---|
1372 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1718 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1719 | + frame.add(/*"Center",*/framePanel); |
---|
1373 | 1720 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1374 | 1721 | |
---|
1375 | 1722 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1376 | 1723 | |
---|
1377 | | - frame.setSize(1024, 768); |
---|
1378 | | - frame.show(); |
---|
1379 | | - |
---|
| 1724 | + frame.setSize(1280, 860); |
---|
| 1725 | + |
---|
| 1726 | + cameraView.requestFocusInWindow(); |
---|
| 1727 | + |
---|
1380 | 1728 | gridPanel.setDividerLocation(1.0); |
---|
| 1729 | + |
---|
| 1730 | + frame.validate(); |
---|
| 1731 | + |
---|
| 1732 | + frame.setVisible(true); |
---|
1381 | 1733 | |
---|
1382 | 1734 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1383 | 1735 | frame.addWindowListener(new WindowAdapter() |
---|
1384 | 1736 | { |
---|
1385 | | - |
---|
1386 | 1737 | public void windowClosing(WindowEvent e) |
---|
1387 | 1738 | { |
---|
1388 | 1739 | Close(); |
---|
.. | .. |
---|
1390 | 1741 | }); |
---|
1391 | 1742 | } |
---|
1392 | 1743 | |
---|
| 1744 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1745 | + { |
---|
| 1746 | + } |
---|
| 1747 | + |
---|
1393 | 1748 | JTree GetTree() |
---|
1394 | 1749 | { |
---|
1395 | 1750 | return objEditor.jTree; |
---|
.. | .. |
---|
1401 | 1756 | ctrlPanel.removeAll(); |
---|
1402 | 1757 | } |
---|
1403 | 1758 | |
---|
1404 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1759 | + void SetupMaterial(cGridBag materialpanel) |
---|
1405 | 1760 | { |
---|
1406 | | - aConstraints.weighty = 0; |
---|
1407 | | - //aConstraints.weightx = 1; |
---|
1408 | | - /* |
---|
| 1761 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1762 | + |
---|
| 1763 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1764 | + skin.setToolTipText("Skin"); |
---|
| 1765 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1766 | + { |
---|
| 1767 | + public void mouseClicked(MouseEvent e) |
---|
| 1768 | + { |
---|
| 1769 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1770 | + cMaterial material = object.material; |
---|
| 1771 | + |
---|
| 1772 | + // Skin |
---|
| 1773 | + colorField.setFloat(material.color); |
---|
| 1774 | + saturationField.setFloat(material.modulation); |
---|
| 1775 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1776 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1777 | + diffusenessField.setFloat(material.factor); |
---|
| 1778 | + shininessField.setFloat(material.shininess); |
---|
| 1779 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1780 | + diffuseField.setFloat(material.diffuse); |
---|
| 1781 | + specularField.setFloat(material.specular); |
---|
| 1782 | + |
---|
| 1783 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1784 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1785 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1786 | + |
---|
| 1787 | + materialtouched = true; |
---|
| 1788 | + applySelf(); |
---|
| 1789 | + } |
---|
| 1790 | + }); |
---|
| 1791 | + presetpanel.add(skin); |
---|
| 1792 | + |
---|
| 1793 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1794 | + lambert.setToolTipText("Diffuse"); |
---|
| 1795 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1796 | + { |
---|
| 1797 | + public void mouseClicked(MouseEvent e) |
---|
| 1798 | + { |
---|
| 1799 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1800 | + cMaterial material = object.material; |
---|
| 1801 | + |
---|
| 1802 | + diffusenessField.setFloat(material.factor); |
---|
| 1803 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1804 | + |
---|
| 1805 | + materialtouched = true; |
---|
| 1806 | + applySelf(); |
---|
| 1807 | + } |
---|
| 1808 | + }); |
---|
| 1809 | + presetpanel.add(lambert); |
---|
| 1810 | + |
---|
| 1811 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1812 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1813 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1814 | + { |
---|
| 1815 | + public void mouseClicked(MouseEvent e) |
---|
| 1816 | + { |
---|
| 1817 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1818 | + cMaterial material = object.material; |
---|
| 1819 | + |
---|
| 1820 | + diffusenessField.setFloat(material.factor); |
---|
| 1821 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1822 | + |
---|
| 1823 | + materialtouched = true; |
---|
| 1824 | + applySelf(); |
---|
| 1825 | + } |
---|
| 1826 | + }); |
---|
| 1827 | + presetpanel.add(diffuse2); |
---|
| 1828 | + |
---|
| 1829 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1830 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1831 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1832 | + { |
---|
| 1833 | + public void mouseClicked(MouseEvent e) |
---|
| 1834 | + { |
---|
| 1835 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1836 | + cMaterial material = object.material; |
---|
| 1837 | + |
---|
| 1838 | + diffusenessField.setFloat(material.factor); |
---|
| 1839 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1840 | + |
---|
| 1841 | + materialtouched = true; |
---|
| 1842 | + applySelf(); |
---|
| 1843 | + } |
---|
| 1844 | + }); |
---|
| 1845 | + presetpanel.add(diffusemoon); |
---|
| 1846 | + |
---|
| 1847 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1848 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1849 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1850 | + { |
---|
| 1851 | + public void mouseClicked(MouseEvent e) |
---|
| 1852 | + { |
---|
| 1853 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1854 | + cMaterial material = object.material; |
---|
| 1855 | + |
---|
| 1856 | + diffusenessField.setFloat(material.factor); |
---|
| 1857 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1858 | + |
---|
| 1859 | + materialtouched = true; |
---|
| 1860 | + applySelf(); |
---|
| 1861 | + } |
---|
| 1862 | + }); |
---|
| 1863 | + presetpanel.add(diffusemoon2); |
---|
| 1864 | + |
---|
| 1865 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1866 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1867 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1868 | + { |
---|
| 1869 | + public void mouseClicked(MouseEvent e) |
---|
| 1870 | + { |
---|
| 1871 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1872 | + cMaterial material = object.material; |
---|
| 1873 | + |
---|
| 1874 | + diffusenessField.setFloat(material.factor); |
---|
| 1875 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1876 | + |
---|
| 1877 | + materialtouched = true; |
---|
| 1878 | + applySelf(); |
---|
| 1879 | + } |
---|
| 1880 | + }); |
---|
| 1881 | + presetpanel.add(diffusemoon3); |
---|
| 1882 | + |
---|
| 1883 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1884 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 1885 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 1886 | + { |
---|
| 1887 | + public void mouseClicked(MouseEvent e) |
---|
| 1888 | + { |
---|
| 1889 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 1890 | + cMaterial material = object.material; |
---|
| 1891 | + |
---|
| 1892 | + sheenField.setFloat(material.sheen); |
---|
| 1893 | + |
---|
| 1894 | + materialtouched = true; |
---|
| 1895 | + applySelf(); |
---|
| 1896 | + } |
---|
| 1897 | + }); |
---|
| 1898 | + presetpanel.add(diffusesheen); |
---|
| 1899 | + |
---|
| 1900 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 1901 | + rough.setToolTipText("Rough metal"); |
---|
| 1902 | + rough.addMouseListener(new MouseAdapter() |
---|
| 1903 | + { |
---|
| 1904 | + public void mouseClicked(MouseEvent e) |
---|
| 1905 | + { |
---|
| 1906 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 1907 | + cMaterial material = object.material; |
---|
| 1908 | + |
---|
| 1909 | + shininessField.setFloat(material.shininess); |
---|
| 1910 | + velvetField.setFloat(material.velvet); |
---|
| 1911 | + |
---|
| 1912 | + materialtouched = true; |
---|
| 1913 | + applySelf(); |
---|
| 1914 | + } |
---|
| 1915 | + }); |
---|
| 1916 | + presetpanel.add(rough); |
---|
| 1917 | + |
---|
| 1918 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 1919 | + rough2.setToolTipText("Medium metal"); |
---|
| 1920 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 1921 | + { |
---|
| 1922 | + public void mouseClicked(MouseEvent e) |
---|
| 1923 | + { |
---|
| 1924 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 1925 | + cMaterial material = object.material; |
---|
| 1926 | + |
---|
| 1927 | + shininessField.setFloat(material.shininess); |
---|
| 1928 | + lightareaField.setFloat(material.lightarea); |
---|
| 1929 | + |
---|
| 1930 | + materialtouched = true; |
---|
| 1931 | + applySelf(); |
---|
| 1932 | + } |
---|
| 1933 | + }); |
---|
| 1934 | + presetpanel.add(rough2); |
---|
| 1935 | + |
---|
| 1936 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 1937 | + shini0.setToolTipText("Shiny"); |
---|
| 1938 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 1939 | + { |
---|
| 1940 | + public void mouseClicked(MouseEvent e) |
---|
| 1941 | + { |
---|
| 1942 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 1943 | + cMaterial material = object.material; |
---|
| 1944 | + |
---|
| 1945 | + shininessField.setFloat(material.shininess); |
---|
| 1946 | + lightareaField.setFloat(material.lightarea); |
---|
| 1947 | + |
---|
| 1948 | + materialtouched = true; |
---|
| 1949 | + applySelf(); |
---|
| 1950 | + } |
---|
| 1951 | + }); |
---|
| 1952 | + presetpanel.add(shini0); |
---|
| 1953 | + |
---|
| 1954 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 1955 | + shini1.setToolTipText("Shiny2"); |
---|
| 1956 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 1957 | + { |
---|
| 1958 | + public void mouseClicked(MouseEvent e) |
---|
| 1959 | + { |
---|
| 1960 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 1961 | + cMaterial material = object.material; |
---|
| 1962 | + |
---|
| 1963 | + shininessField.setFloat(material.shininess); |
---|
| 1964 | + lightareaField.setFloat(material.lightarea); |
---|
| 1965 | + |
---|
| 1966 | + materialtouched = true; |
---|
| 1967 | + applySelf(); |
---|
| 1968 | + } |
---|
| 1969 | + }); |
---|
| 1970 | + presetpanel.add(shini1); |
---|
| 1971 | + |
---|
| 1972 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 1973 | + shini2.setToolTipText("Shiny3"); |
---|
| 1974 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 1975 | + { |
---|
| 1976 | + public void mouseClicked(MouseEvent e) |
---|
| 1977 | + { |
---|
| 1978 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 1979 | + cMaterial material = object.material; |
---|
| 1980 | + |
---|
| 1981 | + shininessField.setFloat(material.shininess); |
---|
| 1982 | + lightareaField.setFloat(material.lightarea); |
---|
| 1983 | + |
---|
| 1984 | + materialtouched = true; |
---|
| 1985 | + applySelf(); |
---|
| 1986 | + } |
---|
| 1987 | + }); |
---|
| 1988 | + presetpanel.add(shini2); |
---|
| 1989 | + |
---|
| 1990 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 1991 | + aniso.setToolTipText("AnisoU"); |
---|
| 1992 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 1993 | + { |
---|
| 1994 | + public void mouseClicked(MouseEvent e) |
---|
| 1995 | + { |
---|
| 1996 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 1997 | + cMaterial material = object.material; |
---|
| 1998 | + |
---|
| 1999 | + anisoField.setFloat(material.aniso); |
---|
| 2000 | + anisoVField.setFloat(material.anisoV); |
---|
| 2001 | + |
---|
| 2002 | + materialtouched = true; |
---|
| 2003 | + applySelf(); |
---|
| 2004 | + } |
---|
| 2005 | + }); |
---|
| 2006 | + presetpanel.add(aniso); |
---|
| 2007 | + |
---|
| 2008 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2009 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2010 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2011 | + { |
---|
| 2012 | + public void mouseClicked(MouseEvent e) |
---|
| 2013 | + { |
---|
| 2014 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2015 | + cMaterial material = object.material; |
---|
| 2016 | + |
---|
| 2017 | + anisoField.setFloat(material.aniso); |
---|
| 2018 | + anisoVField.setFloat(material.anisoV); |
---|
| 2019 | + |
---|
| 2020 | + materialtouched = true; |
---|
| 2021 | + applySelf(); |
---|
| 2022 | + } |
---|
| 2023 | + }); |
---|
| 2024 | + presetpanel.add(aniso2); |
---|
| 2025 | + |
---|
| 2026 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2027 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2028 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2029 | + { |
---|
| 2030 | + public void mouseClicked(MouseEvent e) |
---|
| 2031 | + { |
---|
| 2032 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2033 | + cMaterial material = object.material; |
---|
| 2034 | + |
---|
| 2035 | + anisoField.setFloat(material.aniso); |
---|
| 2036 | + anisoVField.setFloat(material.anisoV); |
---|
| 2037 | + |
---|
| 2038 | + materialtouched = true; |
---|
| 2039 | + applySelf(); |
---|
| 2040 | + } |
---|
| 2041 | + }); |
---|
| 2042 | + presetpanel.add(aniso3); |
---|
| 2043 | + |
---|
| 2044 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2045 | + velvet0.setToolTipText("Velvet"); |
---|
| 2046 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2047 | + { |
---|
| 2048 | + public void mouseClicked(MouseEvent e) |
---|
| 2049 | + { |
---|
| 2050 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2051 | + cMaterial material = object.material; |
---|
| 2052 | + |
---|
| 2053 | + diffusenessField.setFloat(material.factor); |
---|
| 2054 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2055 | + sheenField.setFloat(material.sheen); |
---|
| 2056 | + shininessField.setFloat(material.shininess); |
---|
| 2057 | + velvetField.setFloat(material.velvet); |
---|
| 2058 | + shiftField.setFloat(material.shift); |
---|
| 2059 | + |
---|
| 2060 | + materialtouched = true; |
---|
| 2061 | + applySelf(); |
---|
| 2062 | + } |
---|
| 2063 | + }); |
---|
| 2064 | + presetpanel.add(velvet0); |
---|
| 2065 | + |
---|
| 2066 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2067 | + bump0.setToolTipText("Bump texture"); |
---|
| 2068 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2069 | + { |
---|
| 2070 | + public void mouseClicked(MouseEvent e) |
---|
| 2071 | + { |
---|
| 2072 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2073 | + cMaterial material = object.material; |
---|
| 2074 | + |
---|
| 2075 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2076 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2077 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2078 | + |
---|
| 2079 | + materialtouched = true; |
---|
| 2080 | + applySelf(); |
---|
| 2081 | + } |
---|
| 2082 | + }); |
---|
| 2083 | + presetpanel.add(bump0); |
---|
| 2084 | + |
---|
| 2085 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2086 | + halo.setToolTipText("Halo"); |
---|
| 2087 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2088 | + { |
---|
| 2089 | + public void mouseClicked(MouseEvent e) |
---|
| 2090 | + { |
---|
| 2091 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2092 | + cMaterial material = object.material; |
---|
| 2093 | + |
---|
| 2094 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2095 | + |
---|
| 2096 | + materialtouched = true; |
---|
| 2097 | + applySelf(); |
---|
| 2098 | + } |
---|
| 2099 | + }); |
---|
| 2100 | + presetpanel.add(halo); |
---|
| 2101 | + |
---|
| 2102 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2103 | + candle.setToolTipText("Candle"); |
---|
| 2104 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2105 | + { |
---|
| 2106 | + public void mouseClicked(MouseEvent e) |
---|
| 2107 | + { |
---|
| 2108 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2109 | + cMaterial material = object.material; |
---|
| 2110 | + |
---|
| 2111 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2112 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2113 | + ambientField.setFloat(material.ambient); |
---|
| 2114 | + specularField.setFloat(material.specular); |
---|
| 2115 | + lightareaField.setFloat(material.lightarea); |
---|
| 2116 | + shininessField.setFloat(material.shininess); |
---|
| 2117 | + |
---|
| 2118 | + materialtouched = true; |
---|
| 2119 | + applySelf(); |
---|
| 2120 | + } |
---|
| 2121 | + }); |
---|
| 2122 | + presetpanel.add(candle); |
---|
| 2123 | + |
---|
| 2124 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2125 | + |
---|
| 2126 | + presetpanel.preferredWidth = 1; |
---|
| 2127 | + |
---|
| 2128 | + materialpanel.add(presetpanel); |
---|
| 2129 | + materialpanel.add(panel); |
---|
| 2130 | + |
---|
| 2131 | + panel.preferredWidth = 8; |
---|
| 2132 | + |
---|
| 2133 | + /* |
---|
1409 | 2134 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1410 | 2135 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1411 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1412 | | - aConstraints.gridx += 1; |
---|
1413 | | - */ |
---|
| 2136 | + */ |
---|
1414 | 2137 | |
---|
1415 | | - aConstraints.gridwidth = 1; |
---|
1416 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1417 | | - aConstraints.gridx += 1; |
---|
1418 | | - aConstraints.weighty = 0; |
---|
1419 | | - aConstraints.gridwidth = 1; |
---|
| 2138 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 2139 | + |
---|
| 2140 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2141 | + createMaterialButton.setToolTipText("Create material"); |
---|
1420 | 2142 | |
---|
1421 | 2143 | /* |
---|
1422 | 2144 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1423 | | - aConstraints.gridx += 1; |
---|
1424 | | - aConstraints.weighty = 0; |
---|
1425 | | - aConstraints.gridwidth = 1; |
---|
1426 | 2145 | */ |
---|
1427 | 2146 | |
---|
1428 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1429 | | - aConstraints.gridx += 1; |
---|
| 2147 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2148 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 2149 | + |
---|
| 2150 | + if (Globals.ADVANCED) |
---|
| 2151 | + { |
---|
| 2152 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2153 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 2154 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 2155 | + } |
---|
1430 | 2156 | |
---|
1431 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1432 | | - |
---|
1433 | | - aConstraints.gridx += 1; |
---|
1434 | | - |
---|
1435 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1436 | | - |
---|
1437 | | - aConstraints.gridx += 1; |
---|
1438 | | - |
---|
1439 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1440 | | - |
---|
1441 | | - aConstraints.gridx = 0; |
---|
1442 | | - aConstraints.gridy += 1; |
---|
1443 | | - aConstraints.weighty = 0; |
---|
1444 | | - aConstraints.gridwidth = 1; |
---|
| 2157 | + editBar.preferredHeight = 15; |
---|
| 2158 | + |
---|
| 2159 | + panel.add(editBar); |
---|
| 2160 | + |
---|
1445 | 2161 | /**/ |
---|
1446 | 2162 | //aConstraints.weighty = 0; |
---|
1447 | 2163 | ////aConstraints.weightx = 1; |
---|
1448 | 2164 | //aConstraints.weighty = 1; |
---|
1449 | 2165 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1450 | 2166 | //aConstraints.gridx += 1; |
---|
1451 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1452 | | - aConstraints.weighty = 0; |
---|
1453 | | - aConstraints.gridx = 0; |
---|
1454 | | - aConstraints.gridy += 1; |
---|
1455 | | - aConstraints.gridwidth = 1; |
---|
| 2167 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1456 | 2168 | |
---|
1457 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1458 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1459 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1460 | | - aConstraints.gridx += 1; |
---|
1461 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1462 | | - //aConstraints.weightx = 0; |
---|
1463 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1464 | | - aConstraints.gridx = 0; |
---|
1465 | | - aConstraints.gridy += 1; |
---|
1466 | | - aConstraints.gridwidth = 1; |
---|
| 2169 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
1467 | 2170 | |
---|
1468 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1469 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1470 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1471 | | - aConstraints.gridx += 1; |
---|
1472 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1473 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1474 | | - aConstraints.gridx = 0; |
---|
1475 | | - aConstraints.gridy += 1; |
---|
1476 | | - aConstraints.gridwidth = 1; |
---|
| 2171 | + cGridBag huepanel = new cGridBag(); |
---|
| 2172 | + cGridBag huelabel = new cGridBag(); |
---|
| 2173 | + skin = GetLabel("icons/hue.png", false); |
---|
| 2174 | + skin.fit = true; |
---|
| 2175 | + huelabel.add(skin); |
---|
| 2176 | + huelabel.preferredWidth = 20; |
---|
| 2177 | + huepanel.add(new cGridBag()); // Label |
---|
| 2178 | + huepanel.add(huelabel); // Field/slider |
---|
| 2179 | + |
---|
| 2180 | + huepanel.preferredHeight = 7; |
---|
1477 | 2181 | |
---|
1478 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1479 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1480 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1481 | | - aConstraints.gridx += 1; |
---|
1482 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1483 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1484 | | - aConstraints.gridx = 0; |
---|
1485 | | - aConstraints.gridy += 1; |
---|
1486 | | - aConstraints.gridwidth = 1; |
---|
| 2182 | + colorSection.add(huepanel); |
---|
| 2183 | + |
---|
| 2184 | + cGridBag color = new cGridBag(); |
---|
| 2185 | + |
---|
| 2186 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2187 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2188 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1487 | 2189 | |
---|
1488 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1489 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1490 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1491 | | - aConstraints.gridx += 1; |
---|
1492 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1493 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1494 | | - aConstraints.gridx = 0; |
---|
1495 | | - aConstraints.gridy += 1; |
---|
1496 | | - aConstraints.gridwidth = 1; |
---|
| 2190 | + //colorField.preferredWidth = 200; |
---|
| 2191 | + colorSection.add(color); |
---|
1497 | 2192 | |
---|
1498 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1499 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1500 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1501 | | - aConstraints.gridx += 1; |
---|
1502 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1503 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1504 | | - aConstraints.gridx = 0; |
---|
1505 | | - aConstraints.gridy += 1; |
---|
1506 | | - aConstraints.gridwidth = 1; |
---|
| 2193 | + cGridBag modulation = new cGridBag(); |
---|
| 2194 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 2195 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2196 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2197 | + colorSection.add(modulation); |
---|
1507 | 2198 | |
---|
1508 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1509 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1510 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1511 | | - aConstraints.gridx += 1; |
---|
1512 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1513 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1514 | | - aConstraints.gridx = 0; |
---|
1515 | | - aConstraints.gridy += 1; |
---|
1516 | | - aConstraints.gridwidth = 1; |
---|
| 2199 | + cGridBag opacity = new cGridBag(); |
---|
| 2200 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2201 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2202 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2203 | + colorSection.add(opacity); |
---|
1517 | 2204 | |
---|
1518 | | - //aConstraints.weighty = 1; |
---|
1519 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1520 | | - //aConstraints.gridx += 1; |
---|
1521 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1522 | | - aConstraints.weighty = 0; |
---|
1523 | | - aConstraints.gridx = 0; |
---|
1524 | | - aConstraints.gridy += 1; |
---|
1525 | | - aConstraints.gridwidth = 1; |
---|
| 2205 | + colorSection.add(GetSeparator()); |
---|
| 2206 | + |
---|
| 2207 | + cGridBag texture = new cGridBag(); |
---|
| 2208 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 2209 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2210 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2211 | + colorSection.add(texture); |
---|
1526 | 2212 | |
---|
1527 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1528 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1529 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1530 | | - aConstraints.gridx += 1; |
---|
1531 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1532 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1533 | | - aConstraints.gridx = 0; |
---|
1534 | | - aConstraints.gridy += 1; |
---|
1535 | | - aConstraints.gridwidth = 1; |
---|
| 2213 | + panel.add(GetSeparator()); |
---|
| 2214 | + |
---|
| 2215 | + panel.add(colorSection); |
---|
| 2216 | + |
---|
| 2217 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2218 | + |
---|
| 2219 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 2220 | + |
---|
| 2221 | + cGridBag diffuse = new cGridBag(); |
---|
| 2222 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 2223 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2224 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2225 | + diffuseSection.add(diffuse); |
---|
1536 | 2226 | |
---|
1537 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1538 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1539 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1540 | | - aConstraints.gridx += 1; |
---|
1541 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1542 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1543 | | - aConstraints.gridx = 0; |
---|
1544 | | - aConstraints.gridy += 1; |
---|
1545 | | - aConstraints.gridwidth = 1; |
---|
| 2227 | + cGridBag diffuseness = new cGridBag(); |
---|
| 2228 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 2229 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2230 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2231 | + diffuseSection.add(diffuseness); |
---|
1546 | 2232 | |
---|
1547 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1548 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1549 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1550 | | - aConstraints.gridx += 1; |
---|
1551 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1552 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1553 | | - aConstraints.gridx = 0; |
---|
1554 | | - aConstraints.gridy += 1; |
---|
1555 | | - aConstraints.gridwidth = 1; |
---|
| 2233 | + cGridBag selfshadow = new cGridBag(); |
---|
| 2234 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 2235 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2236 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2237 | + diffuseSection.add(selfshadow); |
---|
1556 | 2238 | |
---|
1557 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1558 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1559 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1560 | | - aConstraints.gridx += 1; |
---|
1561 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1562 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1563 | | - aConstraints.gridx = 0; |
---|
1564 | | - aConstraints.gridy += 1; |
---|
1565 | | - aConstraints.gridwidth = 1; |
---|
| 2239 | + cGridBag sheen = new cGridBag(); |
---|
| 2240 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 2241 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2242 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2243 | + diffuseSection.add(sheen); |
---|
1566 | 2244 | |
---|
1567 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1568 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1569 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1570 | | - aConstraints.gridx += 1; |
---|
1571 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1572 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1573 | | - aConstraints.gridx = 0; |
---|
1574 | | - aConstraints.gridy += 1; |
---|
1575 | | - aConstraints.gridwidth = 1; |
---|
| 2245 | + cGridBag subsurface = new cGridBag(); |
---|
| 2246 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 2247 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2248 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2249 | + diffuseSection.add(subsurface); |
---|
1576 | 2250 | |
---|
1577 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1578 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1579 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1580 | | - aConstraints.gridx += 1; |
---|
1581 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1582 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1583 | | - aConstraints.gridx = 0; |
---|
1584 | | - aConstraints.gridy += 1; |
---|
1585 | | - aConstraints.gridwidth = 1; |
---|
| 2251 | + cGridBag shadow = new cGridBag(); |
---|
| 2252 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 2253 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2254 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2255 | + diffuseSection.add(shadow); |
---|
1586 | 2256 | |
---|
1587 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1588 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1589 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1590 | | - aConstraints.gridx += 1; |
---|
1591 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1592 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1593 | | - aConstraints.gridx = 0; |
---|
1594 | | - aConstraints.gridy += 1; |
---|
1595 | | - aConstraints.gridwidth = 1; |
---|
| 2257 | + cGridBag fakedepth = new cGridBag(); |
---|
| 2258 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 2259 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2260 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2261 | + diffuseSection.add(fakedepth); |
---|
1596 | 2262 | |
---|
1597 | | - //aConstraints.weighty = 1; |
---|
1598 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1599 | | - //aConstraints.gridx += 1; |
---|
1600 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1601 | | - aConstraints.weighty = 0; |
---|
1602 | | - aConstraints.gridx = 0; |
---|
1603 | | - aConstraints.gridy += 1; |
---|
1604 | | - aConstraints.gridwidth = 1; |
---|
| 2263 | + cGridBag shadowbias = new cGridBag(); |
---|
| 2264 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 2265 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2266 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2267 | + diffuseSection.add(shadowbias); |
---|
1605 | 2268 | |
---|
1606 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1607 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1608 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1609 | | - aConstraints.gridx += 1; |
---|
1610 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1611 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1612 | | - aConstraints.gridx = 0; |
---|
1613 | | - aConstraints.gridy += 1; |
---|
1614 | | - aConstraints.gridwidth = 1; |
---|
| 2269 | + panel.add(GetSeparator()); |
---|
| 2270 | + |
---|
| 2271 | + panel.add(diffuseSection); |
---|
| 2272 | + |
---|
| 2273 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2274 | + |
---|
| 2275 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1615 | 2276 | |
---|
1616 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1617 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1618 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1619 | | - aConstraints.gridx += 1; |
---|
1620 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1621 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1622 | | - aConstraints.gridx = 0; |
---|
1623 | | - aConstraints.gridy += 1; |
---|
1624 | | - aConstraints.gridwidth = 1; |
---|
| 2277 | + cGridBag specular = new cGridBag(); |
---|
| 2278 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 2279 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2280 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2281 | + specularSection.add(specular); |
---|
1625 | 2282 | |
---|
1626 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1627 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1628 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1629 | | - aConstraints.gridx += 1; |
---|
1630 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1631 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1632 | | - aConstraints.gridx = 0; |
---|
1633 | | - aConstraints.gridy += 1; |
---|
1634 | | - aConstraints.gridwidth = 1; |
---|
| 2283 | + cGridBag lightarea = new cGridBag(); |
---|
| 2284 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 2285 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2286 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2287 | + specularSection.add(lightarea); |
---|
1635 | 2288 | |
---|
1636 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1637 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1638 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1639 | | - aConstraints.gridx += 1; |
---|
1640 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1641 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1642 | | - aConstraints.gridx = 0; |
---|
1643 | | - aConstraints.gridy += 1; |
---|
1644 | | - aConstraints.gridwidth = 1; |
---|
| 2289 | + cGridBag shininess = new cGridBag(); |
---|
| 2290 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 2291 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2292 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2293 | + specularSection.add(shininess); |
---|
1645 | 2294 | |
---|
1646 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1647 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1648 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1649 | | - aConstraints.gridx += 1; |
---|
1650 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1651 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1652 | | - aConstraints.gridx = 0; |
---|
1653 | | - aConstraints.gridy += 1; |
---|
1654 | | - aConstraints.gridwidth = 1; |
---|
| 2295 | + cGridBag metalness = new cGridBag(); |
---|
| 2296 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 2297 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2298 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2299 | + specularSection.add(metalness); |
---|
1655 | 2300 | |
---|
1656 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1657 | | - Return(); |
---|
| 2301 | + cGridBag velvet = new cGridBag(); |
---|
| 2302 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 2303 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2304 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2305 | + specularSection.add(velvet); |
---|
| 2306 | + |
---|
| 2307 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 2308 | + //Return(); |
---|
1658 | 2309 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1659 | 2310 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1660 | 2311 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1665 | 2316 | // aConstraints.gridy += 1; |
---|
1666 | 2317 | // aConstraints.gridwidth = 1; |
---|
1667 | 2318 | |
---|
1668 | | - //aConstraints.weighty = 1; |
---|
1669 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1670 | | - //aConstraints.gridx += 1; |
---|
1671 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1672 | | - aConstraints.weighty = 0; |
---|
1673 | | - aConstraints.gridx = 0; |
---|
1674 | | - aConstraints.gridy += 1; |
---|
1675 | | - aConstraints.gridwidth = 1; |
---|
| 2319 | + cGridBag anisoU = new cGridBag(); |
---|
| 2320 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 2321 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2322 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2323 | + specularSection.add(anisoU); |
---|
1676 | 2324 | |
---|
1677 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1678 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1679 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1680 | | - aConstraints.gridx += 1; |
---|
1681 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1682 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1683 | | - aConstraints.gridx = 0; |
---|
1684 | | - aConstraints.gridy += 1; |
---|
1685 | | - aConstraints.gridwidth = 1; |
---|
| 2325 | + cGridBag anisoV = new cGridBag(); |
---|
| 2326 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 2327 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2328 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2329 | + specularSection.add(anisoV); |
---|
1686 | 2330 | |
---|
1687 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1688 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1689 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1690 | | - aConstraints.gridx += 1; |
---|
1691 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1692 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1693 | | - aConstraints.gridx = 0; |
---|
1694 | | - aConstraints.gridy += 1; |
---|
1695 | | - aConstraints.gridwidth = 1; |
---|
1696 | 2331 | |
---|
1697 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1698 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1699 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1700 | | - aConstraints.gridx += 1; |
---|
1701 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1702 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1703 | | - aConstraints.gridx = 0; |
---|
1704 | | - aConstraints.gridy += 1; |
---|
1705 | | - aConstraints.gridwidth = 1; |
---|
| 2332 | + panel.add(GetSeparator()); |
---|
| 2333 | + |
---|
| 2334 | + panel.add(specularSection); |
---|
| 2335 | + |
---|
| 2336 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2337 | + |
---|
| 2338 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1706 | 2339 | |
---|
1707 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1708 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1709 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1710 | | - aConstraints.gridx += 1; |
---|
1711 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1712 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1713 | | - aConstraints.gridx = 0; |
---|
1714 | | - aConstraints.gridy += 1; |
---|
1715 | | - aConstraints.gridwidth = 1; |
---|
1716 | | - aConstraints.weighty = 0; |
---|
| 2340 | + cGridBag camera = new cGridBag(); |
---|
| 2341 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 2342 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2343 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2344 | + colorSection.add(camera); |
---|
1717 | 2345 | |
---|
1718 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1719 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1720 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1721 | | - aConstraints.gridx += 1; |
---|
1722 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1723 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1724 | | - aConstraints.gridx = 0; |
---|
1725 | | - aConstraints.gridy += 1; |
---|
1726 | | - aConstraints.gridwidth = 1; |
---|
| 2346 | + cGridBag ambient = new cGridBag(); |
---|
| 2347 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 2348 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2349 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2350 | + colorSection.add(ambient); |
---|
1727 | 2351 | |
---|
1728 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1729 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1730 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1731 | | - aConstraints.gridx += 1; |
---|
1732 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1733 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1734 | | - aConstraints.gridx = 0; |
---|
1735 | | - aConstraints.gridy += 1; |
---|
1736 | | - aConstraints.gridwidth = 1; |
---|
| 2352 | + cGridBag backlit = new cGridBag(); |
---|
| 2353 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 2354 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2355 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2356 | + colorSection.add(backlit); |
---|
1737 | 2357 | |
---|
1738 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1739 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1740 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1741 | | - aConstraints.gridx += 1; |
---|
1742 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1743 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1744 | | - aConstraints.gridx = 0; |
---|
1745 | | - aConstraints.gridy += 1; |
---|
1746 | | - aConstraints.gridwidth = 1; |
---|
| 2358 | + //panel.add(new JSeparator()); |
---|
| 2359 | + |
---|
| 2360 | + //panel.add(globalSection); |
---|
| 2361 | + |
---|
| 2362 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2363 | + |
---|
| 2364 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1747 | 2365 | |
---|
1748 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1749 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1750 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1751 | | - aConstraints.gridx += 1; |
---|
1752 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1753 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1754 | | - aConstraints.gridx = 0; |
---|
1755 | | - aConstraints.gridy += 1; |
---|
1756 | | - aConstraints.gridwidth = 1; |
---|
| 2366 | + cGridBag bump = new cGridBag(); |
---|
| 2367 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 2368 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2369 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2370 | + textureSection.add(bump); |
---|
1757 | 2371 | |
---|
1758 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1759 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1760 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1761 | | - aConstraints.gridx += 1; |
---|
1762 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1763 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1764 | | - aConstraints.gridx = 0; |
---|
1765 | | - aConstraints.gridy += 1; |
---|
1766 | | - aConstraints.gridwidth = 1; |
---|
| 2372 | + cGridBag noise = new cGridBag(); |
---|
| 2373 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 2374 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2375 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 2376 | + textureSection.add(noise); |
---|
1767 | 2377 | |
---|
1768 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1769 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1770 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1771 | | - aConstraints.gridx += 1; |
---|
1772 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1773 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1774 | | - aConstraints.gridx = 0; |
---|
1775 | | - aConstraints.gridy += 1; |
---|
1776 | | - aConstraints.gridwidth = 1; |
---|
| 2378 | + cGridBag power = new cGridBag(); |
---|
| 2379 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 2380 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2381 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 2382 | + textureSection.add(power); |
---|
1777 | 2383 | |
---|
1778 | | - //aConstraints.weighty = 1; |
---|
1779 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1780 | | - //aConstraints.gridx += 1; |
---|
1781 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1782 | | - aConstraints.weighty = 0; |
---|
| 2384 | + cGridBag borderfade = new cGridBag(); |
---|
| 2385 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 2386 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2387 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2388 | + textureSection.add(borderfade); |
---|
1783 | 2389 | |
---|
1784 | | - aConstraints.gridx = 0; |
---|
1785 | | - aConstraints.gridy = 0; |
---|
1786 | | - aConstraints.gridwidth = 1; |
---|
| 2390 | + cGridBag fog = new cGridBag(); |
---|
| 2391 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 2392 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2393 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 2394 | + textureSection.add(fog); |
---|
| 2395 | + |
---|
| 2396 | + cGridBag opacityPower = new cGridBag(); |
---|
| 2397 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 2398 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2399 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 2400 | + textureSection.add(opacityPower); |
---|
| 2401 | + |
---|
| 2402 | + panel.add(GetSeparator()); |
---|
| 2403 | + |
---|
| 2404 | + panel.add(textureSection); |
---|
| 2405 | + |
---|
| 2406 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1787 | 2407 | |
---|
1788 | 2408 | SetMaterial(copy); // .GetMaterial()); |
---|
1789 | 2409 | |
---|
1790 | | - colorField.addChangeListener(this); |
---|
1791 | | - modulationField.addChangeListener(this); |
---|
| 2410 | + //colorField.addChangeListener(this); |
---|
| 2411 | +// modulationField.addChangeListener(this); |
---|
1792 | 2412 | metalnessField.addChangeListener(this); |
---|
1793 | 2413 | diffuseField.addChangeListener(this); |
---|
1794 | 2414 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1818 | 2438 | opacityPowerField.addChangeListener(this); |
---|
1819 | 2439 | /**/ |
---|
1820 | 2440 | |
---|
1821 | | - resetSlidersButton.addActionListener(this); |
---|
1822 | 2441 | clearMaterialButton.addActionListener(this); |
---|
1823 | 2442 | createMaterialButton.addActionListener(this); |
---|
1824 | | - |
---|
1825 | | - propagateToggle.addItemListener(this); |
---|
1826 | | - multiplyToggle.addItemListener(this); |
---|
| 2443 | + |
---|
| 2444 | + if (Globals.ADVANCED) |
---|
| 2445 | + { |
---|
| 2446 | + resetSlidersButton.addActionListener(this); |
---|
| 2447 | + propagateToggle.addItemListener(this); |
---|
| 2448 | + multiplyToggle.addItemListener(this); |
---|
| 2449 | + } |
---|
1827 | 2450 | } |
---|
1828 | 2451 | |
---|
1829 | 2452 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1841 | 2464 | // 3D models |
---|
1842 | 2465 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1843 | 2466 | { |
---|
1844 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1845 | | - LoadFile(filename, lastConverter); |
---|
| 2467 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2468 | + //LoadFile(filename, lastConverter); |
---|
| 2469 | + LoadObjFile(filename); // New 3ds loader |
---|
1846 | 2470 | continue; |
---|
1847 | 2471 | } |
---|
1848 | 2472 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
1994 | 2618 | |
---|
1995 | 2619 | //? flashIt = false; |
---|
1996 | 2620 | CameraPane pane = (CameraPane) cameraView; |
---|
1997 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2621 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1998 | 2622 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1999 | 2623 | |
---|
2000 | 2624 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2043 | 2667 | e2.printStackTrace(); |
---|
2044 | 2668 | } |
---|
2045 | 2669 | } |
---|
| 2670 | + |
---|
2046 | 2671 | LoadJMEThread loadThread; |
---|
2047 | 2672 | |
---|
2048 | 2673 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2100 | 2725 | //LoadFile0(filename, converter); |
---|
2101 | 2726 | } |
---|
2102 | 2727 | } |
---|
| 2728 | + |
---|
2103 | 2729 | LoadOBJThread loadObjThread; |
---|
2104 | 2730 | |
---|
2105 | 2731 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2178 | 2804 | |
---|
2179 | 2805 | void LoadObjFile(String fullname) |
---|
2180 | 2806 | { |
---|
2181 | | - /* |
---|
| 2807 | + System.out.println("Loading " + fullname); |
---|
| 2808 | + /**/ |
---|
2182 | 2809 | //lastFilename = fullname; |
---|
2183 | 2810 | if(loadObjThread == null) |
---|
2184 | 2811 | { |
---|
2185 | | - loadObjThread = new LoadOBJThread(); |
---|
2186 | | - loadObjThread.start(); |
---|
| 2812 | + loadObjThread = new LoadOBJThread(); |
---|
| 2813 | + loadObjThread.start(); |
---|
2187 | 2814 | } |
---|
2188 | 2815 | |
---|
2189 | 2816 | loadObjThread.add(fullname); |
---|
2190 | | - */ |
---|
| 2817 | + /**/ |
---|
2191 | 2818 | |
---|
2192 | | - System.out.println("Loading " + fullname); |
---|
2193 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2819 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2194 | 2820 | } |
---|
2195 | 2821 | |
---|
2196 | 2822 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2451 | 3077 | |
---|
2452 | 3078 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2453 | 3079 | { |
---|
2454 | | - if (GrafreeD.standAlone) |
---|
| 3080 | + if (Grafreed.standAlone) |
---|
2455 | 3081 | { |
---|
2456 | 3082 | /**/ |
---|
2457 | 3083 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2458 | | - browser.show(); |
---|
| 3084 | + browser.setVisible(true); |
---|
2459 | 3085 | String filename = browser.getFile(); |
---|
2460 | 3086 | if (filename != null && filename.length() > 0) |
---|
2461 | 3087 | { |
---|
.. | .. |
---|
2566 | 3192 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2567 | 3193 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2568 | 3194 | } |
---|
| 3195 | + |
---|
2569 | 3196 | //cJME.count++; |
---|
2570 | 3197 | //cJME.count %= 12; |
---|
2571 | 3198 | if (gc) |
---|
.. | .. |
---|
2600 | 3227 | } |
---|
2601 | 3228 | if (input == null) |
---|
2602 | 3229 | { |
---|
| 3230 | + new Exception().printStackTrace(); |
---|
2603 | 3231 | System.exit(0); |
---|
2604 | 3232 | } |
---|
2605 | 3233 | |
---|
.. | .. |
---|
2748 | 3376 | } |
---|
2749 | 3377 | } |
---|
2750 | 3378 | } |
---|
| 3379 | + |
---|
2751 | 3380 | cFileSystemPane FSPane; |
---|
2752 | 3381 | |
---|
2753 | 3382 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2757 | 3386 | |
---|
2758 | 3387 | freezematerial = true; |
---|
2759 | 3388 | colorField.setFloat(mat.color); |
---|
2760 | | - modulationField.setFloat(mat.modulation); |
---|
| 3389 | + saturationField.setFloat(mat.modulation); |
---|
2761 | 3390 | metalnessField.setFloat(mat.metalness); |
---|
2762 | 3391 | diffuseField.setFloat(mat.diffuse); |
---|
2763 | 3392 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
2801 | 3430 | } |
---|
2802 | 3431 | } |
---|
2803 | 3432 | } |
---|
| 3433 | + |
---|
2804 | 3434 | freezematerial = false; |
---|
2805 | 3435 | } |
---|
2806 | 3436 | |
---|
2807 | 3437 | void SetMaterial(Object3D object) |
---|
2808 | 3438 | { |
---|
| 3439 | + latestObject = object; |
---|
| 3440 | + |
---|
2809 | 3441 | cMaterial mat = object.material; |
---|
2810 | 3442 | |
---|
2811 | 3443 | if (mat == null) |
---|
.. | .. |
---|
2814 | 3446 | return; |
---|
2815 | 3447 | } |
---|
2816 | 3448 | |
---|
2817 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 3449 | + if (multiplyToggle != null) |
---|
| 3450 | + multiplyToggle.setSelected(mat.multiply); |
---|
2818 | 3451 | |
---|
2819 | 3452 | assert (object.projectedVertices != null); |
---|
2820 | 3453 | |
---|
.. | .. |
---|
2916 | 3549 | // } |
---|
2917 | 3550 | |
---|
2918 | 3551 | /**/ |
---|
2919 | | - if (deselect) |
---|
| 3552 | + if (deselect || child == null) |
---|
2920 | 3553 | { |
---|
2921 | 3554 | //group.deselectAll(); |
---|
2922 | 3555 | //freeze = true; |
---|
2923 | 3556 | GetTree().clearSelection(); |
---|
2924 | 3557 | //freeze = false; |
---|
| 3558 | + |
---|
| 3559 | + if (child == null) |
---|
| 3560 | + { |
---|
| 3561 | + return; |
---|
| 3562 | + } |
---|
2925 | 3563 | } |
---|
2926 | 3564 | |
---|
2927 | 3565 | //group.addSelectee(child); |
---|
.. | .. |
---|
2955 | 3593 | public void itemStateChanged(ItemEvent event) |
---|
2956 | 3594 | { |
---|
2957 | 3595 | // System.out.println("Propagate = " + propagate); |
---|
| 3596 | + if (event.getSource() == pinButton) |
---|
| 3597 | + { |
---|
| 3598 | + copy.pinned ^= true; |
---|
| 3599 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3600 | + { |
---|
| 3601 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3602 | + copy.CloseUI(); |
---|
| 3603 | + //copy.editWindow.refreshContents(); |
---|
| 3604 | + } |
---|
| 3605 | + } |
---|
| 3606 | + else |
---|
2958 | 3607 | if (event.getSource() == propagateToggle) |
---|
2959 | 3608 | { |
---|
2960 | 3609 | propagate ^= true; |
---|
.. | .. |
---|
2990 | 3639 | cameraView.ToggleDL(); |
---|
2991 | 3640 | cameraView.repaint(); |
---|
2992 | 3641 | return; |
---|
2993 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3642 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2994 | 3643 | { |
---|
2995 | 3644 | cameraView.ToggleTexture(); |
---|
2996 | 3645 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
3029 | 3678 | frame.validate(); |
---|
3030 | 3679 | |
---|
3031 | 3680 | return; |
---|
3032 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3681 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
3033 | 3682 | { |
---|
3034 | | - cameraView.ToggleRandom(); |
---|
| 3683 | + cameraView.ToggleSwitch(); |
---|
3035 | 3684 | cameraView.repaint(); |
---|
3036 | 3685 | return; |
---|
3037 | 3686 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3059 | 3708 | } else if (event.getSource() == liveCB) |
---|
3060 | 3709 | { |
---|
3061 | 3710 | copy.live ^= true; |
---|
| 3711 | + objEditor.refreshContents(true); // To show item colors |
---|
| 3712 | + return; |
---|
| 3713 | + } else if (event.getSource() == selectableCB) |
---|
| 3714 | + { |
---|
| 3715 | + copy.dontselect ^= true; |
---|
3062 | 3716 | return; |
---|
3063 | 3717 | } else if (event.getSource() == hideCB) |
---|
3064 | 3718 | { |
---|
3065 | 3719 | copy.hide ^= true; |
---|
3066 | 3720 | copy.Touch(); // display list issue |
---|
3067 | | - objEditor.refreshContents(); |
---|
| 3721 | + objEditor.refreshContents(true); // To show item colors |
---|
3068 | 3722 | return; |
---|
3069 | 3723 | } else if (event.getSource() == link2masterCB) |
---|
3070 | 3724 | { |
---|
.. | .. |
---|
3074 | 3728 | if (event.getSource() == randomCB) |
---|
3075 | 3729 | { |
---|
3076 | 3730 | copy.random ^= true; |
---|
| 3731 | + objEditor.refreshContents(); |
---|
3077 | 3732 | return; |
---|
3078 | 3733 | } |
---|
3079 | 3734 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3097 | 3752 | |
---|
3098 | 3753 | public void actionPerformed(ActionEvent event) |
---|
3099 | 3754 | { |
---|
| 3755 | + Object source = event.getSource(); |
---|
3100 | 3756 | // SCRIPT DIALOG |
---|
3101 | | - if (event.getSource() == okbutton) |
---|
| 3757 | + if (source == okbutton) |
---|
3102 | 3758 | { |
---|
3103 | 3759 | textpanel.setVisible(false); |
---|
3104 | 3760 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3110 | 3766 | textarea = null; |
---|
3111 | 3767 | textpanel = null; |
---|
3112 | 3768 | } |
---|
3113 | | - if (event.getSource() == cancelbutton) |
---|
| 3769 | + if (source == cancelbutton) |
---|
3114 | 3770 | { |
---|
3115 | 3771 | textpanel.setVisible(false); |
---|
3116 | 3772 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3122 | 3778 | //applySelf(); |
---|
3123 | 3779 | //client.refreshEditWindow(); |
---|
3124 | 3780 | //refreshContents(); |
---|
3125 | | - if (event.getSource() == nameField) |
---|
| 3781 | + if (source == nameField) |
---|
3126 | 3782 | { |
---|
3127 | 3783 | //System.out.println("ObjEditor " + event); |
---|
3128 | 3784 | applySelf0(true); |
---|
3129 | 3785 | //parent.applySelf(); |
---|
3130 | 3786 | objEditor.refreshContents(); |
---|
3131 | | - } else if (event.getSource() == resetButton) |
---|
| 3787 | + } else if (source == resetButton) |
---|
3132 | 3788 | { |
---|
3133 | 3789 | CameraPane.fullreset = true; |
---|
3134 | 3790 | copy.Reset(); // ResetMeshes(); |
---|
3135 | 3791 | copy.Touch(); |
---|
3136 | 3792 | objEditor.refreshContents(); |
---|
3137 | | - } else if (event.getSource() == stepItem) |
---|
| 3793 | + } else if (source == stepItem) |
---|
3138 | 3794 | { |
---|
3139 | | - cameraView.ONESTEP = true; |
---|
| 3795 | + //cameraView.ONESTEP = true; |
---|
| 3796 | + Globals.ONESTEP = true; |
---|
3140 | 3797 | cameraView.repaint(); |
---|
3141 | 3798 | return; |
---|
3142 | | - } else if (event.getSource() == stepButton) |
---|
| 3799 | + } else if (source == stepButton) |
---|
3143 | 3800 | { |
---|
3144 | 3801 | copy.Step(); |
---|
3145 | 3802 | copy.Touch(); |
---|
3146 | 3803 | objEditor.refreshContents(); |
---|
3147 | | - } else if (event.getSource() == slowerButton) |
---|
| 3804 | + } else if (source == slowerButton) |
---|
3148 | 3805 | { |
---|
3149 | 3806 | copy.Slower(); |
---|
3150 | 3807 | copy.Touch(); |
---|
3151 | 3808 | objEditor.refreshContents(); |
---|
3152 | | - } else if (event.getSource() == fasterButton) |
---|
| 3809 | + } else if (source == fasterButton) |
---|
3153 | 3810 | { |
---|
3154 | 3811 | copy.Faster(); |
---|
3155 | 3812 | copy.Touch(); |
---|
3156 | 3813 | objEditor.refreshContents(); |
---|
3157 | | - } else if (event.getSource() == remarkButton) |
---|
| 3814 | + } else if (source == remarkButton) |
---|
3158 | 3815 | { |
---|
3159 | 3816 | copy.Remark(); |
---|
3160 | 3817 | copy.Touch(); |
---|
3161 | 3818 | objEditor.refreshContents(); |
---|
3162 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3819 | + } else if (source == stepAllButton) |
---|
3163 | 3820 | { |
---|
3164 | 3821 | copy.StepAll(); |
---|
3165 | 3822 | copy.Touch(); |
---|
3166 | 3823 | objEditor.refreshContents(); |
---|
3167 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3824 | + } else if (source == resetAllButton) |
---|
3168 | 3825 | { |
---|
3169 | 3826 | //CameraPane.fullreset = true; |
---|
3170 | 3827 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3197 | 3854 | // Close(); |
---|
3198 | 3855 | // } |
---|
3199 | 3856 | // else |
---|
3200 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3857 | + if (source == resetSlidersButton) |
---|
3201 | 3858 | { |
---|
3202 | 3859 | ResetSliders(); |
---|
3203 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3860 | + } else if (source == clearMaterialButton) |
---|
3204 | 3861 | { |
---|
3205 | 3862 | ClearMaterial(); |
---|
3206 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3863 | + } else if (source == createMaterialButton) |
---|
3207 | 3864 | { |
---|
3208 | 3865 | CreateMaterial(); |
---|
3209 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3866 | + } else if (source == clearPanelButton) |
---|
3210 | 3867 | { |
---|
3211 | 3868 | copy.ClearUI(); |
---|
3212 | 3869 | refreshContents(true); |
---|
3213 | | - } /* |
---|
3214 | | - } |
---|
3215 | | - |
---|
3216 | | - public boolean action(Event event, Object arg) |
---|
3217 | | - { |
---|
3218 | | - */ else if (event.getSource() == closeItem) |
---|
| 3870 | + } else if (source == importGFDItem) |
---|
| 3871 | + { |
---|
| 3872 | + ImportGFD(); |
---|
| 3873 | + } else |
---|
| 3874 | + if (source == importVRMLX3DItem) |
---|
| 3875 | + { |
---|
| 3876 | + ImportVRMLX3D(); |
---|
| 3877 | + } else |
---|
| 3878 | + if (source == import3DSItem) |
---|
| 3879 | + { |
---|
| 3880 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3881 | + } else |
---|
| 3882 | + if (source == importOBJItem) |
---|
| 3883 | + { |
---|
| 3884 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3885 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3886 | + browser.setVisible(true); |
---|
| 3887 | + String filename = browser.getFile(); |
---|
| 3888 | + if (filename != null && filename.length() > 0) |
---|
| 3889 | + { |
---|
| 3890 | + String fullname = browser.getDirectory() + filename; |
---|
| 3891 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3892 | + } |
---|
| 3893 | + } else |
---|
| 3894 | + if (source == closeItem) |
---|
3219 | 3895 | { |
---|
3220 | 3896 | Close(); |
---|
3221 | 3897 | //return true; |
---|
3222 | | - } else if (event.getSource() == loadItem) |
---|
| 3898 | + } else if (source == openItem) |
---|
3223 | 3899 | { |
---|
3224 | | - load(); |
---|
| 3900 | + Open(); |
---|
3225 | 3901 | //return true; |
---|
3226 | | - } else if (event.getSource() == saveItem) |
---|
| 3902 | + } else if (source == newItem) |
---|
| 3903 | + { |
---|
| 3904 | + New(); |
---|
| 3905 | + } else if (source == saveItem) |
---|
3227 | 3906 | { |
---|
3228 | 3907 | save(); |
---|
3229 | 3908 | //return true; |
---|
3230 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3909 | + } else if (source == saveAsItem) |
---|
3231 | 3910 | { |
---|
3232 | 3911 | saveAs(); |
---|
3233 | 3912 | //return true; |
---|
3234 | | - } else if (event.getSource() == reexportItem) |
---|
| 3913 | + } else if (source == reexportItem) |
---|
3235 | 3914 | { |
---|
3236 | 3915 | reexport(); |
---|
3237 | 3916 | //return true; |
---|
3238 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3917 | + } else if (source == exportAsItem) |
---|
3239 | 3918 | { |
---|
3240 | 3919 | export(); |
---|
3241 | 3920 | //return true; |
---|
3242 | | - } else if (event.getSource() == povItem) |
---|
| 3921 | + } else if (source == povItem) |
---|
3243 | 3922 | { |
---|
3244 | 3923 | generatePOV(); |
---|
3245 | 3924 | //return true; |
---|
3246 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3925 | + } else if (event.getSource() == archiveItem) |
---|
| 3926 | + { |
---|
| 3927 | + cTools.Archive(frame); |
---|
| 3928 | + return; |
---|
| 3929 | + } else if (source == zBufferItem) |
---|
3247 | 3930 | { |
---|
3248 | 3931 | try |
---|
3249 | 3932 | { |
---|
.. | .. |
---|
3265 | 3948 | cameraView.repaint(); |
---|
3266 | 3949 | //return true; |
---|
3267 | 3950 | } |
---|
3268 | | - */ else if (event.getSource() == editCameraItem) |
---|
3269 | | - { |
---|
3270 | | - cameraView.ProtectCamera(); |
---|
3271 | | - cameraView.repaint(); |
---|
3272 | | - return; |
---|
3273 | | - } else if (event.getSource() == revertCameraItem) |
---|
3274 | | - { |
---|
3275 | | - cameraView.RevertCamera(); |
---|
3276 | | - cameraView.repaint(); |
---|
3277 | | - return; |
---|
3278 | | -// } else if (event.getSource() == textureButton) |
---|
3279 | | -// { |
---|
3280 | | -// return; // true; |
---|
3281 | | - } else // combos... |
---|
3282 | | - if (event.getSource() == texresMenu) |
---|
| 3951 | + */ else // combos... |
---|
| 3952 | + if (source == texresMenu) |
---|
3283 | 3953 | { |
---|
3284 | 3954 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3285 | 3955 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3291 | 3961 | } |
---|
3292 | 3962 | } |
---|
3293 | 3963 | |
---|
3294 | | - void ToggleAnimation() |
---|
| 3964 | + void New() |
---|
3295 | 3965 | { |
---|
3296 | | - if (!CameraPane.ANIMATION) |
---|
| 3966 | + while (copy.Size() > 1) |
---|
3297 | 3967 | { |
---|
3298 | | - FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3968 | + copy.remove(1); |
---|
| 3969 | + } |
---|
| 3970 | + |
---|
| 3971 | + ResetModel(); |
---|
| 3972 | + objEditor.refreshContents(); |
---|
| 3973 | + } |
---|
| 3974 | + |
---|
| 3975 | + static public byte[] Compress(Object3D o) |
---|
| 3976 | + { |
---|
| 3977 | + // Slower to actually compress. |
---|
| 3978 | + try |
---|
| 3979 | + { |
---|
| 3980 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3981 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3982 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
| 3983 | + |
---|
| 3984 | + Object3D parent = o.parent; |
---|
| 3985 | + o.parent = null; |
---|
| 3986 | + |
---|
| 3987 | + out.writeObject(o); |
---|
| 3988 | + |
---|
| 3989 | + o.parent = parent; |
---|
| 3990 | + |
---|
| 3991 | + out.flush(); |
---|
| 3992 | + |
---|
| 3993 | + baos //zstream |
---|
| 3994 | + .close(); |
---|
| 3995 | + out.close(); |
---|
| 3996 | + |
---|
| 3997 | + byte[] bytes = baos.toByteArray(); |
---|
| 3998 | + |
---|
| 3999 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 4000 | + return bytes; |
---|
| 4001 | + } catch (Exception e) |
---|
| 4002 | + { |
---|
| 4003 | + System.err.println(e); |
---|
| 4004 | + return null; |
---|
| 4005 | + } |
---|
| 4006 | + } |
---|
| 4007 | + |
---|
| 4008 | + static public Object Uncompress(byte[] bytes) |
---|
| 4009 | + { |
---|
| 4010 | + System.out.println("restore #bytes = " + bytes.length); |
---|
| 4011 | + try |
---|
| 4012 | + { |
---|
| 4013 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4014 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 4015 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
| 4016 | + Object obj = in.readObject(); |
---|
| 4017 | + |
---|
| 4018 | + bais //istream |
---|
| 4019 | + .close(); |
---|
| 4020 | + in.close(); |
---|
| 4021 | + |
---|
| 4022 | + return obj; |
---|
| 4023 | + } catch (Exception e) |
---|
| 4024 | + { |
---|
| 4025 | + System.err.println(e); |
---|
| 4026 | + return null; |
---|
| 4027 | + } |
---|
| 4028 | + } |
---|
| 4029 | + |
---|
| 4030 | + static public Object clone(Object o) |
---|
| 4031 | + { |
---|
| 4032 | + try |
---|
| 4033 | + { |
---|
| 4034 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4035 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 4036 | + |
---|
| 4037 | + out.writeObject(o); |
---|
| 4038 | + |
---|
| 4039 | + out.flush(); |
---|
| 4040 | + out.close(); |
---|
| 4041 | + |
---|
| 4042 | + byte[] bytes = baos.toByteArray(); |
---|
| 4043 | + |
---|
| 4044 | + System.out.println("clone = " + bytes.length); |
---|
| 4045 | + |
---|
| 4046 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4047 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 4048 | + Object obj = in.readObject(); |
---|
| 4049 | + in.close(); |
---|
| 4050 | + |
---|
| 4051 | + return obj; |
---|
| 4052 | + } catch (Exception e) |
---|
| 4053 | + { |
---|
| 4054 | + System.err.println(e); |
---|
| 4055 | + return null; |
---|
| 4056 | + } |
---|
| 4057 | + } |
---|
| 4058 | + |
---|
| 4059 | + cRadio GetCurrentTab() |
---|
| 4060 | + { |
---|
| 4061 | + cRadio ab; |
---|
| 4062 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4063 | + { |
---|
| 4064 | + ab = (cRadio)e.nextElement(); |
---|
| 4065 | + if(ab.GetObject() == copy) |
---|
| 4066 | + { |
---|
| 4067 | + return ab; |
---|
| 4068 | + } |
---|
| 4069 | + } |
---|
| 4070 | + |
---|
| 4071 | + return null; |
---|
| 4072 | + } |
---|
| 4073 | + |
---|
| 4074 | + |
---|
| 4075 | + public void Save() |
---|
| 4076 | + { |
---|
| 4077 | + //Save(true); |
---|
| 4078 | + Replace(); |
---|
| 4079 | + SetUndoStates(); |
---|
| 4080 | + } |
---|
| 4081 | + |
---|
| 4082 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 4083 | + { |
---|
| 4084 | + if (compress.length != name.length) |
---|
| 4085 | + { |
---|
| 4086 | + return false; |
---|
| 4087 | + } |
---|
| 4088 | + |
---|
| 4089 | + for (int i=compress.length; --i>=0;) |
---|
| 4090 | + { |
---|
| 4091 | + if (compress[i] != name[i]) |
---|
| 4092 | + return false; |
---|
| 4093 | + } |
---|
| 4094 | + |
---|
| 4095 | + return true; |
---|
| 4096 | + } |
---|
| 4097 | + |
---|
| 4098 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 4099 | + |
---|
| 4100 | + void DeleteVersion() |
---|
| 4101 | + { |
---|
| 4102 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4103 | + { |
---|
| 4104 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4105 | + } |
---|
| 4106 | + |
---|
| 4107 | + CopyChanged(); |
---|
| 4108 | + |
---|
| 4109 | + SetUndoStates(); |
---|
| 4110 | + } |
---|
| 4111 | + |
---|
| 4112 | + public boolean Save(boolean user) |
---|
| 4113 | + { |
---|
| 4114 | + System.err.println("Save"); |
---|
| 4115 | + //Replace(); |
---|
| 4116 | + |
---|
| 4117 | + cRadio tab = GetCurrentTab(); |
---|
| 4118 | + |
---|
| 4119 | + Object3D compress = CompressCopy(); // Saved version. No need for "Replace"? |
---|
| 4120 | + |
---|
| 4121 | + boolean thesame = false; |
---|
| 4122 | + |
---|
| 4123 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4124 | +// { |
---|
| 4125 | +// thesame = true; |
---|
| 4126 | +// } |
---|
| 4127 | + |
---|
| 4128 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 4129 | + if (!thesame) |
---|
| 4130 | + { |
---|
| 4131 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4132 | + { |
---|
| 4133 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4134 | + } |
---|
| 4135 | + |
---|
| 4136 | + //tab.user[tab.versionindex] = user; |
---|
| 4137 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 4138 | + |
---|
| 4139 | + copy.versionlist[++copy.versionindex] = compress; |
---|
| 4140 | + |
---|
| 4141 | + // if (increment) |
---|
| 4142 | + // tab.versionindex++; |
---|
| 4143 | + } |
---|
| 4144 | + |
---|
| 4145 | + //copy.RestoreBigData(versiontable); |
---|
| 4146 | + |
---|
| 4147 | + //assert(hashtable.isEmpty()); |
---|
| 4148 | + |
---|
| 4149 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4150 | +// { |
---|
| 4151 | +// //tab.user[i] = false; |
---|
| 4152 | +// copy.versionlist[i] = null; |
---|
| 4153 | +// } |
---|
| 4154 | + |
---|
| 4155 | + SetUndoStates(); |
---|
| 4156 | + |
---|
| 4157 | + // test save |
---|
| 4158 | + if (false) |
---|
| 4159 | + { |
---|
| 4160 | + try |
---|
| 4161 | + { |
---|
| 4162 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
| 4163 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4164 | + |
---|
| 4165 | + p.writeObject(copy); |
---|
| 4166 | + |
---|
| 4167 | + p.flush(); |
---|
| 4168 | + |
---|
| 4169 | + ostream.close(); |
---|
| 4170 | + } catch (Exception e) |
---|
| 4171 | + { |
---|
| 4172 | + e.printStackTrace(); |
---|
| 4173 | + } |
---|
| 4174 | + } |
---|
| 4175 | + |
---|
| 4176 | + return !thesame; |
---|
| 4177 | + } |
---|
| 4178 | + |
---|
| 4179 | + boolean flashIt = true; |
---|
| 4180 | + |
---|
| 4181 | + void RefreshSelection() |
---|
| 4182 | + { |
---|
| 4183 | + Object3D selection = new Object3D(); |
---|
| 4184 | + |
---|
| 4185 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4186 | + { |
---|
| 4187 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4188 | + |
---|
| 4189 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4190 | + |
---|
| 4191 | + if (obj == null) |
---|
| 4192 | + { |
---|
| 4193 | + copy.selection.remove(i--); |
---|
| 4194 | + } |
---|
| 4195 | + else |
---|
| 4196 | + { |
---|
| 4197 | + selection.add(obj); |
---|
| 4198 | + copy.selection.setElementAt(obj, i); |
---|
| 4199 | + } |
---|
| 4200 | + } |
---|
| 4201 | + |
---|
| 4202 | + flashIt = false; |
---|
| 4203 | + GetTree().clearSelection(); |
---|
| 4204 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4205 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4206 | + flashIt = true; |
---|
| 4207 | + |
---|
| 4208 | + //refreshContents(false); |
---|
| 4209 | + } |
---|
| 4210 | + |
---|
| 4211 | + void CopyChanged() |
---|
| 4212 | + { |
---|
| 4213 | + Object3D obj = copy.versionlist[copy.versionindex]; |
---|
| 4214 | + |
---|
| 4215 | + SetUndoStates(); |
---|
| 4216 | + |
---|
| 4217 | + boolean temp = CameraPane.SWITCH; |
---|
| 4218 | + CameraPane.SWITCH = false; |
---|
| 4219 | + |
---|
| 4220 | + copy.ExtractBigData(versiontable); |
---|
| 4221 | + |
---|
| 4222 | + copy.clear(); |
---|
| 4223 | + |
---|
| 4224 | + copy.skyboxname = obj.skyboxname; |
---|
| 4225 | + copy.skyboxext = obj.skyboxext; |
---|
| 4226 | + |
---|
| 4227 | + for (int i=0; i<obj.Size(); i++) |
---|
| 4228 | + { |
---|
| 4229 | + copy.add(obj.get(i)); |
---|
| 4230 | + } |
---|
| 4231 | + |
---|
| 4232 | + copy.RestoreBigData(versiontable); |
---|
| 4233 | + |
---|
| 4234 | + CameraPane.SWITCH = temp; |
---|
| 4235 | + |
---|
| 4236 | + RefreshSelection(); |
---|
| 4237 | + //assert(hashtable.isEmpty()); |
---|
| 4238 | + |
---|
| 4239 | + copy.Touch(); |
---|
| 4240 | + |
---|
| 4241 | + ResetModel(); |
---|
| 4242 | + copy.HardTouch(); // recompile? |
---|
| 4243 | + |
---|
| 4244 | + cRadio ab; |
---|
| 4245 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4246 | + { |
---|
| 4247 | + ab = (cRadio)e.nextElement(); |
---|
| 4248 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 4249 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 4250 | + if (test != null) |
---|
| 4251 | + { |
---|
| 4252 | + test.editWindow = ab.object.editWindow; |
---|
| 4253 | + ab.object = test; |
---|
| 4254 | + } |
---|
| 4255 | + } |
---|
| 4256 | + |
---|
| 4257 | + refreshContents(true); |
---|
| 4258 | + } |
---|
| 4259 | + |
---|
| 4260 | + cButton previousVersionButton; |
---|
| 4261 | + cButton restoreButton; |
---|
| 4262 | + cButton replaceButton; |
---|
| 4263 | + cButton nextVersionButton; |
---|
| 4264 | + cButton saveVersionButton; |
---|
| 4265 | + cButton deleteVersionButton; |
---|
| 4266 | + |
---|
| 4267 | + boolean muteSlider; |
---|
| 4268 | + |
---|
| 4269 | + int VersionCount() |
---|
| 4270 | + { |
---|
| 4271 | + int count = 0; |
---|
| 4272 | + |
---|
| 4273 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 4274 | + { |
---|
| 4275 | + if (copy.versionlist[i] != null) |
---|
| 4276 | + count++; |
---|
| 4277 | + } |
---|
| 4278 | + |
---|
| 4279 | + return count; |
---|
| 4280 | + } |
---|
| 4281 | + |
---|
| 4282 | + void SetUndoStates() |
---|
| 4283 | + { |
---|
| 4284 | + cRadio tab = GetCurrentTab(); |
---|
| 4285 | + |
---|
| 4286 | + restoreButton.setEnabled(true); // copy.versionindex != -1); |
---|
| 4287 | + replaceButton.setEnabled(true); // copy.versionindex != -1); |
---|
| 4288 | + |
---|
| 4289 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4290 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4291 | + |
---|
| 4292 | + deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
| 4293 | + copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4294 | + |
---|
| 4295 | + muteSlider = true; |
---|
| 4296 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4297 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4298 | + muteSlider = false; |
---|
| 4299 | + } |
---|
| 4300 | + |
---|
| 4301 | + public boolean PreviousVersion() |
---|
| 4302 | + { |
---|
| 4303 | + // Option? |
---|
| 4304 | + Replace(); |
---|
| 4305 | + |
---|
| 4306 | + System.err.println("Undo"); |
---|
| 4307 | + |
---|
| 4308 | + cRadio tab = GetCurrentTab(); |
---|
| 4309 | + |
---|
| 4310 | + if (copy.versionindex == 0) |
---|
| 4311 | + { |
---|
| 4312 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4313 | + return false; |
---|
| 4314 | + } |
---|
| 4315 | + |
---|
| 4316 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 4317 | +// { |
---|
| 4318 | +// if (Save(false)) |
---|
| 4319 | +// tab.versionindex -= 1; |
---|
| 4320 | +// else |
---|
| 4321 | +// { |
---|
| 4322 | +// if (tab.versionindex <= 0) |
---|
| 4323 | +// return false; |
---|
| 4324 | +// else |
---|
| 4325 | +// tab.versionindex -= 1; |
---|
| 4326 | +// } |
---|
| 4327 | +// } |
---|
| 4328 | + |
---|
| 4329 | + copy.versionindex -= 1; |
---|
| 4330 | + |
---|
| 4331 | + CopyChanged(); |
---|
| 4332 | + |
---|
| 4333 | + return true; |
---|
| 4334 | + } |
---|
| 4335 | + |
---|
| 4336 | + public boolean Restore() |
---|
| 4337 | + { |
---|
| 4338 | + System.err.println("Restore"); |
---|
| 4339 | + |
---|
| 4340 | + cRadio tab = GetCurrentTab(); |
---|
| 4341 | + |
---|
| 4342 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4343 | + { |
---|
| 4344 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4345 | + return false; |
---|
| 4346 | + } |
---|
| 4347 | + |
---|
| 4348 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4349 | + CopyChanged(); |
---|
| 4350 | + |
---|
| 4351 | + return true; |
---|
| 4352 | + } |
---|
| 4353 | + |
---|
| 4354 | + public boolean Replace() |
---|
| 4355 | + { |
---|
| 4356 | + System.err.println("Replace"); |
---|
| 4357 | + |
---|
| 4358 | + cRadio tab = GetCurrentTab(); |
---|
| 4359 | + |
---|
| 4360 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4361 | + { |
---|
| 4362 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4363 | + return false; |
---|
| 4364 | + } |
---|
| 4365 | + |
---|
| 4366 | + copy.versionlist[copy.versionindex] = CompressCopy(); |
---|
| 4367 | + |
---|
| 4368 | + return true; |
---|
| 4369 | + } |
---|
| 4370 | + |
---|
| 4371 | + public void NextVersion() |
---|
| 4372 | + { |
---|
| 4373 | + // Option? |
---|
| 4374 | + Replace(); |
---|
| 4375 | + |
---|
| 4376 | + cRadio tab = GetCurrentTab(); |
---|
| 4377 | + |
---|
| 4378 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
| 4379 | + { |
---|
| 4380 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4381 | + return; |
---|
| 4382 | + } |
---|
| 4383 | + |
---|
| 4384 | + copy.versionindex += 1; |
---|
| 4385 | + |
---|
| 4386 | + CopyChanged(); |
---|
| 4387 | + |
---|
| 4388 | + //if (!tab.user[tab.versionindex]) |
---|
| 4389 | + // tab.graphs[tab.versionindex] = null; |
---|
| 4390 | + } |
---|
| 4391 | + |
---|
| 4392 | + void ImportGFD() |
---|
| 4393 | + { |
---|
| 4394 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
3299 | 4395 | browser.show(); |
---|
3300 | 4396 | String filename = browser.getFile(); |
---|
3301 | 4397 | if (filename != null && filename.length() > 0) |
---|
3302 | 4398 | { |
---|
3303 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 4399 | + String fullname = browser.getDirectory() + filename; |
---|
| 4400 | + |
---|
| 4401 | + //Object3D readobj = |
---|
| 4402 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 4403 | + //makeSomething(readobj); |
---|
| 4404 | + } |
---|
| 4405 | + } |
---|
| 4406 | + |
---|
| 4407 | + void ImportVRMLX3D() |
---|
| 4408 | + { |
---|
| 4409 | + if (Grafreed.standAlone) |
---|
| 4410 | + { |
---|
| 4411 | + /**/ |
---|
| 4412 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 4413 | + browser.show(); |
---|
| 4414 | + String filename = browser.getFile(); |
---|
| 4415 | + if (filename != null && filename.length() > 0) |
---|
| 4416 | + { |
---|
| 4417 | + String fullname = browser.getDirectory() + filename; |
---|
| 4418 | + LoadVRMLX3D(fullname); |
---|
| 4419 | + } |
---|
| 4420 | + /**/ |
---|
| 4421 | + } |
---|
| 4422 | + } |
---|
| 4423 | + |
---|
| 4424 | + void ToggleAnimation() |
---|
| 4425 | + { |
---|
| 4426 | + if (!Globals.ANIMATION) |
---|
| 4427 | + { |
---|
| 4428 | + FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 4429 | + browser.setVisible(true); |
---|
| 4430 | + String filename = browser.getFile(); |
---|
| 4431 | + if (filename != null && filename.length() > 0) |
---|
| 4432 | + { |
---|
| 4433 | + Globals.filename = browser.getDirectory() + filename; |
---|
3304 | 4434 | //CameraPane.framecount = 0; |
---|
3305 | | - CameraPane.imagecount = 0; |
---|
| 4435 | + Globals.imagecount = 0; |
---|
3306 | 4436 | |
---|
3307 | | - CameraPane.ANIMATION ^= true; |
---|
| 4437 | + Globals.ANIMATION ^= true; |
---|
3308 | 4438 | |
---|
3309 | | - GrafreeD.wav.cursor = 0; |
---|
3310 | | - GrafreeD.wav.loop = 0; |
---|
| 4439 | + Grafreed.wav.cursor = 0; |
---|
| 4440 | + Grafreed.wav.loop = 0; |
---|
3311 | 4441 | } |
---|
3312 | 4442 | } else |
---|
3313 | 4443 | { |
---|
3314 | | - CameraPane.ANIMATION ^= true; |
---|
| 4444 | + Globals.ANIMATION ^= true; |
---|
3315 | 4445 | } |
---|
3316 | 4446 | } |
---|
3317 | 4447 | |
---|
.. | .. |
---|
3357 | 4487 | void CreateMaterial() |
---|
3358 | 4488 | { |
---|
3359 | 4489 | //copy.ClearMaterial(); // PATCH |
---|
3360 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 4490 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3361 | 4491 | if (copy.selection.size() > 0) |
---|
3362 | 4492 | //SetMaterial(copy); |
---|
3363 | 4493 | { |
---|
.. | .. |
---|
3408 | 4538 | assert false; |
---|
3409 | 4539 | } |
---|
3410 | 4540 | |
---|
3411 | | - void EditSelection() |
---|
| 4541 | + void EditSelection(boolean newWindow) |
---|
3412 | 4542 | { |
---|
3413 | 4543 | } |
---|
3414 | 4544 | |
---|
.. | .. |
---|
3416 | 4546 | { |
---|
3417 | 4547 | copy.ResetBlockLoop(); // temporary problem |
---|
3418 | 4548 | |
---|
3419 | | - boolean random = CameraPane.RANDOM; |
---|
3420 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 4549 | + boolean random = CameraPane.SWITCH; |
---|
| 4550 | + CameraPane.SWITCH = false; // parse everything |
---|
3421 | 4551 | copy.ResetDisplayList(); |
---|
3422 | 4552 | copy.HardTouch(); |
---|
3423 | | - CameraPane.RANDOM = random; |
---|
| 4553 | + CameraPane.SWITCH = random; |
---|
3424 | 4554 | } |
---|
3425 | 4555 | |
---|
3426 | 4556 | // public void applySelf() |
---|
.. | .. |
---|
3467 | 4597 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
3468 | 4598 | |
---|
3469 | 4599 | current.color = (float) colorField.getFloat(); |
---|
3470 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4600 | + current.modulation = (float) saturationField.getFloat(); |
---|
3471 | 4601 | current.metalness = (float) metalnessField.getFloat(); |
---|
3472 | 4602 | current.diffuse = (float) diffuseField.getFloat(); |
---|
3473 | 4603 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
3490 | 4620 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3491 | 4621 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3492 | 4622 | |
---|
3493 | | - if (!NumberSlider.frozen) |
---|
| 4623 | + if (!cNumberSlider.frozen) |
---|
3494 | 4624 | { |
---|
3495 | 4625 | //System.out.println("Propagate = " + propagate); |
---|
3496 | 4626 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 4627 | + |
---|
| 4628 | + if (copy.material != null) |
---|
| 4629 | + { |
---|
| 4630 | + cMaterial mat = copy.material; |
---|
| 4631 | + |
---|
| 4632 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4633 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4634 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4635 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4636 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4637 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4638 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4639 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4640 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4641 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4642 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4643 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4644 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4645 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4646 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4647 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4648 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4649 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4650 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4651 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4652 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4653 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4654 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4655 | + } |
---|
| 4656 | + |
---|
3497 | 4657 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3498 | 4658 | { |
---|
3499 | 4659 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3522 | 4682 | //copy.Touch(); |
---|
3523 | 4683 | } |
---|
3524 | 4684 | |
---|
| 4685 | + cNumberSlider versionSlider; |
---|
| 4686 | + |
---|
3525 | 4687 | public void stateChanged(ChangeEvent e) |
---|
3526 | 4688 | { |
---|
3527 | 4689 | // assert(false); |
---|
| 4690 | + if (e.getSource() == versionSlider) |
---|
| 4691 | + { |
---|
| 4692 | + if (muteSlider) |
---|
| 4693 | + return; |
---|
| 4694 | + |
---|
| 4695 | + int version = versionSlider.getInteger(); |
---|
| 4696 | + |
---|
| 4697 | + if (copy.versionlist[version] != null) |
---|
| 4698 | + { |
---|
| 4699 | + copy.versionindex = version; |
---|
| 4700 | + CopyChanged(); |
---|
| 4701 | + } |
---|
| 4702 | + |
---|
| 4703 | + return; |
---|
| 4704 | + } |
---|
3528 | 4705 | |
---|
3529 | 4706 | if (freezematerial) |
---|
3530 | 4707 | { |
---|
.. | .. |
---|
3538 | 4715 | || e.getSource() == apertureField |
---|
3539 | 4716 | || e.getSource() == shadowblurField) |
---|
3540 | 4717 | { |
---|
| 4718 | + new Exception().printStackTrace(); |
---|
3541 | 4719 | System.exit(0); |
---|
3542 | 4720 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3543 | 4721 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3559 | 4737 | { |
---|
3560 | 4738 | //System.out.println("stateChanged = " + this); |
---|
3561 | 4739 | materialtouched = true; |
---|
| 4740 | + |
---|
| 4741 | + if (e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4742 | + { |
---|
| 4743 | + saturationField.setFloat(1); |
---|
| 4744 | + } |
---|
| 4745 | + |
---|
3562 | 4746 | applySelf(); |
---|
3563 | 4747 | //System.out.println("this = " + this); |
---|
3564 | 4748 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
3608 | 4792 | } |
---|
3609 | 4793 | |
---|
3610 | 4794 | if (normalpushField != null) |
---|
3611 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 4795 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3612 | 4796 | } |
---|
3613 | 4797 | |
---|
3614 | 4798 | void SnapObject() |
---|
.. | .. |
---|
3858 | 5042 | { |
---|
3859 | 5043 | if (GetTree() != null) |
---|
3860 | 5044 | { |
---|
| 5045 | + GetTree().revalidate(); |
---|
3861 | 5046 | GetTree().repaint(); |
---|
3862 | 5047 | } |
---|
3863 | 5048 | |
---|
3864 | 5049 | radioPanel.revalidate(); |
---|
3865 | 5050 | radioPanel.repaint(); |
---|
3866 | | - ctrlPanel.revalidate(); // ? new |
---|
| 5051 | + ctrlPanel.validate(); // ? new |
---|
3867 | 5052 | ctrlPanel.repaint(); |
---|
3868 | 5053 | } |
---|
| 5054 | + |
---|
| 5055 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5056 | + SetUndoStates(); |
---|
3869 | 5057 | } |
---|
3870 | 5058 | |
---|
3871 | 5059 | static TweenManager tweenManager = new TweenManager(); |
---|
3872 | 5060 | |
---|
3873 | 5061 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3874 | 5062 | { |
---|
| 5063 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
| 5064 | + Save(); |
---|
3875 | 5065 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3876 | 5066 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3877 | 5067 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3958 | 5148 | { |
---|
3959 | 5149 | ResetModel(); |
---|
3960 | 5150 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 5151 | + |
---|
| 5152 | + if (thing.Size() == 0) |
---|
| 5153 | + { |
---|
| 5154 | + //EditSelection(false); |
---|
| 5155 | + } |
---|
| 5156 | + |
---|
3961 | 5157 | refreshContents(); |
---|
3962 | 5158 | } |
---|
3963 | 5159 | |
---|
.. | .. |
---|
4075 | 5271 | } |
---|
4076 | 5272 | } |
---|
4077 | 5273 | } |
---|
| 5274 | + |
---|
4078 | 5275 | LoadGFDThread loadGFDThread; |
---|
4079 | 5276 | |
---|
4080 | 5277 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4094 | 5291 | |
---|
4095 | 5292 | try |
---|
4096 | 5293 | { |
---|
| 5294 | + // Try compressed version first. |
---|
4097 | 5295 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4098 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5296 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 5297 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4099 | 5298 | |
---|
4100 | 5299 | readobj = (Object3D) p.readObject(); |
---|
4101 | 5300 | istream.close(); |
---|
.. | .. |
---|
4103 | 5302 | readobj.ResetDisplayList(); |
---|
4104 | 5303 | } catch (Exception e) |
---|
4105 | 5304 | { |
---|
4106 | | - e.printStackTrace(); |
---|
| 5305 | + if (!e.toString().contains("GZIP")) |
---|
| 5306 | + e.printStackTrace(); |
---|
| 5307 | + |
---|
| 5308 | + try |
---|
| 5309 | + { |
---|
| 5310 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 5311 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5312 | + |
---|
| 5313 | + readobj = (Object3D) p.readObject(); |
---|
| 5314 | + istream.close(); |
---|
| 5315 | + |
---|
| 5316 | + readobj.ResetDisplayList(); |
---|
| 5317 | + } catch (Exception e2) |
---|
| 5318 | + { |
---|
| 5319 | + e2.printStackTrace(); |
---|
| 5320 | + } |
---|
4107 | 5321 | } |
---|
4108 | 5322 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4109 | 5323 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4149 | 5363 | |
---|
4150 | 5364 | void LoadIt(Object obj) |
---|
4151 | 5365 | { |
---|
| 5366 | + if (obj == null) |
---|
| 5367 | + { |
---|
| 5368 | + // Invalid file |
---|
| 5369 | + return; |
---|
| 5370 | + } |
---|
| 5371 | + |
---|
4152 | 5372 | System.out.println("Loaded " + obj); |
---|
4153 | 5373 | //new Exception().printStackTrace(); |
---|
4154 | 5374 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4158 | 5378 | |
---|
4159 | 5379 | if (readobj != null) |
---|
4160 | 5380 | { |
---|
| 5381 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 5382 | + // Save(); |
---|
4161 | 5383 | try |
---|
4162 | 5384 | { |
---|
4163 | 5385 | //readobj.deepCopySelf(copy); |
---|
4164 | 5386 | copy.clear(); // june 2014 |
---|
| 5387 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5388 | + copy.skyboxext = readobj.skyboxext; |
---|
4165 | 5389 | for (int i = 0; i < readobj.size(); i++) |
---|
4166 | 5390 | { |
---|
4167 | 5391 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4202 | 5426 | } |
---|
4203 | 5427 | } catch (ClassCastException e) |
---|
4204 | 5428 | { |
---|
| 5429 | + e.printStackTrace(); |
---|
4205 | 5430 | assert (false); |
---|
4206 | 5431 | Composite c = (Composite) copy; |
---|
4207 | 5432 | c.children.clear(); |
---|
.. | .. |
---|
4212 | 5437 | c.addChild(csg); |
---|
4213 | 5438 | } |
---|
4214 | 5439 | |
---|
| 5440 | + copy.versionlist = readobj.versionlist; |
---|
| 5441 | + copy.versionindex = readobj.versionindex; |
---|
| 5442 | + |
---|
| 5443 | + if (copy.versionlist == null) |
---|
| 5444 | + { |
---|
| 5445 | + copy.versionlist = new Object3D[100]; |
---|
| 5446 | + copy.versionindex = -1; |
---|
| 5447 | + } |
---|
| 5448 | + |
---|
| 5449 | + //? SetUndoStates(); |
---|
| 5450 | + |
---|
4215 | 5451 | ResetModel(); |
---|
4216 | 5452 | copy.HardTouch(); // recompile? |
---|
4217 | 5453 | refreshContents(); |
---|
4218 | 5454 | } |
---|
4219 | 5455 | } |
---|
4220 | 5456 | |
---|
4221 | | - void load() // throws ClassNotFoundException |
---|
| 5457 | + void Open() // throws ClassNotFoundException |
---|
4222 | 5458 | { |
---|
4223 | | - if (GrafreeD.standAlone) |
---|
| 5459 | + if (Grafreed.standAlone) |
---|
4224 | 5460 | { |
---|
4225 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5461 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4226 | 5462 | browser.show(); |
---|
4227 | 5463 | String filename = browser.getFile(); |
---|
4228 | 5464 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4307 | 5543 | try |
---|
4308 | 5544 | { |
---|
4309 | 5545 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4310 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 5546 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5547 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4311 | 5548 | |
---|
4312 | 5549 | p.writeObject(copy); |
---|
4313 | 5550 | p.flush(); |
---|
4314 | 5551 | |
---|
| 5552 | + zstream.close(); |
---|
4315 | 5553 | ostream.close(); |
---|
4316 | 5554 | |
---|
4317 | 5555 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4319 | 5557 | //ps.print(buffer.toString()); |
---|
4320 | 5558 | } catch (IOException e) |
---|
4321 | 5559 | { |
---|
| 5560 | + e.printStackTrace(); |
---|
4322 | 5561 | } |
---|
4323 | 5562 | } |
---|
| 5563 | + |
---|
4324 | 5564 | String lastname; |
---|
4325 | 5565 | |
---|
4326 | 5566 | void saveAs() |
---|
4327 | 5567 | { |
---|
4328 | | - if (GrafreeD.standAlone) |
---|
| 5568 | + if (Grafreed.standAlone) |
---|
4329 | 5569 | { |
---|
4330 | 5570 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4331 | 5571 | browser.setVisible(true); |
---|
4332 | 5572 | String filename = browser.getFile(); |
---|
4333 | 5573 | if (filename != null && filename.length() > 0) |
---|
4334 | 5574 | { |
---|
| 5575 | + if (!filename.endsWith(".gfd")) |
---|
| 5576 | + filename += ".gfd"; |
---|
4335 | 5577 | lastname = browser.getDirectory() + filename; |
---|
4336 | 5578 | save(); |
---|
4337 | 5579 | } |
---|
.. | .. |
---|
4430 | 5672 | try |
---|
4431 | 5673 | { |
---|
4432 | 5674 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4433 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4434 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 5675 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5676 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4435 | 5677 | |
---|
4436 | 5678 | Object3D objectparent = obj.parent; |
---|
4437 | 5679 | obj.parent = null; |
---|
4438 | 5680 | |
---|
4439 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 5681 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4440 | 5682 | |
---|
4441 | 5683 | obj.parent = objectparent; |
---|
4442 | 5684 | |
---|
.. | .. |
---|
4448 | 5690 | p.writeObject(object); |
---|
4449 | 5691 | p.flush(); |
---|
4450 | 5692 | |
---|
| 5693 | + zstream.close(); |
---|
4451 | 5694 | ostream.close(); |
---|
4452 | | - // zstream.close(); |
---|
4453 | 5695 | |
---|
4454 | 5696 | // group.selection.get(0).parent = parent; |
---|
4455 | 5697 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4470 | 5712 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4471 | 5713 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4472 | 5714 | copy.generatePOV(buffer); |
---|
4473 | | - if (GrafreeD.standAlone) |
---|
| 5715 | + if (Grafreed.standAlone) |
---|
4474 | 5716 | { |
---|
4475 | 5717 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4476 | 5718 | browser.show(); |
---|
.. | .. |
---|
4496 | 5738 | Object3D client; |
---|
4497 | 5739 | Object3D copy; |
---|
4498 | 5740 | MenuBar menuBar; |
---|
4499 | | - Menu windowMenu; |
---|
4500 | | - MenuItem loadItem; |
---|
| 5741 | + Menu fileMenu; |
---|
| 5742 | + MenuItem newItem; |
---|
| 5743 | + MenuItem openItem; |
---|
4501 | 5744 | MenuItem saveItem; |
---|
4502 | 5745 | MenuItem saveAsItem; |
---|
4503 | 5746 | MenuItem exportAsItem; |
---|
4504 | 5747 | MenuItem reexportItem; |
---|
4505 | 5748 | MenuItem povItem; |
---|
4506 | 5749 | MenuItem closeItem; |
---|
4507 | | - Menu cameraMenu; |
---|
| 5750 | + |
---|
4508 | 5751 | CheckboxMenuItem zBufferItem; |
---|
4509 | 5752 | //MenuItem normalLensItem; |
---|
4510 | | - MenuItem editCameraItem; |
---|
4511 | | - MenuItem revertCameraItem; |
---|
4512 | | - CheckboxMenuItem toggleLiveItem; |
---|
4513 | 5753 | MenuItem stepItem; |
---|
| 5754 | + CheckboxMenuItem toggleLiveItem; |
---|
4514 | 5755 | CheckboxMenuItem toggleFullScreenItem; |
---|
4515 | 5756 | CheckboxMenuItem toggleTimelineItem; |
---|
4516 | 5757 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4519 | 5760 | CheckboxMenuItem toggleFootContactItem; |
---|
4520 | 5761 | CheckboxMenuItem toggleDLItem; |
---|
4521 | 5762 | CheckboxMenuItem toggleTextureItem; |
---|
4522 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 5763 | + CheckboxMenuItem toggleSwitchItem; |
---|
4523 | 5764 | CheckboxMenuItem toggleRootItem; |
---|
4524 | 5765 | CheckboxMenuItem animationItem; |
---|
| 5766 | + MenuItem archiveItem; |
---|
4525 | 5767 | CheckboxMenuItem toggleHandleItem; |
---|
4526 | 5768 | CheckboxMenuItem togglePaintItem; |
---|
4527 | 5769 | JSplitPane mainPanel; |
---|
4528 | 5770 | JScrollPane scrollpane; |
---|
| 5771 | + |
---|
4529 | 5772 | JPanel toolbarPanel; |
---|
4530 | | - JPanel treePanel; |
---|
| 5773 | + |
---|
| 5774 | + cGridBag treePanel; |
---|
| 5775 | + |
---|
4531 | 5776 | JPanel radioPanel; |
---|
4532 | 5777 | ButtonGroup buttonGroup; |
---|
4533 | | - JPanel ctrlPanel; |
---|
4534 | | - JPanel materialPanel; |
---|
| 5778 | + |
---|
| 5779 | + cGridBag toolboxPanel; |
---|
| 5780 | + cGridBag skyboxPanel; |
---|
| 5781 | + cGridBag materialPanel; |
---|
| 5782 | + cGridBag ctrlPanel; |
---|
| 5783 | + |
---|
4535 | 5784 | JScrollPane infoPanel; |
---|
4536 | | - JPanel optionsPanel; |
---|
| 5785 | + |
---|
| 5786 | + cGridBag optionsPanel; |
---|
| 5787 | + |
---|
4537 | 5788 | JTabbedPane objectPanel; |
---|
4538 | | - JPanel XYZPanel; |
---|
| 5789 | + boolean materialFlushed; |
---|
| 5790 | + Object3D latestObject; |
---|
| 5791 | + |
---|
| 5792 | + cGridBag XYZPanel; |
---|
| 5793 | + |
---|
4539 | 5794 | JSplitPane gridPanel; |
---|
4540 | 5795 | JSplitPane bigPanel; |
---|
4541 | | - JPanel bigThree; |
---|
4542 | | - JTabbedPane scenePanel; |
---|
4543 | | - JPanel centralPanel; |
---|
| 5796 | + |
---|
| 5797 | + cGridBag bigThree; |
---|
| 5798 | + cGridBag scenePanel; |
---|
| 5799 | + cGridBag centralPanel; |
---|
4544 | 5800 | JSplitPane cameraPanel; |
---|
4545 | 5801 | JPanel timelinePanel; |
---|
4546 | 5802 | JMenuBar timelineMenubar; |
---|
.. | .. |
---|
4593 | 5849 | // MATERIAL |
---|
4594 | 5850 | JLabel materialLabel; |
---|
4595 | 5851 | JLabel colorLabel; |
---|
4596 | | - NumberSlider colorField; |
---|
| 5852 | + cNumberSlider colorField; |
---|
4597 | 5853 | JLabel modulationLabel; |
---|
4598 | | - NumberSlider modulationField; |
---|
| 5854 | + cNumberSlider saturationField; |
---|
4599 | 5855 | JLabel metalnessLabel; |
---|
4600 | | - NumberSlider metalnessField; |
---|
| 5856 | + cNumberSlider metalnessField; |
---|
4601 | 5857 | JLabel diffuseLabel; |
---|
4602 | | - NumberSlider diffuseField; |
---|
| 5858 | + cNumberSlider diffuseField; |
---|
4603 | 5859 | JLabel specularLabel; |
---|
4604 | | - NumberSlider specularField; |
---|
| 5860 | + cNumberSlider specularField; |
---|
4605 | 5861 | JLabel shininessLabel; |
---|
4606 | | - NumberSlider shininessField; |
---|
| 5862 | + cNumberSlider shininessField; |
---|
4607 | 5863 | JLabel shiftLabel; |
---|
4608 | | - NumberSlider shiftField; |
---|
| 5864 | + cNumberSlider shiftField; |
---|
4609 | 5865 | JLabel ambientLabel; |
---|
4610 | | - NumberSlider ambientField; |
---|
| 5866 | + cNumberSlider ambientField; |
---|
4611 | 5867 | JLabel lightareaLabel; |
---|
4612 | | - NumberSlider lightareaField; |
---|
| 5868 | + cNumberSlider lightareaField; |
---|
4613 | 5869 | JLabel diffusenessLabel; |
---|
4614 | | - NumberSlider diffusenessField; |
---|
| 5870 | + cNumberSlider diffusenessField; |
---|
4615 | 5871 | JLabel velvetLabel; |
---|
4616 | | - NumberSlider velvetField; |
---|
| 5872 | + cNumberSlider velvetField; |
---|
4617 | 5873 | JLabel sheenLabel; |
---|
4618 | | - NumberSlider sheenField; |
---|
| 5874 | + cNumberSlider sheenField; |
---|
4619 | 5875 | JLabel subsurfaceLabel; |
---|
4620 | | - NumberSlider subsurfaceField; |
---|
| 5876 | + cNumberSlider subsurfaceField; |
---|
4621 | 5877 | //JLabel bumpLabel; |
---|
4622 | 5878 | //NumberSlider bumpField; |
---|
4623 | 5879 | JLabel backlitLabel; |
---|
4624 | | - NumberSlider backlitField; |
---|
| 5880 | + cNumberSlider backlitField; |
---|
4625 | 5881 | JLabel anisoLabel; |
---|
4626 | | - NumberSlider anisoField; |
---|
| 5882 | + cNumberSlider anisoField; |
---|
4627 | 5883 | JLabel anisoVLabel; |
---|
4628 | | - NumberSlider anisoVField; |
---|
| 5884 | + cNumberSlider anisoVField; |
---|
4629 | 5885 | JLabel cameraLabel; |
---|
4630 | | - NumberSlider cameraField; |
---|
| 5886 | + cNumberSlider cameraField; |
---|
4631 | 5887 | JLabel selfshadowLabel; |
---|
4632 | | - NumberSlider selfshadowField; |
---|
| 5888 | + cNumberSlider selfshadowField; |
---|
4633 | 5889 | JLabel shadowLabel; |
---|
4634 | | - NumberSlider shadowField; |
---|
| 5890 | + cNumberSlider shadowField; |
---|
4635 | 5891 | JLabel textureLabel; |
---|
4636 | | - NumberSlider textureField; |
---|
| 5892 | + cNumberSlider textureField; |
---|
4637 | 5893 | JLabel opacityLabel; |
---|
4638 | | - NumberSlider opacityField; |
---|
| 5894 | + cNumberSlider opacityField; |
---|
4639 | 5895 | JLabel fakedepthLabel; |
---|
4640 | | - NumberSlider fakedepthField; |
---|
| 5896 | + cNumberSlider fakedepthField; |
---|
4641 | 5897 | JLabel shadowbiasLabel; |
---|
4642 | | - NumberSlider shadowbiasField; |
---|
| 5898 | + cNumberSlider shadowbiasField; |
---|
4643 | 5899 | JLabel bumpLabel; |
---|
4644 | | - NumberSlider bumpField; |
---|
| 5900 | + cNumberSlider bumpField; |
---|
4645 | 5901 | JLabel noiseLabel; |
---|
4646 | | - NumberSlider noiseField; |
---|
| 5902 | + cNumberSlider noiseField; |
---|
4647 | 5903 | JLabel powerLabel; |
---|
4648 | | - NumberSlider powerField; |
---|
| 5904 | + cNumberSlider powerField; |
---|
4649 | 5905 | JLabel borderfadeLabel; |
---|
4650 | | - NumberSlider borderfadeField; |
---|
| 5906 | + cNumberSlider borderfadeField; |
---|
4651 | 5907 | JLabel fogLabel; |
---|
4652 | | - NumberSlider fogField; |
---|
| 5908 | + cNumberSlider fogField; |
---|
4653 | 5909 | JLabel opacityPowerLabel; |
---|
4654 | | - NumberSlider opacityPowerField; |
---|
4655 | | - JTree jTree; |
---|
| 5910 | + cNumberSlider opacityPowerField; |
---|
| 5911 | + cTree jTree; |
---|
4656 | 5912 | //ObjectUI parent; |
---|
4657 | 5913 | |
---|
4658 | | - NumberSlider normalpushField; |
---|
| 5914 | + cNumberSlider normalpushField; |
---|
| 5915 | + |
---|
| 5916 | + private MenuItem importGFDItem; |
---|
| 5917 | + private MenuItem importVRMLX3DItem; |
---|
| 5918 | + private MenuItem import3DSItem; |
---|
| 5919 | + private MenuItem importOBJItem; |
---|
4659 | 5920 | } |
---|