.. | .. |
---|
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.*; |
---|
.. | .. |
---|
13 | 14 | import javax.swing.plaf.metal.MetalLookAndFeel; |
---|
14 | 15 | //import javax.swing.plaf.ColorUIResource; |
---|
15 | 16 | //import javax.swing.plaf.metal.DefaultMetalTheme; |
---|
| 17 | + |
---|
| 18 | +import javax.swing.plaf.basic.BasicSplitPaneDivider; |
---|
| 19 | +import javax.swing.plaf.basic.BasicSplitPaneUI; |
---|
16 | 20 | |
---|
17 | 21 | //import javax.media.opengl.GLCanvas; |
---|
18 | 22 | |
---|
.. | .. |
---|
30 | 34 | iSendInfo |
---|
31 | 35 | //KeyListener |
---|
32 | 36 | { |
---|
| 37 | + public cToggleButton pinButton; |
---|
33 | 38 | boolean timeline; |
---|
34 | 39 | boolean wasFullScreen; |
---|
35 | 40 | |
---|
36 | 41 | GroupEditor callee; |
---|
37 | 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 | + } |
---|
38 | 118 | |
---|
39 | 119 | // SCRIPT |
---|
40 | 120 | |
---|
.. | .. |
---|
138 | 218 | public void closeUI() |
---|
139 | 219 | { |
---|
140 | 220 | //new Exception().printStackTrace(); |
---|
141 | | - System.out.println("this = " + this); |
---|
142 | | - System.out.println("objEditor = " + objEditor); |
---|
| 221 | +// System.out.println("this = " + this); |
---|
| 222 | +// System.out.println("objEditor = " + objEditor); |
---|
143 | 223 | //nameField.removeActionListener(this); |
---|
144 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 224 | +// objEditor.ctrlPanel.remove(nameField); |
---|
145 | 225 | |
---|
146 | | - if (!GroupEditor.allparams) |
---|
| 226 | + objEditor.ctrlPanel.remove(namePanel); |
---|
| 227 | + |
---|
| 228 | + if (!allparams) |
---|
147 | 229 | return; |
---|
148 | 230 | |
---|
149 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
150 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
151 | | - objEditor.ctrlPanel.remove(markCB); |
---|
152 | | - |
---|
153 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
154 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
155 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
156 | | - |
---|
157 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
158 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
159 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
160 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
161 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
162 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
163 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
164 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
165 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
166 | | - 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); |
---|
167 | 249 | |
---|
168 | | - 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); |
---|
169 | 257 | } |
---|
170 | 258 | |
---|
171 | 259 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
209 | 297 | client = inClient; |
---|
210 | 298 | copy = client; |
---|
211 | 299 | |
---|
| 300 | + if (copy.versionlist == null) |
---|
| 301 | + { |
---|
| 302 | + copy.versionlist = new Object3D[100]; |
---|
| 303 | + copy.versionindex = -1; |
---|
| 304 | + } |
---|
| 305 | + |
---|
212 | 306 | // "this" is not called: SetupUI2(objEditor); |
---|
213 | 307 | } |
---|
214 | 308 | |
---|
.. | .. |
---|
222 | 316 | client = inClient; |
---|
223 | 317 | copy = client; |
---|
224 | 318 | |
---|
| 319 | + if (copy.versionlist == null) |
---|
| 320 | + { |
---|
| 321 | + copy.versionlist = new Object3D[100]; |
---|
| 322 | + copy.versionindex = -1; |
---|
| 323 | + } |
---|
| 324 | + |
---|
225 | 325 | SetupUI2(callee.GetEditor()); |
---|
226 | 326 | } |
---|
227 | 327 | |
---|
.. | .. |
---|
236 | 336 | //localCopy.parent = null; |
---|
237 | 337 | |
---|
238 | 338 | frame = new JFrame(); |
---|
| 339 | + frame.setUndecorated(false); |
---|
239 | 340 | objEditor = this; |
---|
240 | 341 | this.callee = callee; |
---|
241 | 342 | |
---|
.. | .. |
---|
253 | 354 | copy = localCopy; |
---|
254 | 355 | copy.editWindow = this; |
---|
255 | 356 | |
---|
| 357 | + if (copy.versionlist == null) |
---|
| 358 | + { |
---|
| 359 | +// copy.versions = new byte[100][]; |
---|
| 360 | +// copy.versionindex = -1; |
---|
| 361 | + } |
---|
| 362 | + |
---|
256 | 363 | SetupMenu(); |
---|
257 | 364 | |
---|
258 | 365 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
266 | 373 | return frame.action(event, obj); |
---|
267 | 374 | } |
---|
268 | 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 | + |
---|
269 | 381 | void SetupMenu() |
---|
270 | 382 | { |
---|
271 | 383 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
272 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
273 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
274 | | - windowMenu.add("-"); |
---|
275 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
276 | | - 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...")); |
---|
277 | 404 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
278 | | - windowMenu.add("-"); |
---|
279 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
280 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
281 | | - windowMenu.add("-"); |
---|
| 405 | + fileMenu.add("-"); |
---|
| 406 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 407 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 408 | + fileMenu.add("-"); |
---|
282 | 409 | if (client.parent != null) |
---|
283 | 410 | { |
---|
284 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 411 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
285 | 412 | } else |
---|
286 | 413 | { |
---|
287 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 414 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
288 | 415 | } |
---|
289 | 416 | |
---|
290 | | - loadItem.addActionListener(this); |
---|
| 417 | + newItem.addActionListener(this); |
---|
| 418 | + openItem.addActionListener(this); |
---|
291 | 419 | saveItem.addActionListener(this); |
---|
292 | 420 | saveAsItem.addActionListener(this); |
---|
293 | 421 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
295 | 423 | //povItem.addActionListener(this); |
---|
296 | 424 | closeItem.addActionListener(this); |
---|
297 | 425 | |
---|
298 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
299 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
300 | | - //zBufferItem.addActionListener(this); |
---|
301 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
302 | | - //normalLensItem.addActionListener(this); |
---|
303 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
304 | | - revertCameraItem.addActionListener(this); |
---|
305 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
306 | | - toggleTimelineItem.addItemListener(this); |
---|
307 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
308 | | - toggleFullScreenItem.addItemListener(this); |
---|
309 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
310 | | - cameraMenu.add("-"); |
---|
311 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
312 | | - toggleTextureItem.addItemListener(this); |
---|
313 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
314 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
315 | | - toggleLiveItem.addItemListener(this); |
---|
316 | | - toggleLiveItem.setState(Globals.isLIVE()); |
---|
317 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
318 | | - stepItem.addActionListener(this); |
---|
319 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
320 | | -// toggleDLItem.addItemListener(this); |
---|
321 | | -// toggleDLItem.setState(false); |
---|
322 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
323 | | - toggleRenderItem.addItemListener(this); |
---|
324 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
325 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
326 | | - toggleDebugItem.addItemListener(this); |
---|
327 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
328 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
329 | | - toggleFrustumItem.addItemListener(this); |
---|
330 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
331 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
332 | | - toggleFootContactItem.addItemListener(this); |
---|
333 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
334 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
335 | | - toggleRandomItem.addItemListener(this); |
---|
336 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
337 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
338 | | - toggleHandleItem.addItemListener(this); |
---|
339 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
340 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
341 | | - togglePaintItem.addItemListener(this); |
---|
342 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
343 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
344 | | -// toggleRootItem.addItemListener(this); |
---|
345 | | -// toggleRootItem.setState(false); |
---|
346 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
347 | | -// animationItem.addItemListener(this); |
---|
348 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
349 | | - cameraMenu.add("-"); |
---|
350 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
351 | | - editCameraItem.addActionListener(this); |
---|
352 | | - |
---|
353 | 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 | + |
---|
354 | 453 | toolbarPanel = new JPanel(); |
---|
355 | 454 | toolbarPanel.setName("Toolbar"); |
---|
356 | | - treePanel = new JPanel(); |
---|
| 455 | + |
---|
| 456 | + treePanel = new cGridBag(); |
---|
357 | 457 | treePanel.setName("Tree"); |
---|
358 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
359 | | - ctrlPanel.setName("Edit"); |
---|
360 | | - materialPanel = new JPanel(); |
---|
361 | | - 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 | + |
---|
362 | 476 | /*JTextPane*/ |
---|
363 | 477 | infoarea = createTextPane(); |
---|
| 478 | + doc = infoarea.getStyledDocument(); |
---|
| 479 | + |
---|
364 | 480 | infoarea.setEditable(true); |
---|
365 | 481 | SetText(); |
---|
| 482 | + |
---|
366 | 483 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
367 | 484 | // infoarea.setOpaque(false); |
---|
368 | 485 | // //infoarea.setForeground(textcolor); |
---|
369 | | - infoarea.setLineWrap(true); |
---|
370 | | - infoarea.setWrapStyleWord(true); |
---|
| 486 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 487 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
371 | 488 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
372 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
373 | | - infoPanel.setName("Info"); |
---|
| 489 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
| 490 | + //infoPanel.setName("Info"); |
---|
374 | 491 | //infoPanel.setLayout(new BorderLayout()); |
---|
375 | 492 | //infoPanel.add(createTextPane()); |
---|
376 | 493 | |
---|
.. | .. |
---|
378 | 495 | mainPanel.setName("Main"); |
---|
379 | 496 | mainPanel.setContinuousLayout(true); |
---|
380 | 497 | mainPanel.setOneTouchExpandable(true); |
---|
381 | | - mainPanel.setDividerLocation(1.0); |
---|
382 | 498 | mainPanel.setDividerSize(9); |
---|
383 | | - mainPanel.setResizeWeight(0); |
---|
384 | | - |
---|
| 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 | + |
---|
385 | 509 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
386 | 510 | //mainPanel.setLayout(new GridBagLayout()); |
---|
387 | 511 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
388 | | - treePanel.setLayout(new GridBagLayout()); |
---|
389 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
390 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 512 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 513 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 514 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
391 | 515 | |
---|
392 | 516 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
393 | 517 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
426 | 550 | static String newline = "\n"; |
---|
427 | 551 | protected static final String buttonString = "JButton"; |
---|
428 | 552 | StyledDocument doc; |
---|
429 | | - JTextArea infoarea; |
---|
| 553 | + JTextPane infoarea; |
---|
430 | 554 | |
---|
431 | 555 | void ClearInfo() |
---|
432 | 556 | { |
---|
.. | .. |
---|
449 | 573 | e.printStackTrace(); |
---|
450 | 574 | } |
---|
451 | 575 | |
---|
452 | | - String selection = infoarea.getText(); |
---|
453 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
454 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
455 | | - 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(); |
---|
456 | 580 | //clipboard.setContents(data, data); |
---|
457 | 581 | } |
---|
458 | 582 | |
---|
.. | .. |
---|
475 | 599 | //SendInfo("Name:", "bold"); |
---|
476 | 600 | if (sel.GetTextures() != null || debug) |
---|
477 | 601 | { |
---|
478 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 602 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
479 | 603 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
480 | 604 | if (sel.Size() > 0) |
---|
481 | 605 | { |
---|
482 | 606 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
483 | 607 | } |
---|
484 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 608 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
485 | 609 | if (debug) |
---|
486 | 610 | { |
---|
487 | 611 | try |
---|
.. | .. |
---|
493 | 617 | } |
---|
494 | 618 | |
---|
495 | 619 | if (full) |
---|
496 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 620 | + { |
---|
| 621 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 622 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 623 | + } |
---|
497 | 624 | |
---|
498 | 625 | if (sel.bRep != null) |
---|
499 | 626 | { |
---|
.. | .. |
---|
520 | 647 | } |
---|
521 | 648 | if (sel.support != null) |
---|
522 | 649 | { |
---|
523 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 650 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
524 | 651 | } |
---|
525 | 652 | if (sel.scriptnode != null) |
---|
526 | 653 | { |
---|
.. | .. |
---|
591 | 718 | { |
---|
592 | 719 | CameraPane.pointflow = (PointFlow) sel; |
---|
593 | 720 | } |
---|
| 721 | + |
---|
| 722 | + si.SendInfo("_____________________", "regular"); |
---|
| 723 | + si.SendInfo("", "regular"); |
---|
594 | 724 | } |
---|
595 | 725 | } |
---|
596 | 726 | |
---|
.. | .. |
---|
606 | 736 | } |
---|
607 | 737 | } |
---|
608 | 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 | + cButton expandedLayout; |
---|
| 758 | + |
---|
| 759 | + void Minimize() |
---|
| 760 | + { |
---|
| 761 | + frame.setState(Frame.ICONIFIED); |
---|
| 762 | + frame.validate(); |
---|
| 763 | + } |
---|
| 764 | + |
---|
| 765 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 766 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 767 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
| 768 | + void Maximize() |
---|
| 769 | + { |
---|
| 770 | + if (CameraPane.FULLSCREEN) |
---|
| 771 | + { |
---|
| 772 | + ToggleFullScreen(); |
---|
| 773 | + } |
---|
| 774 | + |
---|
| 775 | + if (maximized) |
---|
| 776 | + { |
---|
| 777 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 778 | + } |
---|
| 779 | + else |
---|
| 780 | + { |
---|
| 781 | + keeprect = frame.getBounds(); |
---|
| 782 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 783 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 784 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 785 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 786 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
| 787 | + } |
---|
| 788 | + |
---|
| 789 | + maximized ^= true; |
---|
| 790 | + |
---|
| 791 | + frame.validate(); |
---|
| 792 | + } |
---|
| 793 | + |
---|
| 794 | + cButton minButton; |
---|
| 795 | + cButton maxButton; |
---|
| 796 | + cButton fullButton; |
---|
| 797 | + cButton collapseButton; |
---|
| 798 | + cButton maximize3DButton; |
---|
| 799 | + |
---|
609 | 800 | void ToggleFullScreen() |
---|
610 | 801 | { |
---|
611 | | - if (CameraPane.FULLSCREEN) |
---|
| 802 | + GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 803 | + |
---|
| 804 | + cameraView.ToggleFullScreen(); |
---|
| 805 | + |
---|
| 806 | + if (!CameraPane.FULLSCREEN) |
---|
612 | 807 | { |
---|
613 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
614 | | - framePanel.add(bigThree); |
---|
615 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 808 | + device.setFullScreenWindow(null); |
---|
| 809 | + frame.dispose(); |
---|
| 810 | + frame.setUndecorated(false); |
---|
| 811 | + frame.validate(); |
---|
| 812 | + frame.setVisible(true); |
---|
| 813 | + |
---|
| 814 | + //frame.setVisible(false); |
---|
| 815 | +// frame.removeNotify(); |
---|
| 816 | +// frame.setUndecorated(false); |
---|
| 817 | +// frame.addNotify(); |
---|
| 818 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 819 | + |
---|
| 820 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 821 | +// X framePanel.add(bigThree); |
---|
| 822 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 823 | +// framePanel.setDividerLocation(46); // icons are 24x24 |
---|
| 824 | + |
---|
| 825 | + //frame.setVisible(true); |
---|
| 826 | +// radio.layout = keepButton; |
---|
| 827 | + //theFrame = null; |
---|
| 828 | + keepButton = null; |
---|
| 829 | +// radio.layout.doClick(); |
---|
| 830 | + |
---|
616 | 831 | } else |
---|
617 | 832 | { |
---|
618 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
619 | | - framePanel.remove(bigThree); |
---|
620 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 833 | + keepButton = radio.layout; |
---|
| 834 | + //keeprect = frame.getBounds(); |
---|
| 835 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 836 | +// frame.getToolkit().getScreenSize().height); |
---|
| 837 | + //frame.setVisible(false); |
---|
| 838 | + |
---|
| 839 | + frame.dispose(); |
---|
| 840 | + frame.setUndecorated(true); |
---|
| 841 | + device.setFullScreenWindow(frame); |
---|
| 842 | + frame.validate(); |
---|
| 843 | + frame.setVisible(true); |
---|
| 844 | +// frame.removeNotify(); |
---|
| 845 | +// frame.setUndecorated(true); |
---|
| 846 | +// frame.addNotify(); |
---|
| 847 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 848 | +// X framePanel.remove(bigThree); |
---|
| 849 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 850 | +// framePanel.setDividerLocation(0); |
---|
| 851 | + |
---|
| 852 | +// radio.layout = fullscreenLayout; |
---|
| 853 | +// radio.layout.doClick(); |
---|
| 854 | + //frame.setVisible(true); |
---|
621 | 855 | } |
---|
622 | | - cameraView.ToggleFullScreen(); |
---|
| 856 | + frame.validate(); |
---|
| 857 | + |
---|
| 858 | + cameraView.requestFocusInWindow(); |
---|
623 | 859 | } |
---|
624 | 860 | |
---|
625 | | - private JTextArea createTextPane() |
---|
| 861 | + void CollapseToolbar() |
---|
| 862 | + { |
---|
| 863 | + framePanel.setDividerLocation(0); |
---|
| 864 | + //frame.validate(); |
---|
| 865 | + |
---|
| 866 | + cameraView.requestFocusInWindow(); |
---|
| 867 | + } |
---|
| 868 | + |
---|
| 869 | + private Object3D Duplicate(Object3D object) |
---|
626 | 870 | { |
---|
627 | | - String[] initString = |
---|
628 | | - { |
---|
629 | | - "This is an editable JTextPane, ", //regular |
---|
630 | | - "another ", //italic |
---|
631 | | - "styled ", //bold |
---|
632 | | - "text ", //small |
---|
633 | | - "component, ", //large |
---|
634 | | - "which supports embedded components..." + newline,//regular |
---|
635 | | - " " + newline, //button |
---|
636 | | - "...and embedded icons..." + newline, //regular |
---|
637 | | - " ", //icon |
---|
638 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
639 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
640 | | - + "cover methods for interacting with those objects." |
---|
641 | | - }; |
---|
| 871 | + boolean temp = CameraPane.SWITCH; |
---|
| 872 | + CameraPane.SWITCH = false; |
---|
| 873 | + |
---|
| 874 | + object.ExtractBigData(versiontable); |
---|
| 875 | + // if (copy == client) |
---|
| 876 | + |
---|
| 877 | + Object3D versions[] = object.versionlist; |
---|
| 878 | + object.versionlist = null; |
---|
| 879 | + |
---|
| 880 | + //byte[] compress = Compress(copy); |
---|
| 881 | + Object3D compress = (Object3D)Grafreed.clone(object); |
---|
| 882 | + |
---|
| 883 | + object.versionlist = versions; |
---|
| 884 | + |
---|
| 885 | + object.RestoreBigData(versiontable); |
---|
| 886 | + |
---|
| 887 | + CameraPane.SWITCH = temp; |
---|
| 888 | + |
---|
| 889 | + return compress; |
---|
| 890 | + } |
---|
642 | 891 | |
---|
643 | | - String[] initStyles = |
---|
644 | | - { |
---|
645 | | - "regular", "italic", "bold", "small", "large", |
---|
646 | | - "regular", "button", "regular", "icon", |
---|
647 | | - "regular" |
---|
648 | | - }; |
---|
| 892 | + private JTextPane createTextPane() |
---|
| 893 | + { |
---|
| 894 | +// TEXTAREA String[] initString = |
---|
| 895 | +// { |
---|
| 896 | +// "This is an editable JTextPane, ", //regular |
---|
| 897 | +// "another ", //italic |
---|
| 898 | +// "styled ", //bold |
---|
| 899 | +// "text ", //small |
---|
| 900 | +// "component, ", //large |
---|
| 901 | +// "which supports embedded components..." + newline,//regular |
---|
| 902 | +// " " + newline, //button |
---|
| 903 | +// "...and embedded icons..." + newline, //regular |
---|
| 904 | +// " ", //icon |
---|
| 905 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 906 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 907 | +// + "cover methods for interacting with those objects." |
---|
| 908 | +// }; |
---|
| 909 | +// |
---|
| 910 | +// String[] initStyles = |
---|
| 911 | +// { |
---|
| 912 | +// "regular", "italic", "bold", "small", "large", |
---|
| 913 | +// "regular", "button", "regular", "icon", |
---|
| 914 | +// "regular" |
---|
| 915 | +// }; |
---|
| 916 | +// |
---|
| 917 | +// JTextPane textPane = new JTextPane(); |
---|
| 918 | +// textPane.setEditable(true); |
---|
| 919 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 920 | +// addStylesToDocument(doc); |
---|
| 921 | +// |
---|
| 922 | +// try |
---|
| 923 | +// { |
---|
| 924 | +// for (int j = 0; j < 2; j++) |
---|
| 925 | +// { |
---|
| 926 | +// for (int i = 0; i < initString.length; i++) |
---|
| 927 | +// { |
---|
| 928 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 929 | +// doc.getStyle(initStyles[i])); |
---|
| 930 | +// } |
---|
| 931 | +// } |
---|
| 932 | +// } catch (BadLocationException ble) |
---|
| 933 | +// { |
---|
| 934 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 935 | +// } |
---|
649 | 936 | |
---|
650 | | - JTextPane textPane = new JTextPane(); |
---|
651 | | - textPane.setEditable(true); |
---|
652 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
653 | | - addStylesToDocument(doc); |
---|
654 | | - |
---|
655 | | - try |
---|
656 | | - { |
---|
657 | | - for (int j = 0; j < 2; j++) |
---|
658 | | - { |
---|
659 | | - for (int i = 0; i < initString.length; i++) |
---|
660 | | - { |
---|
661 | | - doc.insertString(doc.getLength(), initString[i], |
---|
662 | | - doc.getStyle(initStyles[i])); |
---|
663 | | - } |
---|
664 | | - } |
---|
665 | | - } catch (BadLocationException ble) |
---|
666 | | - { |
---|
667 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
668 | | - } |
---|
669 | | - |
---|
670 | | - return new JTextArea(); // textPane; |
---|
| 937 | + return new JTextPane(); // textPane; |
---|
671 | 938 | } |
---|
672 | 939 | |
---|
673 | 940 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
720 | 987 | protected static ImageIcon createImageIcon(String path, |
---|
721 | 988 | String description) |
---|
722 | 989 | { |
---|
723 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 990 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
724 | 991 | if (imgURL != null) |
---|
725 | 992 | { |
---|
726 | 993 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
743 | 1010 | { |
---|
744 | 1011 | SetupMaterial(materialPanel); |
---|
745 | 1012 | } |
---|
| 1013 | + |
---|
746 | 1014 | //SetupName(); |
---|
747 | 1015 | //SetupViews(); |
---|
748 | 1016 | } |
---|
.. | .. |
---|
752 | 1020 | // NumberSlider vDivsField; |
---|
753 | 1021 | // JCheckBox endcaps; |
---|
754 | 1022 | JCheckBox liveCB; |
---|
| 1023 | + JCheckBox selectableCB; |
---|
755 | 1024 | JCheckBox hideCB; |
---|
756 | 1025 | JCheckBox link2masterCB; |
---|
757 | 1026 | JCheckBox markCB; |
---|
.. | .. |
---|
759 | 1028 | JCheckBox speedupCB; |
---|
760 | 1029 | JCheckBox rewindCB; |
---|
761 | 1030 | JCheckBox flipVCB; |
---|
| 1031 | + |
---|
| 1032 | + cCheckBox toggleTextureCB; |
---|
| 1033 | + cCheckBox toggleSwitchCB; |
---|
| 1034 | + |
---|
762 | 1035 | JComboBox texresMenu; |
---|
| 1036 | + |
---|
763 | 1037 | JButton resetButton; |
---|
764 | 1038 | JButton stepButton; |
---|
765 | 1039 | JButton stepAllButton; |
---|
.. | .. |
---|
767 | 1041 | JButton slowerButton; |
---|
768 | 1042 | JButton fasterButton; |
---|
769 | 1043 | JButton remarkButton; |
---|
| 1044 | + |
---|
| 1045 | + cGridBag editPanel; |
---|
| 1046 | + cGridBag editCommandsPanel; |
---|
| 1047 | + |
---|
| 1048 | + cGridBag namePanel; |
---|
| 1049 | + cGridBag setupPanel; |
---|
| 1050 | + cGridBag setupPanel2; |
---|
| 1051 | + cGridBag objectCommandsPanel; |
---|
| 1052 | + cGridBag pushPanel; |
---|
| 1053 | + cGridBag fillPanel; |
---|
770 | 1054 | |
---|
771 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 1055 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
772 | 1056 | { |
---|
773 | 1057 | JCheckBox cb; |
---|
774 | 1058 | |
---|
775 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
776 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
777 | | -// oe.aConstraints.weightx = 1; |
---|
778 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
779 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1059 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
780 | 1060 | cb.addItemListener(this); |
---|
781 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
782 | | - oe.aConstraints.gridwidth = 1; |
---|
783 | | - oe.aConstraints.gridx += 1; |
---|
784 | 1061 | |
---|
785 | 1062 | return cb; |
---|
786 | 1063 | } |
---|
787 | 1064 | |
---|
788 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 1065 | + cButton AddButton(cGridBag panel, String label) |
---|
789 | 1066 | { |
---|
790 | 1067 | cButton cb; |
---|
791 | 1068 | |
---|
792 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
793 | | - oe.aConstraints.gridwidth = 1; |
---|
794 | | -// oe.aConstraints.weightx = 1; |
---|
795 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
796 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 1069 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
797 | 1070 | cb.addActionListener(this); |
---|
798 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
799 | | - oe.aConstraints.gridwidth = 1; |
---|
800 | | - oe.aConstraints.gridx += 1; |
---|
801 | 1071 | |
---|
802 | 1072 | return cb; |
---|
803 | 1073 | } |
---|
804 | 1074 | |
---|
805 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 1075 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
806 | 1076 | { |
---|
807 | 1077 | JComboBox combo; |
---|
808 | 1078 | |
---|
809 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
810 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
811 | | - oe.aConstraints.gridx += 1; |
---|
| 1079 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
812 | 1080 | combo.addActionListener(this); |
---|
813 | 1081 | |
---|
814 | 1082 | return combo; |
---|
815 | 1083 | } |
---|
816 | 1084 | |
---|
817 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 1085 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
818 | 1086 | { |
---|
819 | | - NumberSlider combo; |
---|
| 1087 | + cGridBag control = new cGridBag(); |
---|
| 1088 | + |
---|
| 1089 | + cNumberSlider combo; |
---|
820 | 1090 | |
---|
821 | 1091 | JLabel jlabel = new JLabel(label); |
---|
822 | | - |
---|
823 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
824 | 1092 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
825 | | - aConstraints.gridwidth = 1; |
---|
826 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
827 | | - aConstraints.gridx += 1; |
---|
828 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
829 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
830 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
831 | | - aConstraints.gridx += 1; |
---|
832 | | - aConstraints.gridwidth = 1; |
---|
833 | | - |
---|
| 1093 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1094 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
834 | 1095 | combo.setFloat(current); |
---|
835 | | - |
---|
836 | | - combo.label = jlabel; |
---|
837 | | - |
---|
838 | | - combo.addChangeListener(this); |
---|
839 | | - |
---|
840 | | - return combo; |
---|
| 1096 | + |
---|
| 1097 | + panel.add(control); |
---|
| 1098 | + |
---|
| 1099 | + return control; |
---|
841 | 1100 | } |
---|
842 | 1101 | |
---|
843 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 1102 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
844 | 1103 | { |
---|
845 | | - NumberSlider combo; |
---|
| 1104 | + cGridBag control = new cGridBag(); |
---|
| 1105 | + |
---|
| 1106 | + cNumberSlider combo; |
---|
846 | 1107 | |
---|
847 | 1108 | JLabel jlabel = new JLabel(label); |
---|
848 | | - |
---|
849 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
850 | 1109 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
851 | | - aConstraints.gridwidth = 2; |
---|
852 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
853 | | - aConstraints.gridx += 1; |
---|
854 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
855 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
856 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
857 | | - aConstraints.gridx += 1; |
---|
858 | | - aConstraints.gridwidth = 1; |
---|
859 | | - |
---|
| 1110 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1111 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
860 | 1112 | combo.setInteger(current); |
---|
861 | 1113 | |
---|
862 | | - combo.label = jlabel; |
---|
863 | | - |
---|
864 | | - combo.addChangeListener(this); |
---|
865 | | - |
---|
866 | | - return combo; |
---|
| 1114 | + panel.add(control); |
---|
| 1115 | + |
---|
| 1116 | + return control; |
---|
867 | 1117 | } |
---|
868 | 1118 | |
---|
869 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 1119 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
870 | 1120 | { |
---|
871 | 1121 | JTextArea text; |
---|
872 | 1122 | |
---|
873 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
874 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
875 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1123 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
876 | 1124 | text.addCaretListener(this); |
---|
877 | | - aConstraints.gridx += 1; |
---|
878 | | - aConstraints.gridwidth = 1; |
---|
879 | 1125 | |
---|
880 | 1126 | return text; |
---|
881 | 1127 | } |
---|
.. | .. |
---|
905 | 1151 | objEditor.ctrlPanel.remove(j); |
---|
906 | 1152 | } |
---|
907 | 1153 | |
---|
| 1154 | + void Remove(cNumberSlider j) |
---|
| 1155 | + { |
---|
| 1156 | + j.removeChangeListener(this); |
---|
| 1157 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 1158 | + objEditor.ctrlPanel.remove(j); |
---|
| 1159 | + } |
---|
| 1160 | + |
---|
908 | 1161 | /* |
---|
909 | 1162 | */ |
---|
910 | | - void Return() // ObjEditor oe) |
---|
| 1163 | + void Return0() // ObjEditor oe) |
---|
911 | 1164 | { |
---|
912 | 1165 | aConstraints.gridy += 1; |
---|
913 | 1166 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
962 | 1215 | |
---|
963 | 1216 | void SetupUI2(ObjEditor oe) |
---|
964 | 1217 | { |
---|
965 | | -// oe.aConstraints.weightx = 0; |
---|
966 | | -// oe.aConstraints.weighty = 0; |
---|
967 | | -// oe.aConstraints.gridx = 0; |
---|
968 | | -// oe.aConstraints.gridy = 0; |
---|
969 | | - SetupName(oe); |
---|
| 1218 | + //SetupName(oe); |
---|
970 | 1219 | |
---|
971 | | - if (!GroupEditor.allparams) |
---|
| 1220 | + namePanel = new cGridBag(); |
---|
| 1221 | + |
---|
| 1222 | + //if (copy.pinned) |
---|
| 1223 | + { |
---|
| 1224 | + pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1225 | + pinButton.setSelected(copy.pinned); |
---|
| 1226 | + cGridBag t = new cGridBag(); |
---|
| 1227 | + t.preferredWidth = 2; |
---|
| 1228 | + t.add(pinButton); |
---|
| 1229 | + namePanel.add(t); |
---|
| 1230 | + |
---|
| 1231 | + pinButton.addItemListener(this); |
---|
| 1232 | + } |
---|
| 1233 | + |
---|
| 1234 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 1235 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
| 1236 | + oe.ctrlPanel.add(namePanel); |
---|
| 1237 | + |
---|
| 1238 | + oe.ctrlPanel.Return(); |
---|
| 1239 | + |
---|
| 1240 | + if (!allparams) |
---|
972 | 1241 | return; |
---|
973 | 1242 | |
---|
974 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
975 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
976 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1243 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1244 | + |
---|
| 1245 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1246 | + liveCB.setToolTipText("Animate object"); |
---|
| 1247 | + selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1248 | + selectableCB.setToolTipText("Make object selectable"); |
---|
977 | 1249 | // Return(); |
---|
978 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
979 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
980 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
981 | | - Return(); |
---|
982 | | - resetButton = AddButton(oe, "Reset"); |
---|
983 | | - stepButton = AddButton(oe, "Step"); |
---|
| 1250 | + |
---|
| 1251 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1252 | + hideCB.setToolTipText("Hide object"); |
---|
| 1253 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 1254 | + markCB.setToolTipText("As animation target transform"); |
---|
| 1255 | + |
---|
| 1256 | + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); |
---|
| 1257 | + |
---|
| 1258 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1259 | + |
---|
| 1260 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1261 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1262 | + |
---|
| 1263 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1264 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
| 1265 | + |
---|
| 1266 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1267 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1268 | + |
---|
| 1269 | + if (Globals.ADVANCED) |
---|
| 1270 | + { |
---|
| 1271 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1272 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1273 | + } |
---|
| 1274 | + |
---|
| 1275 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1276 | + oe.ctrlPanel.Return(); |
---|
| 1277 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1278 | + oe.ctrlPanel.Return(); |
---|
| 1279 | + |
---|
| 1280 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
| 1281 | + |
---|
| 1282 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1283 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1284 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1285 | + stepButton.setToolTipText("Step one frame"); |
---|
984 | 1286 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
985 | 1287 | // stepAllButton = AddButton(oe, "Step All"); |
---|
986 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
987 | 1288 | // Return(); |
---|
988 | | - slowerButton = AddButton(oe, "Slow"); |
---|
989 | | - fasterButton = AddButton(oe, "Fast"); |
---|
990 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1289 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1290 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1291 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1292 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1293 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1294 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
991 | 1295 | |
---|
992 | | - Return(); |
---|
| 1296 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
| 1297 | + oe.ctrlPanel.Return(); |
---|
993 | 1298 | |
---|
994 | | - normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
995 | | - Return(); |
---|
| 1299 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1300 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1301 | + //Return(); |
---|
| 1302 | + |
---|
| 1303 | + oe.ctrlPanel.Return(); |
---|
996 | 1304 | |
---|
997 | 1305 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
998 | 1306 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1087 | 1395 | oe.aConstraints.gridwidth = 1; |
---|
1088 | 1396 | /**/ |
---|
1089 | 1397 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1090 | | - Return(); |
---|
| 1398 | + oe.ctrlPanel.Return(); |
---|
1091 | 1399 | |
---|
1092 | 1400 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1093 | 1401 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1191 | 1499 | //worldPanel.setName("World"); |
---|
1192 | 1500 | centralPanel = new cGridBag(); |
---|
1193 | 1501 | centralPanel.preferredWidth = 20; |
---|
1194 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1195 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1502 | + |
---|
| 1503 | + if (Globals.ADVANCED) |
---|
| 1504 | + { |
---|
| 1505 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1506 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1196 | 1507 | |
---|
1197 | 1508 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1198 | 1509 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1201 | 1512 | // cameraPanel.setDividerSize(9); |
---|
1202 | 1513 | cameraPanel.setResizeWeight(1.0); |
---|
1203 | 1514 | |
---|
| 1515 | + } |
---|
| 1516 | + |
---|
1204 | 1517 | centralPanel.add(cameraView); |
---|
| 1518 | + centralPanel.setFocusable(true); |
---|
1205 | 1519 | //frame.setJMenuBar(timelineMenubar); |
---|
1206 | 1520 | //centralPanel.add(timelinePanel); |
---|
1207 | 1521 | |
---|
.. | .. |
---|
1227 | 1541 | XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1228 | 1542 | XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1229 | 1543 | XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1544 | + //XYZPanel.setName("XYZ"); |
---|
1230 | 1545 | |
---|
1231 | 1546 | /* |
---|
1232 | 1547 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1264 | 1579 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1265 | 1580 | //tmp.setName("Edit"); |
---|
1266 | 1581 | objectPanel.add(materialPanel); |
---|
1267 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1268 | | - north.setName("Edit"); |
---|
1269 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1270 | | - objectPanel.add(north); |
---|
1271 | | - objectPanel.add(infoPanel); |
---|
| 1582 | + objectPanel.setIconAt(0, GetIcon("icons/material.png")); |
---|
| 1583 | + objectPanel.setToolTipTextAt(0, "Material"); |
---|
| 1584 | + |
---|
| 1585 | + objectPanel.add(toolboxPanel); |
---|
| 1586 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1587 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
1272 | 1588 | |
---|
| 1589 | + objectPanel.add(skyboxPanel); |
---|
| 1590 | + objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
| 1591 | + objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
| 1592 | + |
---|
| 1593 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1594 | +// north.setName("Edit"); |
---|
| 1595 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1596 | +// objectPanel.add(north); |
---|
| 1597 | + objectPanel.add(editPanel); |
---|
| 1598 | + objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1599 | + objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
| 1600 | + |
---|
| 1601 | + objectPanel.add(XYZPanel); |
---|
| 1602 | + objectPanel.setIconAt(4, GetIcon("icons/XYZ.png")); |
---|
| 1603 | + objectPanel.setToolTipTextAt(4, "XYZ/RGB transform"); |
---|
| 1604 | + |
---|
1273 | 1605 | /* |
---|
1274 | 1606 | aConstraints.gridx = 0; |
---|
1275 | 1607 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1277 | 1609 | aConstraints.gridy += 1; |
---|
1278 | 1610 | aConstraints.gridwidth = 1; |
---|
1279 | 1611 | mainPanel.add(objectPanel, aConstraints); |
---|
1280 | | - */ |
---|
| 1612 | + */ |
---|
1281 | 1613 | |
---|
1282 | 1614 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1283 | 1615 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1289 | 1621 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1290 | 1622 | |
---|
1291 | 1623 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1292 | | - scenePanel.preferredWidth = 7; |
---|
| 1624 | + scenePanel.preferredWidth = 5; |
---|
1293 | 1625 | |
---|
1294 | 1626 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1295 | 1627 | tabbedPane.add(scrollpane); |
---|
1296 | 1628 | |
---|
1297 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1298 | | - |
---|
1299 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1629 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1300 | 1630 | |
---|
1301 | 1631 | optionsPanel.setName("Options"); |
---|
1302 | 1632 | |
---|
1303 | | - AddOptions(optionsPanel, aConstraints); |
---|
| 1633 | + AddOptions(optionsPanel); //, aConstraints); |
---|
1304 | 1634 | |
---|
1305 | 1635 | tabbedPane.add(optionsPanel); |
---|
1306 | 1636 | |
---|
| 1637 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1638 | + |
---|
1307 | 1639 | scenePanel.add(tabbedPane); |
---|
1308 | 1640 | |
---|
| 1641 | + //if (Globals.ADVANCED) |
---|
| 1642 | + tabbedPane.add(infoPanel); |
---|
| 1643 | + tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
| 1644 | + tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1645 | + |
---|
1309 | 1646 | /* |
---|
1310 | 1647 | cTree jTree = new cTree(null); |
---|
1311 | 1648 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1367 | 1704 | bigThree = new cGridBag(); |
---|
1368 | 1705 | bigThree.addComponent(scenePanel); |
---|
1369 | 1706 | bigThree.addComponent(centralPanel); |
---|
1370 | | - bigThree.addComponent(XYZPanel); |
---|
| 1707 | + //bigThree.addComponent(XYZPanel); |
---|
1371 | 1708 | |
---|
1372 | 1709 | // // SIDE EFFECT!!! |
---|
1373 | 1710 | // aConstraints.gridx = 0; |
---|
.. | .. |
---|
1376 | 1713 | // aConstraints.gridheight = 1; |
---|
1377 | 1714 | |
---|
1378 | 1715 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1379 | | - framePanel.setContinuousLayout(true); |
---|
1380 | | - framePanel.setOneTouchExpandable(true); |
---|
1381 | | - framePanel.setDividerLocation(0.8); |
---|
| 1716 | + |
---|
| 1717 | + framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, |
---|
| 1718 | + new java.beans.PropertyChangeListener() |
---|
| 1719 | + { |
---|
| 1720 | + public void propertyChange(java.beans.PropertyChangeEvent pce) |
---|
| 1721 | + { |
---|
| 1722 | + if ((Integer)pce.getOldValue() == 1) |
---|
| 1723 | + { |
---|
| 1724 | + if (radio.layout != expandedLayout) |
---|
| 1725 | + { |
---|
| 1726 | + radio.layout = expandedLayout; |
---|
| 1727 | + radio.layout.doClick(); |
---|
| 1728 | + } |
---|
| 1729 | + } |
---|
| 1730 | + } |
---|
| 1731 | + }); |
---|
| 1732 | + |
---|
| 1733 | + framePanel.setContinuousLayout(false); |
---|
| 1734 | + framePanel.setOneTouchExpandable(false); |
---|
| 1735 | + //.setDividerLocation(0.8); |
---|
1382 | 1736 | //framePanel.setDividerSize(15); |
---|
1383 | 1737 | //framePanel.setResizeWeight(0.15); |
---|
1384 | 1738 | framePanel.setName("Frame"); |
---|
.. | .. |
---|
1395 | 1749 | |
---|
1396 | 1750 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1397 | 1751 | |
---|
1398 | | - frame.setSize(1024, 768); |
---|
1399 | | - frame.show(); |
---|
1400 | | - |
---|
| 1752 | + frame.setSize(1280, 860); |
---|
| 1753 | + |
---|
| 1754 | + cameraView.requestFocusInWindow(); |
---|
| 1755 | + |
---|
1401 | 1756 | gridPanel.setDividerLocation(1.0); |
---|
| 1757 | + |
---|
| 1758 | + frame.validate(); |
---|
| 1759 | + |
---|
| 1760 | + frame.setVisible(true); |
---|
1402 | 1761 | |
---|
1403 | 1762 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1404 | 1763 | frame.addWindowListener(new WindowAdapter() |
---|
1405 | 1764 | { |
---|
1406 | | - |
---|
1407 | 1765 | public void windowClosing(WindowEvent e) |
---|
1408 | 1766 | { |
---|
1409 | 1767 | Close(); |
---|
.. | .. |
---|
1411 | 1769 | }); |
---|
1412 | 1770 | } |
---|
1413 | 1771 | |
---|
1414 | | - void AddOptions(JPanel panel, GridBagConstraints constraints) |
---|
| 1772 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
1415 | 1773 | { |
---|
1416 | 1774 | } |
---|
1417 | 1775 | |
---|
.. | .. |
---|
1426 | 1784 | ctrlPanel.removeAll(); |
---|
1427 | 1785 | } |
---|
1428 | 1786 | |
---|
1429 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1787 | + void SetupMaterial(cGridBag materialpanel) |
---|
1430 | 1788 | { |
---|
1431 | | - aConstraints.weighty = 0; |
---|
1432 | | - //aConstraints.weightx = 1; |
---|
1433 | | - /* |
---|
| 1789 | + cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
| 1790 | + |
---|
| 1791 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 1792 | + skin.setToolTipText("Skin"); |
---|
| 1793 | + skin.addMouseListener(new MouseAdapter() |
---|
| 1794 | + { |
---|
| 1795 | + public void mouseClicked(MouseEvent e) |
---|
| 1796 | + { |
---|
| 1797 | + Object3D object = Grafreed.materials.versionlist[0].get(0); |
---|
| 1798 | + cMaterial material = object.material; |
---|
| 1799 | + |
---|
| 1800 | + // Skin |
---|
| 1801 | + colorField.setFloat(material.color); |
---|
| 1802 | + saturationField.setFloat(material.modulation); |
---|
| 1803 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 1804 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1805 | + diffusenessField.setFloat(material.factor); |
---|
| 1806 | + shininessField.setFloat(material.shininess); |
---|
| 1807 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 1808 | + diffuseField.setFloat(material.diffuse); |
---|
| 1809 | + specularField.setFloat(material.specular); |
---|
| 1810 | + |
---|
| 1811 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 1812 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 1813 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 1814 | + |
---|
| 1815 | + materialtouched = true; |
---|
| 1816 | + applySelf(); |
---|
| 1817 | + } |
---|
| 1818 | + }); |
---|
| 1819 | + presetpanel.add(skin); |
---|
| 1820 | + |
---|
| 1821 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 1822 | + lambert.setToolTipText("Diffuse"); |
---|
| 1823 | + lambert.addMouseListener(new MouseAdapter() |
---|
| 1824 | + { |
---|
| 1825 | + public void mouseClicked(MouseEvent e) |
---|
| 1826 | + { |
---|
| 1827 | + Object3D object = Grafreed.materials.versionlist[2].get(0); |
---|
| 1828 | + cMaterial material = object.material; |
---|
| 1829 | + |
---|
| 1830 | + diffusenessField.setFloat(material.factor); |
---|
| 1831 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1832 | + |
---|
| 1833 | + materialtouched = true; |
---|
| 1834 | + applySelf(); |
---|
| 1835 | + } |
---|
| 1836 | + }); |
---|
| 1837 | + presetpanel.add(lambert); |
---|
| 1838 | + |
---|
| 1839 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 1840 | + diffuse2.setToolTipText("Diffuse2"); |
---|
| 1841 | + diffuse2.addMouseListener(new MouseAdapter() |
---|
| 1842 | + { |
---|
| 1843 | + public void mouseClicked(MouseEvent e) |
---|
| 1844 | + { |
---|
| 1845 | + Object3D object = Grafreed.materials.versionlist[3].get(0); |
---|
| 1846 | + cMaterial material = object.material; |
---|
| 1847 | + |
---|
| 1848 | + diffusenessField.setFloat(material.factor); |
---|
| 1849 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1850 | + |
---|
| 1851 | + materialtouched = true; |
---|
| 1852 | + applySelf(); |
---|
| 1853 | + } |
---|
| 1854 | + }); |
---|
| 1855 | + presetpanel.add(diffuse2); |
---|
| 1856 | + |
---|
| 1857 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 1858 | + diffusemoon.setToolTipText("Moon"); |
---|
| 1859 | + diffusemoon.addMouseListener(new MouseAdapter() |
---|
| 1860 | + { |
---|
| 1861 | + public void mouseClicked(MouseEvent e) |
---|
| 1862 | + { |
---|
| 1863 | + Object3D object = Grafreed.materials.versionlist[4].get(0); |
---|
| 1864 | + cMaterial material = object.material; |
---|
| 1865 | + |
---|
| 1866 | + diffusenessField.setFloat(material.factor); |
---|
| 1867 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1868 | + |
---|
| 1869 | + materialtouched = true; |
---|
| 1870 | + applySelf(); |
---|
| 1871 | + } |
---|
| 1872 | + }); |
---|
| 1873 | + presetpanel.add(diffusemoon); |
---|
| 1874 | + |
---|
| 1875 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 1876 | + diffusemoon2.setToolTipText("Moon2"); |
---|
| 1877 | + diffusemoon2.addMouseListener(new MouseAdapter() |
---|
| 1878 | + { |
---|
| 1879 | + public void mouseClicked(MouseEvent e) |
---|
| 1880 | + { |
---|
| 1881 | + Object3D object = Grafreed.materials.versionlist[5].get(0); |
---|
| 1882 | + cMaterial material = object.material; |
---|
| 1883 | + |
---|
| 1884 | + diffusenessField.setFloat(material.factor); |
---|
| 1885 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1886 | + |
---|
| 1887 | + materialtouched = true; |
---|
| 1888 | + applySelf(); |
---|
| 1889 | + } |
---|
| 1890 | + }); |
---|
| 1891 | + presetpanel.add(diffusemoon2); |
---|
| 1892 | + |
---|
| 1893 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 1894 | + diffusemoon3.setToolTipText("Moon3"); |
---|
| 1895 | + diffusemoon3.addMouseListener(new MouseAdapter() |
---|
| 1896 | + { |
---|
| 1897 | + public void mouseClicked(MouseEvent e) |
---|
| 1898 | + { |
---|
| 1899 | + Object3D object = Grafreed.materials.versionlist[6].get(0); |
---|
| 1900 | + cMaterial material = object.material; |
---|
| 1901 | + |
---|
| 1902 | + diffusenessField.setFloat(material.factor); |
---|
| 1903 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 1904 | + |
---|
| 1905 | + materialtouched = true; |
---|
| 1906 | + applySelf(); |
---|
| 1907 | + } |
---|
| 1908 | + }); |
---|
| 1909 | + presetpanel.add(diffusemoon3); |
---|
| 1910 | + |
---|
| 1911 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 1912 | + diffusesheen.setToolTipText("Sheen"); |
---|
| 1913 | + diffusesheen.addMouseListener(new MouseAdapter() |
---|
| 1914 | + { |
---|
| 1915 | + public void mouseClicked(MouseEvent e) |
---|
| 1916 | + { |
---|
| 1917 | + Object3D object = Grafreed.materials.versionlist[7].get(0); |
---|
| 1918 | + cMaterial material = object.material; |
---|
| 1919 | + |
---|
| 1920 | + sheenField.setFloat(material.sheen); |
---|
| 1921 | + |
---|
| 1922 | + materialtouched = true; |
---|
| 1923 | + applySelf(); |
---|
| 1924 | + } |
---|
| 1925 | + }); |
---|
| 1926 | + presetpanel.add(diffusesheen); |
---|
| 1927 | + |
---|
| 1928 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 1929 | + rough.setToolTipText("Rough metal"); |
---|
| 1930 | + rough.addMouseListener(new MouseAdapter() |
---|
| 1931 | + { |
---|
| 1932 | + public void mouseClicked(MouseEvent e) |
---|
| 1933 | + { |
---|
| 1934 | + Object3D object = Grafreed.materials.versionlist[1].get(0); |
---|
| 1935 | + cMaterial material = object.material; |
---|
| 1936 | + |
---|
| 1937 | + shininessField.setFloat(material.shininess); |
---|
| 1938 | + velvetField.setFloat(material.velvet); |
---|
| 1939 | + |
---|
| 1940 | + materialtouched = true; |
---|
| 1941 | + applySelf(); |
---|
| 1942 | + } |
---|
| 1943 | + }); |
---|
| 1944 | + presetpanel.add(rough); |
---|
| 1945 | + |
---|
| 1946 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 1947 | + rough2.setToolTipText("Medium metal"); |
---|
| 1948 | + rough2.addMouseListener(new MouseAdapter() |
---|
| 1949 | + { |
---|
| 1950 | + public void mouseClicked(MouseEvent e) |
---|
| 1951 | + { |
---|
| 1952 | + Object3D object = Grafreed.materials.versionlist[13].get(0); |
---|
| 1953 | + cMaterial material = object.material; |
---|
| 1954 | + |
---|
| 1955 | + shininessField.setFloat(material.shininess); |
---|
| 1956 | + lightareaField.setFloat(material.lightarea); |
---|
| 1957 | + |
---|
| 1958 | + materialtouched = true; |
---|
| 1959 | + applySelf(); |
---|
| 1960 | + } |
---|
| 1961 | + }); |
---|
| 1962 | + presetpanel.add(rough2); |
---|
| 1963 | + |
---|
| 1964 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 1965 | + shini0.setToolTipText("Shiny"); |
---|
| 1966 | + shini0.addMouseListener(new MouseAdapter() |
---|
| 1967 | + { |
---|
| 1968 | + public void mouseClicked(MouseEvent e) |
---|
| 1969 | + { |
---|
| 1970 | + Object3D object = Grafreed.materials.versionlist[14].get(0); |
---|
| 1971 | + cMaterial material = object.material; |
---|
| 1972 | + |
---|
| 1973 | + shininessField.setFloat(material.shininess); |
---|
| 1974 | + lightareaField.setFloat(material.lightarea); |
---|
| 1975 | + |
---|
| 1976 | + materialtouched = true; |
---|
| 1977 | + applySelf(); |
---|
| 1978 | + } |
---|
| 1979 | + }); |
---|
| 1980 | + presetpanel.add(shini0); |
---|
| 1981 | + |
---|
| 1982 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 1983 | + shini1.setToolTipText("Shiny2"); |
---|
| 1984 | + shini1.addMouseListener(new MouseAdapter() |
---|
| 1985 | + { |
---|
| 1986 | + public void mouseClicked(MouseEvent e) |
---|
| 1987 | + { |
---|
| 1988 | + Object3D object = Grafreed.materials.versionlist[11].get(0); |
---|
| 1989 | + cMaterial material = object.material; |
---|
| 1990 | + |
---|
| 1991 | + shininessField.setFloat(material.shininess); |
---|
| 1992 | + lightareaField.setFloat(material.lightarea); |
---|
| 1993 | + |
---|
| 1994 | + materialtouched = true; |
---|
| 1995 | + applySelf(); |
---|
| 1996 | + } |
---|
| 1997 | + }); |
---|
| 1998 | + presetpanel.add(shini1); |
---|
| 1999 | + |
---|
| 2000 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2001 | + shini2.setToolTipText("Shiny3"); |
---|
| 2002 | + shini2.addMouseListener(new MouseAdapter() |
---|
| 2003 | + { |
---|
| 2004 | + public void mouseClicked(MouseEvent e) |
---|
| 2005 | + { |
---|
| 2006 | + Object3D object = Grafreed.materials.versionlist[12].get(0); |
---|
| 2007 | + cMaterial material = object.material; |
---|
| 2008 | + |
---|
| 2009 | + shininessField.setFloat(material.shininess); |
---|
| 2010 | + lightareaField.setFloat(material.lightarea); |
---|
| 2011 | + |
---|
| 2012 | + materialtouched = true; |
---|
| 2013 | + applySelf(); |
---|
| 2014 | + } |
---|
| 2015 | + }); |
---|
| 2016 | + presetpanel.add(shini2); |
---|
| 2017 | + |
---|
| 2018 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2019 | + aniso.setToolTipText("AnisoU"); |
---|
| 2020 | + aniso.addMouseListener(new MouseAdapter() |
---|
| 2021 | + { |
---|
| 2022 | + public void mouseClicked(MouseEvent e) |
---|
| 2023 | + { |
---|
| 2024 | + Object3D object = Grafreed.materials.versionlist[8].get(0); |
---|
| 2025 | + cMaterial material = object.material; |
---|
| 2026 | + |
---|
| 2027 | + anisoField.setFloat(material.aniso); |
---|
| 2028 | + anisoVField.setFloat(material.anisoV); |
---|
| 2029 | + |
---|
| 2030 | + materialtouched = true; |
---|
| 2031 | + applySelf(); |
---|
| 2032 | + } |
---|
| 2033 | + }); |
---|
| 2034 | + presetpanel.add(aniso); |
---|
| 2035 | + |
---|
| 2036 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2037 | + aniso2.setToolTipText("AnisoV"); |
---|
| 2038 | + aniso2.addMouseListener(new MouseAdapter() |
---|
| 2039 | + { |
---|
| 2040 | + public void mouseClicked(MouseEvent e) |
---|
| 2041 | + { |
---|
| 2042 | + Object3D object = Grafreed.materials.versionlist[9].get(0); |
---|
| 2043 | + cMaterial material = object.material; |
---|
| 2044 | + |
---|
| 2045 | + anisoField.setFloat(material.aniso); |
---|
| 2046 | + anisoVField.setFloat(material.anisoV); |
---|
| 2047 | + |
---|
| 2048 | + materialtouched = true; |
---|
| 2049 | + applySelf(); |
---|
| 2050 | + } |
---|
| 2051 | + }); |
---|
| 2052 | + presetpanel.add(aniso2); |
---|
| 2053 | + |
---|
| 2054 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2055 | + aniso3.setToolTipText("AnisoUV"); |
---|
| 2056 | + aniso3.addMouseListener(new MouseAdapter() |
---|
| 2057 | + { |
---|
| 2058 | + public void mouseClicked(MouseEvent e) |
---|
| 2059 | + { |
---|
| 2060 | + Object3D object = Grafreed.materials.versionlist[10].get(0); |
---|
| 2061 | + cMaterial material = object.material; |
---|
| 2062 | + |
---|
| 2063 | + anisoField.setFloat(material.aniso); |
---|
| 2064 | + anisoVField.setFloat(material.anisoV); |
---|
| 2065 | + |
---|
| 2066 | + materialtouched = true; |
---|
| 2067 | + applySelf(); |
---|
| 2068 | + } |
---|
| 2069 | + }); |
---|
| 2070 | + presetpanel.add(aniso3); |
---|
| 2071 | + |
---|
| 2072 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2073 | + velvet0.setToolTipText("Velvet"); |
---|
| 2074 | + velvet0.addMouseListener(new MouseAdapter() |
---|
| 2075 | + { |
---|
| 2076 | + public void mouseClicked(MouseEvent e) |
---|
| 2077 | + { |
---|
| 2078 | + Object3D object = Grafreed.materials.versionlist[15].get(0); |
---|
| 2079 | + cMaterial material = object.material; |
---|
| 2080 | + |
---|
| 2081 | + diffusenessField.setFloat(material.factor); |
---|
| 2082 | + selfshadowField.setFloat(material.diffuseness); |
---|
| 2083 | + sheenField.setFloat(material.sheen); |
---|
| 2084 | + shininessField.setFloat(material.shininess); |
---|
| 2085 | + velvetField.setFloat(material.velvet); |
---|
| 2086 | + shiftField.setFloat(material.shift); |
---|
| 2087 | + |
---|
| 2088 | + materialtouched = true; |
---|
| 2089 | + applySelf(); |
---|
| 2090 | + } |
---|
| 2091 | + }); |
---|
| 2092 | + presetpanel.add(velvet0); |
---|
| 2093 | + |
---|
| 2094 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2095 | + bump0.setToolTipText("Bump texture"); |
---|
| 2096 | + bump0.addMouseListener(new MouseAdapter() |
---|
| 2097 | + { |
---|
| 2098 | + public void mouseClicked(MouseEvent e) |
---|
| 2099 | + { |
---|
| 2100 | + Object3D object = Grafreed.materials.versionlist[16].get(0); |
---|
| 2101 | + cMaterial material = object.material; |
---|
| 2102 | + |
---|
| 2103 | + bumpField.setFloat(object.projectedVertices[0].x / 1000.0); |
---|
| 2104 | + noiseField.setFloat(object.projectedVertices[0].y / 1000.0); |
---|
| 2105 | + powerField.setFloat(object.projectedVertices[2].x / 1000.0); |
---|
| 2106 | + |
---|
| 2107 | + materialtouched = true; |
---|
| 2108 | + applySelf(); |
---|
| 2109 | + } |
---|
| 2110 | + }); |
---|
| 2111 | + presetpanel.add(bump0); |
---|
| 2112 | + |
---|
| 2113 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2114 | + halo.setToolTipText("Halo"); |
---|
| 2115 | + halo.addMouseListener(new MouseAdapter() |
---|
| 2116 | + { |
---|
| 2117 | + public void mouseClicked(MouseEvent e) |
---|
| 2118 | + { |
---|
| 2119 | + Object3D object = Grafreed.materials.versionlist[17].get(0); |
---|
| 2120 | + cMaterial material = object.material; |
---|
| 2121 | + |
---|
| 2122 | + opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0); |
---|
| 2123 | + |
---|
| 2124 | + materialtouched = true; |
---|
| 2125 | + applySelf(); |
---|
| 2126 | + } |
---|
| 2127 | + }); |
---|
| 2128 | + presetpanel.add(halo); |
---|
| 2129 | + |
---|
| 2130 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2131 | + candle.setToolTipText("Candle"); |
---|
| 2132 | + candle.addMouseListener(new MouseAdapter() |
---|
| 2133 | + { |
---|
| 2134 | + public void mouseClicked(MouseEvent e) |
---|
| 2135 | + { |
---|
| 2136 | + Object3D object = Grafreed.materials.versionlist[18].get(0); |
---|
| 2137 | + cMaterial material = object.material; |
---|
| 2138 | + |
---|
| 2139 | + subsurfaceField.setFloat(material.subsurface); |
---|
| 2140 | + shadowbiasField.setFloat(material.shadowbias); |
---|
| 2141 | + ambientField.setFloat(material.ambient); |
---|
| 2142 | + specularField.setFloat(material.specular); |
---|
| 2143 | + lightareaField.setFloat(material.lightarea); |
---|
| 2144 | + shininessField.setFloat(material.shininess); |
---|
| 2145 | + |
---|
| 2146 | + materialtouched = true; |
---|
| 2147 | + applySelf(); |
---|
| 2148 | + } |
---|
| 2149 | + }); |
---|
| 2150 | + presetpanel.add(candle); |
---|
| 2151 | + |
---|
| 2152 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2153 | + shadowShader.setToolTipText("Shadow"); |
---|
| 2154 | + shadowShader.addMouseListener(new MouseAdapter() |
---|
| 2155 | + { |
---|
| 2156 | + public void mouseClicked(MouseEvent e) |
---|
| 2157 | + { |
---|
| 2158 | + diffuseField.setFloat(0.001); |
---|
| 2159 | + ambientField.setFloat(0.001); |
---|
| 2160 | + cameraField.setFloat(0.001); |
---|
| 2161 | + specularField.setFloat(0.001); |
---|
| 2162 | + fakedepthField.setFloat(0.001); |
---|
| 2163 | + opacityField.setFloat(0.6); |
---|
| 2164 | + |
---|
| 2165 | + materialtouched = true; |
---|
| 2166 | + applySelf(); |
---|
| 2167 | + } |
---|
| 2168 | + }); |
---|
| 2169 | + presetpanel.add(shadowShader); |
---|
| 2170 | + |
---|
| 2171 | + cGridBag panel = new cGridBag().setVertical(true); |
---|
| 2172 | + |
---|
| 2173 | + presetpanel.preferredWidth = 1; |
---|
| 2174 | + |
---|
| 2175 | + materialpanel.add(presetpanel); |
---|
| 2176 | + materialpanel.add(panel); |
---|
| 2177 | + |
---|
| 2178 | + panel.preferredWidth = 8; |
---|
| 2179 | + |
---|
| 2180 | + /* |
---|
1434 | 2181 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1435 | 2182 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1436 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1437 | | - aConstraints.gridx += 1; |
---|
1438 | | - */ |
---|
| 2183 | + */ |
---|
1439 | 2184 | |
---|
1440 | | - aConstraints.gridwidth = 1; |
---|
1441 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1442 | | - aConstraints.gridx += 1; |
---|
1443 | | - aConstraints.weighty = 0; |
---|
1444 | | - aConstraints.gridwidth = 1; |
---|
| 2185 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 2186 | + |
---|
| 2187 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2188 | + createMaterialButton.setToolTipText("Create material"); |
---|
1445 | 2189 | |
---|
1446 | 2190 | /* |
---|
1447 | 2191 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1448 | | - aConstraints.gridx += 1; |
---|
1449 | | - aConstraints.weighty = 0; |
---|
1450 | | - aConstraints.gridwidth = 1; |
---|
1451 | 2192 | */ |
---|
1452 | 2193 | |
---|
1453 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1454 | | - aConstraints.gridx += 1; |
---|
| 2194 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2195 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 2196 | + |
---|
| 2197 | + if (Globals.ADVANCED) |
---|
| 2198 | + { |
---|
| 2199 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2200 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 2201 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 2202 | + } |
---|
1455 | 2203 | |
---|
1456 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1457 | | - |
---|
1458 | | - aConstraints.gridx += 1; |
---|
1459 | | - |
---|
1460 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1461 | | - |
---|
1462 | | - aConstraints.gridx += 1; |
---|
1463 | | - |
---|
1464 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1465 | | - |
---|
1466 | | - aConstraints.gridx = 0; |
---|
1467 | | - aConstraints.gridy += 1; |
---|
1468 | | - aConstraints.weighty = 0; |
---|
1469 | | - aConstraints.gridwidth = 1; |
---|
| 2204 | + editBar.preferredHeight = 15; |
---|
| 2205 | + |
---|
| 2206 | + panel.add(editBar); |
---|
| 2207 | + |
---|
1470 | 2208 | /**/ |
---|
1471 | 2209 | //aConstraints.weighty = 0; |
---|
1472 | 2210 | ////aConstraints.weightx = 1; |
---|
1473 | 2211 | //aConstraints.weighty = 1; |
---|
1474 | 2212 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1475 | 2213 | //aConstraints.gridx += 1; |
---|
1476 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1477 | | - aConstraints.weighty = 0; |
---|
1478 | | - aConstraints.gridx = 0; |
---|
1479 | | - aConstraints.gridy += 1; |
---|
1480 | | - aConstraints.gridwidth = 1; |
---|
| 2214 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1481 | 2215 | |
---|
1482 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1483 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1484 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1485 | | - aConstraints.gridx += 1; |
---|
1486 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1487 | | - //aConstraints.weightx = 0; |
---|
1488 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1489 | | - aConstraints.gridx = 0; |
---|
1490 | | - aConstraints.gridy += 1; |
---|
1491 | | - aConstraints.gridwidth = 1; |
---|
| 2216 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
1492 | 2217 | |
---|
1493 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1494 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1495 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1496 | | - aConstraints.gridx += 1; |
---|
1497 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1498 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1499 | | - aConstraints.gridx = 0; |
---|
1500 | | - aConstraints.gridy += 1; |
---|
1501 | | - aConstraints.gridwidth = 1; |
---|
| 2218 | + cGridBag huepanel = new cGridBag(); |
---|
| 2219 | + cGridBag huelabel = new cGridBag(); |
---|
| 2220 | + skin = GetLabel("icons/hue.png", false); |
---|
| 2221 | + skin.fit = true; |
---|
| 2222 | + huelabel.add(skin); |
---|
| 2223 | + huelabel.preferredWidth = 20; |
---|
| 2224 | + huepanel.add(new cGridBag()); // Label |
---|
| 2225 | + huepanel.add(huelabel); // Field/slider |
---|
| 2226 | + |
---|
| 2227 | + huepanel.preferredHeight = 7; |
---|
1502 | 2228 | |
---|
1503 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1504 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1505 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1506 | | - aConstraints.gridx += 1; |
---|
1507 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1508 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1509 | | - aConstraints.gridx = 0; |
---|
1510 | | - aConstraints.gridy += 1; |
---|
1511 | | - aConstraints.gridwidth = 1; |
---|
| 2229 | + colorSection.add(huepanel); |
---|
| 2230 | + |
---|
| 2231 | + cGridBag color = new cGridBag(); |
---|
| 2232 | + |
---|
| 2233 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 2234 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2235 | + color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
1512 | 2236 | |
---|
1513 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1514 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1515 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1516 | | - aConstraints.gridx += 1; |
---|
1517 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1518 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1519 | | - aConstraints.gridx = 0; |
---|
1520 | | - aConstraints.gridy += 1; |
---|
1521 | | - aConstraints.gridwidth = 1; |
---|
| 2237 | + //colorField.preferredWidth = 200; |
---|
| 2238 | + colorSection.add(color); |
---|
1522 | 2239 | |
---|
1523 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1524 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1525 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1526 | | - aConstraints.gridx += 1; |
---|
1527 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1528 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1529 | | - aConstraints.gridx = 0; |
---|
1530 | | - aConstraints.gridy += 1; |
---|
1531 | | - aConstraints.gridwidth = 1; |
---|
| 2240 | + cGridBag modulation = new cGridBag(); |
---|
| 2241 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 2242 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2243 | + modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2244 | + colorSection.add(modulation); |
---|
1532 | 2245 | |
---|
1533 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1534 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1535 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1536 | | - aConstraints.gridx += 1; |
---|
1537 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1538 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1539 | | - aConstraints.gridx = 0; |
---|
1540 | | - aConstraints.gridy += 1; |
---|
1541 | | - aConstraints.gridwidth = 1; |
---|
| 2246 | + cGridBag opacity = new cGridBag(); |
---|
| 2247 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 2248 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2249 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints); |
---|
| 2250 | + colorSection.add(opacity); |
---|
1542 | 2251 | |
---|
1543 | | - //aConstraints.weighty = 1; |
---|
1544 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1545 | | - //aConstraints.gridx += 1; |
---|
1546 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1547 | | - aConstraints.weighty = 0; |
---|
1548 | | - aConstraints.gridx = 0; |
---|
1549 | | - aConstraints.gridy += 1; |
---|
1550 | | - aConstraints.gridwidth = 1; |
---|
| 2252 | + colorSection.add(GetSeparator()); |
---|
| 2253 | + |
---|
| 2254 | + cGridBag texture = new cGridBag(); |
---|
| 2255 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 2256 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2257 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2258 | + colorSection.add(texture); |
---|
1551 | 2259 | |
---|
1552 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1553 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1554 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1555 | | - aConstraints.gridx += 1; |
---|
1556 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1557 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1558 | | - aConstraints.gridx = 0; |
---|
1559 | | - aConstraints.gridy += 1; |
---|
1560 | | - aConstraints.gridwidth = 1; |
---|
| 2260 | + panel.add(GetSeparator()); |
---|
| 2261 | + |
---|
| 2262 | + panel.add(colorSection); |
---|
| 2263 | + |
---|
| 2264 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2265 | + |
---|
| 2266 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 2267 | + |
---|
| 2268 | + cGridBag diffuse = new cGridBag(); |
---|
| 2269 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 2270 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2271 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2272 | + diffuseSection.add(diffuse); |
---|
1561 | 2273 | |
---|
1562 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1563 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1564 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1565 | | - aConstraints.gridx += 1; |
---|
1566 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1567 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1568 | | - aConstraints.gridx = 0; |
---|
1569 | | - aConstraints.gridy += 1; |
---|
1570 | | - aConstraints.gridwidth = 1; |
---|
| 2274 | + cGridBag diffuseness = new cGridBag(); |
---|
| 2275 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 2276 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2277 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2278 | + diffuseSection.add(diffuseness); |
---|
1571 | 2279 | |
---|
1572 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1573 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1574 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1575 | | - aConstraints.gridx += 1; |
---|
1576 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1577 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1578 | | - aConstraints.gridx = 0; |
---|
1579 | | - aConstraints.gridy += 1; |
---|
1580 | | - aConstraints.gridwidth = 1; |
---|
| 2280 | + cGridBag selfshadow = new cGridBag(); |
---|
| 2281 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 2282 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2283 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2284 | + diffuseSection.add(selfshadow); |
---|
1581 | 2285 | |
---|
1582 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1583 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1584 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1585 | | - aConstraints.gridx += 1; |
---|
1586 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1587 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1588 | | - aConstraints.gridx = 0; |
---|
1589 | | - aConstraints.gridy += 1; |
---|
1590 | | - aConstraints.gridwidth = 1; |
---|
| 2286 | + cGridBag sheen = new cGridBag(); |
---|
| 2287 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 2288 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2289 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2290 | + diffuseSection.add(sheen); |
---|
1591 | 2291 | |
---|
1592 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1593 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1594 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1595 | | - aConstraints.gridx += 1; |
---|
1596 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1597 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1598 | | - aConstraints.gridx = 0; |
---|
1599 | | - aConstraints.gridy += 1; |
---|
1600 | | - aConstraints.gridwidth = 1; |
---|
| 2292 | + cGridBag subsurface = new cGridBag(); |
---|
| 2293 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 2294 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2295 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2296 | + diffuseSection.add(subsurface); |
---|
1601 | 2297 | |
---|
1602 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1603 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1604 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1605 | | - aConstraints.gridx += 1; |
---|
1606 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1607 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1608 | | - aConstraints.gridx = 0; |
---|
1609 | | - aConstraints.gridy += 1; |
---|
1610 | | - aConstraints.gridwidth = 1; |
---|
| 2298 | + cGridBag shadow = new cGridBag(); |
---|
| 2299 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 2300 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2301 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2302 | + diffuseSection.add(shadow); |
---|
1611 | 2303 | |
---|
1612 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1613 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1614 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1615 | | - aConstraints.gridx += 1; |
---|
1616 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1617 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1618 | | - aConstraints.gridx = 0; |
---|
1619 | | - aConstraints.gridy += 1; |
---|
1620 | | - aConstraints.gridwidth = 1; |
---|
| 2304 | + cGridBag fakedepth = new cGridBag(); |
---|
| 2305 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 2306 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2307 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2308 | + diffuseSection.add(fakedepth); |
---|
1621 | 2309 | |
---|
1622 | | - //aConstraints.weighty = 1; |
---|
1623 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1624 | | - //aConstraints.gridx += 1; |
---|
1625 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1626 | | - aConstraints.weighty = 0; |
---|
1627 | | - aConstraints.gridx = 0; |
---|
1628 | | - aConstraints.gridy += 1; |
---|
1629 | | - aConstraints.gridwidth = 1; |
---|
| 2310 | + cGridBag shadowbias = new cGridBag(); |
---|
| 2311 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 2312 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2313 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2314 | + diffuseSection.add(shadowbias); |
---|
1630 | 2315 | |
---|
1631 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1632 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1633 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1634 | | - aConstraints.gridx += 1; |
---|
1635 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1636 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1637 | | - aConstraints.gridx = 0; |
---|
1638 | | - aConstraints.gridy += 1; |
---|
1639 | | - aConstraints.gridwidth = 1; |
---|
| 2316 | + panel.add(GetSeparator()); |
---|
| 2317 | + |
---|
| 2318 | + panel.add(diffuseSection); |
---|
| 2319 | + |
---|
| 2320 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2321 | + |
---|
| 2322 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1640 | 2323 | |
---|
1641 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1642 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1643 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1644 | | - aConstraints.gridx += 1; |
---|
1645 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1646 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1647 | | - aConstraints.gridx = 0; |
---|
1648 | | - aConstraints.gridy += 1; |
---|
1649 | | - aConstraints.gridwidth = 1; |
---|
| 2324 | + cGridBag specular = new cGridBag(); |
---|
| 2325 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 2326 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2327 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2328 | + specularSection.add(specular); |
---|
1650 | 2329 | |
---|
1651 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1652 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1653 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1654 | | - aConstraints.gridx += 1; |
---|
1655 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1656 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1657 | | - aConstraints.gridx = 0; |
---|
1658 | | - aConstraints.gridy += 1; |
---|
1659 | | - aConstraints.gridwidth = 1; |
---|
| 2330 | + cGridBag lightarea = new cGridBag(); |
---|
| 2331 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 2332 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2333 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2334 | + specularSection.add(lightarea); |
---|
1660 | 2335 | |
---|
1661 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1662 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1663 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1664 | | - aConstraints.gridx += 1; |
---|
1665 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1666 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1667 | | - aConstraints.gridx = 0; |
---|
1668 | | - aConstraints.gridy += 1; |
---|
1669 | | - aConstraints.gridwidth = 1; |
---|
| 2336 | + cGridBag shininess = new cGridBag(); |
---|
| 2337 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 2338 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2339 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2340 | + specularSection.add(shininess); |
---|
1670 | 2341 | |
---|
1671 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1672 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1673 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1674 | | - aConstraints.gridx += 1; |
---|
1675 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1676 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1677 | | - aConstraints.gridx = 0; |
---|
1678 | | - aConstraints.gridy += 1; |
---|
1679 | | - aConstraints.gridwidth = 1; |
---|
| 2342 | + cGridBag metalness = new cGridBag(); |
---|
| 2343 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 2344 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2345 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2346 | + specularSection.add(metalness); |
---|
1680 | 2347 | |
---|
1681 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1682 | | - Return(); |
---|
| 2348 | + cGridBag velvet = new cGridBag(); |
---|
| 2349 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 2350 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2351 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2352 | + specularSection.add(velvet); |
---|
| 2353 | + |
---|
| 2354 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 2355 | + //Return(); |
---|
1683 | 2356 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1684 | 2357 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1685 | 2358 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1690 | 2363 | // aConstraints.gridy += 1; |
---|
1691 | 2364 | // aConstraints.gridwidth = 1; |
---|
1692 | 2365 | |
---|
1693 | | - //aConstraints.weighty = 1; |
---|
1694 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1695 | | - //aConstraints.gridx += 1; |
---|
1696 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1697 | | - aConstraints.weighty = 0; |
---|
1698 | | - aConstraints.gridx = 0; |
---|
1699 | | - aConstraints.gridy += 1; |
---|
1700 | | - aConstraints.gridwidth = 1; |
---|
| 2366 | + cGridBag anisoU = new cGridBag(); |
---|
| 2367 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 2368 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2369 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2370 | + specularSection.add(anisoU); |
---|
1701 | 2371 | |
---|
1702 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1703 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1704 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1705 | | - aConstraints.gridx += 1; |
---|
1706 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1707 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1708 | | - aConstraints.gridx = 0; |
---|
1709 | | - aConstraints.gridy += 1; |
---|
1710 | | - aConstraints.gridwidth = 1; |
---|
| 2372 | + cGridBag anisoV = new cGridBag(); |
---|
| 2373 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 2374 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2375 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 2376 | + specularSection.add(anisoV); |
---|
1711 | 2377 | |
---|
1712 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1713 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1714 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1715 | | - aConstraints.gridx += 1; |
---|
1716 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1717 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1718 | | - aConstraints.gridx = 0; |
---|
1719 | | - aConstraints.gridy += 1; |
---|
1720 | | - aConstraints.gridwidth = 1; |
---|
1721 | 2378 | |
---|
1722 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1723 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1724 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1725 | | - aConstraints.gridx += 1; |
---|
1726 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1727 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1728 | | - aConstraints.gridx = 0; |
---|
1729 | | - aConstraints.gridy += 1; |
---|
1730 | | - aConstraints.gridwidth = 1; |
---|
| 2379 | + panel.add(GetSeparator()); |
---|
| 2380 | + |
---|
| 2381 | + panel.add(specularSection); |
---|
| 2382 | + |
---|
| 2383 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2384 | + |
---|
| 2385 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1731 | 2386 | |
---|
1732 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1733 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1734 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1735 | | - aConstraints.gridx += 1; |
---|
1736 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1737 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1738 | | - aConstraints.gridx = 0; |
---|
1739 | | - aConstraints.gridy += 1; |
---|
1740 | | - aConstraints.gridwidth = 1; |
---|
1741 | | - aConstraints.weighty = 0; |
---|
| 2387 | + cGridBag camera = new cGridBag(); |
---|
| 2388 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 2389 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2390 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2391 | + colorSection.add(camera); |
---|
1742 | 2392 | |
---|
1743 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1744 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1745 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1746 | | - aConstraints.gridx += 1; |
---|
1747 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1748 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1749 | | - aConstraints.gridx = 0; |
---|
1750 | | - aConstraints.gridy += 1; |
---|
1751 | | - aConstraints.gridwidth = 1; |
---|
| 2393 | + cGridBag ambient = new cGridBag(); |
---|
| 2394 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 2395 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2396 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2397 | + colorSection.add(ambient); |
---|
1752 | 2398 | |
---|
1753 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1754 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1755 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1756 | | - aConstraints.gridx += 1; |
---|
1757 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1758 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1759 | | - aConstraints.gridx = 0; |
---|
1760 | | - aConstraints.gridy += 1; |
---|
1761 | | - aConstraints.gridwidth = 1; |
---|
| 2399 | + cGridBag backlit = new cGridBag(); |
---|
| 2400 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 2401 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2402 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 2403 | + colorSection.add(backlit); |
---|
1762 | 2404 | |
---|
1763 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1764 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1765 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1766 | | - aConstraints.gridx += 1; |
---|
1767 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1768 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1769 | | - aConstraints.gridx = 0; |
---|
1770 | | - aConstraints.gridy += 1; |
---|
1771 | | - aConstraints.gridwidth = 1; |
---|
| 2405 | + //panel.add(new JSeparator()); |
---|
| 2406 | + |
---|
| 2407 | + //panel.add(globalSection); |
---|
| 2408 | + |
---|
| 2409 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 2410 | + |
---|
| 2411 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1772 | 2412 | |
---|
1773 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1774 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1775 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1776 | | - aConstraints.gridx += 1; |
---|
1777 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1778 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1779 | | - aConstraints.gridx = 0; |
---|
1780 | | - aConstraints.gridy += 1; |
---|
1781 | | - aConstraints.gridwidth = 1; |
---|
| 2413 | + cGridBag bump = new cGridBag(); |
---|
| 2414 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 2415 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2416 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2417 | + textureSection.add(bump); |
---|
1782 | 2418 | |
---|
1783 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1784 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1785 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1786 | | - aConstraints.gridx += 1; |
---|
1787 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1788 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1789 | | - aConstraints.gridx = 0; |
---|
1790 | | - aConstraints.gridy += 1; |
---|
1791 | | - aConstraints.gridwidth = 1; |
---|
| 2419 | + cGridBag noise = new cGridBag(); |
---|
| 2420 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 2421 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2422 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 2423 | + textureSection.add(noise); |
---|
1792 | 2424 | |
---|
1793 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1794 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1795 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1796 | | - aConstraints.gridx += 1; |
---|
1797 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1798 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1799 | | - aConstraints.gridx = 0; |
---|
1800 | | - aConstraints.gridy += 1; |
---|
1801 | | - aConstraints.gridwidth = 1; |
---|
| 2425 | + cGridBag power = new cGridBag(); |
---|
| 2426 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 2427 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2428 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 2429 | + textureSection.add(power); |
---|
1802 | 2430 | |
---|
1803 | | - //aConstraints.weighty = 1; |
---|
1804 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1805 | | - //aConstraints.gridx += 1; |
---|
1806 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1807 | | - aConstraints.weighty = 0; |
---|
| 2431 | + cGridBag borderfade = new cGridBag(); |
---|
| 2432 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 2433 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2434 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 2435 | + textureSection.add(borderfade); |
---|
1808 | 2436 | |
---|
1809 | | - aConstraints.gridx = 0; |
---|
1810 | | - aConstraints.gridy = 0; |
---|
1811 | | - aConstraints.gridwidth = 1; |
---|
| 2437 | + cGridBag fog = new cGridBag(); |
---|
| 2438 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 2439 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2440 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 2441 | + textureSection.add(fog); |
---|
| 2442 | + |
---|
| 2443 | + cGridBag opacityPower = new cGridBag(); |
---|
| 2444 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 2445 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2446 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 2447 | + textureSection.add(opacityPower); |
---|
| 2448 | + |
---|
| 2449 | + panel.add(GetSeparator()); |
---|
| 2450 | + |
---|
| 2451 | + panel.add(textureSection); |
---|
| 2452 | + |
---|
| 2453 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1812 | 2454 | |
---|
1813 | 2455 | SetMaterial(copy); // .GetMaterial()); |
---|
1814 | 2456 | |
---|
1815 | | - colorField.addChangeListener(this); |
---|
1816 | | - modulationField.addChangeListener(this); |
---|
| 2457 | + //colorField.addChangeListener(this); |
---|
| 2458 | +// modulationField.addChangeListener(this); |
---|
1817 | 2459 | metalnessField.addChangeListener(this); |
---|
1818 | 2460 | diffuseField.addChangeListener(this); |
---|
1819 | 2461 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1843 | 2485 | opacityPowerField.addChangeListener(this); |
---|
1844 | 2486 | /**/ |
---|
1845 | 2487 | |
---|
1846 | | - resetSlidersButton.addActionListener(this); |
---|
1847 | 2488 | clearMaterialButton.addActionListener(this); |
---|
1848 | 2489 | createMaterialButton.addActionListener(this); |
---|
1849 | | - |
---|
1850 | | - propagateToggle.addItemListener(this); |
---|
1851 | | - multiplyToggle.addItemListener(this); |
---|
| 2490 | + |
---|
| 2491 | + if (Globals.ADVANCED) |
---|
| 2492 | + { |
---|
| 2493 | + resetSlidersButton.addActionListener(this); |
---|
| 2494 | + propagateToggle.addItemListener(this); |
---|
| 2495 | + multiplyToggle.addItemListener(this); |
---|
| 2496 | + } |
---|
1852 | 2497 | } |
---|
1853 | 2498 | |
---|
1854 | 2499 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1866 | 2511 | // 3D models |
---|
1867 | 2512 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1868 | 2513 | { |
---|
1869 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1870 | | - LoadFile(filename, lastConverter); |
---|
| 2514 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2515 | + //LoadFile(filename, lastConverter); |
---|
| 2516 | + LoadObjFile(filename); // New 3ds loader |
---|
1871 | 2517 | continue; |
---|
1872 | 2518 | } |
---|
1873 | 2519 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
2019 | 2665 | |
---|
2020 | 2666 | //? flashIt = false; |
---|
2021 | 2667 | CameraPane pane = (CameraPane) cameraView; |
---|
2022 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2668 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
2023 | 2669 | pane.clickEnd(location.x, location.y, 0, true); |
---|
2024 | 2670 | |
---|
2025 | 2671 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2068 | 2714 | e2.printStackTrace(); |
---|
2069 | 2715 | } |
---|
2070 | 2716 | } |
---|
| 2717 | + |
---|
2071 | 2718 | LoadJMEThread loadThread; |
---|
2072 | 2719 | |
---|
2073 | 2720 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2125 | 2772 | //LoadFile0(filename, converter); |
---|
2126 | 2773 | } |
---|
2127 | 2774 | } |
---|
| 2775 | + |
---|
2128 | 2776 | LoadOBJThread loadObjThread; |
---|
2129 | 2777 | |
---|
2130 | 2778 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2203 | 2851 | |
---|
2204 | 2852 | void LoadObjFile(String fullname) |
---|
2205 | 2853 | { |
---|
2206 | | - /* |
---|
| 2854 | + System.out.println("Loading " + fullname); |
---|
| 2855 | + /**/ |
---|
2207 | 2856 | //lastFilename = fullname; |
---|
2208 | 2857 | if(loadObjThread == null) |
---|
2209 | 2858 | { |
---|
2210 | | - loadObjThread = new LoadOBJThread(); |
---|
2211 | | - loadObjThread.start(); |
---|
| 2859 | + loadObjThread = new LoadOBJThread(); |
---|
| 2860 | + loadObjThread.start(); |
---|
2212 | 2861 | } |
---|
2213 | 2862 | |
---|
2214 | 2863 | loadObjThread.add(fullname); |
---|
2215 | | - */ |
---|
| 2864 | + /**/ |
---|
2216 | 2865 | |
---|
2217 | | - System.out.println("Loading " + fullname); |
---|
2218 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2866 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2219 | 2867 | } |
---|
2220 | 2868 | |
---|
2221 | 2869 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2476 | 3124 | |
---|
2477 | 3125 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2478 | 3126 | { |
---|
2479 | | - if (GrafreeD.standAlone) |
---|
| 3127 | + if (Grafreed.standAlone) |
---|
2480 | 3128 | { |
---|
2481 | 3129 | /**/ |
---|
2482 | 3130 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2483 | | - browser.show(); |
---|
| 3131 | + browser.setVisible(true); |
---|
2484 | 3132 | String filename = browser.getFile(); |
---|
2485 | 3133 | if (filename != null && filename.length() > 0) |
---|
2486 | 3134 | { |
---|
.. | .. |
---|
2591 | 3239 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2592 | 3240 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2593 | 3241 | } |
---|
| 3242 | + |
---|
2594 | 3243 | //cJME.count++; |
---|
2595 | 3244 | //cJME.count %= 12; |
---|
2596 | 3245 | if (gc) |
---|
.. | .. |
---|
2625 | 3274 | } |
---|
2626 | 3275 | if (input == null) |
---|
2627 | 3276 | { |
---|
| 3277 | + new Exception().printStackTrace(); |
---|
2628 | 3278 | System.exit(0); |
---|
2629 | 3279 | } |
---|
2630 | 3280 | |
---|
.. | .. |
---|
2773 | 3423 | } |
---|
2774 | 3424 | } |
---|
2775 | 3425 | } |
---|
| 3426 | + |
---|
2776 | 3427 | cFileSystemPane FSPane; |
---|
2777 | 3428 | |
---|
2778 | 3429 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2782 | 3433 | |
---|
2783 | 3434 | freezematerial = true; |
---|
2784 | 3435 | colorField.setFloat(mat.color); |
---|
2785 | | - modulationField.setFloat(mat.modulation); |
---|
| 3436 | + saturationField.setFloat(mat.modulation); |
---|
2786 | 3437 | metalnessField.setFloat(mat.metalness); |
---|
2787 | 3438 | diffuseField.setFloat(mat.diffuse); |
---|
2788 | 3439 | specularField.setFloat(mat.specular); |
---|
.. | .. |
---|
2826 | 3477 | } |
---|
2827 | 3478 | } |
---|
2828 | 3479 | } |
---|
| 3480 | + |
---|
2829 | 3481 | freezematerial = false; |
---|
2830 | 3482 | } |
---|
2831 | 3483 | |
---|
2832 | 3484 | void SetMaterial(Object3D object) |
---|
2833 | 3485 | { |
---|
| 3486 | + latestObject = object; |
---|
| 3487 | + |
---|
2834 | 3488 | cMaterial mat = object.material; |
---|
2835 | 3489 | |
---|
2836 | 3490 | if (mat == null) |
---|
.. | .. |
---|
2839 | 3493 | return; |
---|
2840 | 3494 | } |
---|
2841 | 3495 | |
---|
2842 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 3496 | + if (multiplyToggle != null) |
---|
| 3497 | + multiplyToggle.setSelected(mat.multiply); |
---|
2843 | 3498 | |
---|
2844 | 3499 | assert (object.projectedVertices != null); |
---|
2845 | 3500 | |
---|
.. | .. |
---|
2941 | 3596 | // } |
---|
2942 | 3597 | |
---|
2943 | 3598 | /**/ |
---|
2944 | | - if (deselect) |
---|
| 3599 | + if (deselect || child == null) |
---|
2945 | 3600 | { |
---|
2946 | 3601 | //group.deselectAll(); |
---|
2947 | 3602 | //freeze = true; |
---|
2948 | 3603 | GetTree().clearSelection(); |
---|
2949 | 3604 | //freeze = false; |
---|
| 3605 | + |
---|
| 3606 | + if (child == null) |
---|
| 3607 | + { |
---|
| 3608 | + return; |
---|
| 3609 | + } |
---|
2950 | 3610 | } |
---|
2951 | 3611 | |
---|
2952 | 3612 | //group.addSelectee(child); |
---|
.. | .. |
---|
2980 | 3640 | public void itemStateChanged(ItemEvent event) |
---|
2981 | 3641 | { |
---|
2982 | 3642 | // System.out.println("Propagate = " + propagate); |
---|
| 3643 | + if (event.getSource() == pinButton) |
---|
| 3644 | + { |
---|
| 3645 | + copy.pinned ^= true; |
---|
| 3646 | + if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy)) |
---|
| 3647 | + { |
---|
| 3648 | + ((GroupEditor)copy.editWindow).listUI.remove(copy); |
---|
| 3649 | + copy.CloseUI(); |
---|
| 3650 | + //copy.editWindow.refreshContents(); |
---|
| 3651 | + } |
---|
| 3652 | + } |
---|
| 3653 | + else |
---|
2983 | 3654 | if (event.getSource() == propagateToggle) |
---|
2984 | 3655 | { |
---|
2985 | 3656 | propagate ^= true; |
---|
.. | .. |
---|
3015 | 3686 | cameraView.ToggleDL(); |
---|
3016 | 3687 | cameraView.repaint(); |
---|
3017 | 3688 | return; |
---|
3018 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3689 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
3019 | 3690 | { |
---|
3020 | 3691 | cameraView.ToggleTexture(); |
---|
3021 | 3692 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
3054 | 3725 | frame.validate(); |
---|
3055 | 3726 | |
---|
3056 | 3727 | return; |
---|
3057 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3728 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
3058 | 3729 | { |
---|
3059 | | - cameraView.ToggleRandom(); |
---|
| 3730 | + cameraView.ToggleSwitch(); |
---|
3060 | 3731 | cameraView.repaint(); |
---|
3061 | 3732 | return; |
---|
3062 | 3733 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3084 | 3755 | } else if (event.getSource() == liveCB) |
---|
3085 | 3756 | { |
---|
3086 | 3757 | copy.live ^= true; |
---|
| 3758 | + objEditor.refreshContents(true); // To show item colors |
---|
| 3759 | + return; |
---|
| 3760 | + } else if (event.getSource() == selectableCB) |
---|
| 3761 | + { |
---|
| 3762 | + copy.dontselect ^= true; |
---|
3087 | 3763 | return; |
---|
3088 | 3764 | } else if (event.getSource() == hideCB) |
---|
3089 | 3765 | { |
---|
3090 | 3766 | copy.hide ^= true; |
---|
3091 | 3767 | copy.Touch(); // display list issue |
---|
3092 | | - objEditor.refreshContents(); |
---|
| 3768 | + objEditor.refreshContents(true); // To show item colors |
---|
3093 | 3769 | return; |
---|
3094 | 3770 | } else if (event.getSource() == link2masterCB) |
---|
3095 | 3771 | { |
---|
.. | .. |
---|
3099 | 3775 | if (event.getSource() == randomCB) |
---|
3100 | 3776 | { |
---|
3101 | 3777 | copy.random ^= true; |
---|
| 3778 | + objEditor.refreshContents(); |
---|
3102 | 3779 | return; |
---|
3103 | 3780 | } |
---|
3104 | 3781 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3122 | 3799 | |
---|
3123 | 3800 | public void actionPerformed(ActionEvent event) |
---|
3124 | 3801 | { |
---|
| 3802 | + Object source = event.getSource(); |
---|
3125 | 3803 | // SCRIPT DIALOG |
---|
3126 | | - if (event.getSource() == okbutton) |
---|
| 3804 | + if (source == okbutton) |
---|
3127 | 3805 | { |
---|
3128 | 3806 | textpanel.setVisible(false); |
---|
3129 | 3807 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3135 | 3813 | textarea = null; |
---|
3136 | 3814 | textpanel = null; |
---|
3137 | 3815 | } |
---|
3138 | | - if (event.getSource() == cancelbutton) |
---|
| 3816 | + if (source == cancelbutton) |
---|
3139 | 3817 | { |
---|
3140 | 3818 | textpanel.setVisible(false); |
---|
3141 | 3819 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3147 | 3825 | //applySelf(); |
---|
3148 | 3826 | //client.refreshEditWindow(); |
---|
3149 | 3827 | //refreshContents(); |
---|
3150 | | - if (event.getSource() == nameField) |
---|
| 3828 | + if (source == nameField) |
---|
3151 | 3829 | { |
---|
3152 | 3830 | //System.out.println("ObjEditor " + event); |
---|
3153 | 3831 | applySelf0(true); |
---|
3154 | 3832 | //parent.applySelf(); |
---|
3155 | 3833 | objEditor.refreshContents(); |
---|
3156 | | - } else if (event.getSource() == resetButton) |
---|
| 3834 | + } else if (source == resetButton) |
---|
3157 | 3835 | { |
---|
3158 | 3836 | CameraPane.fullreset = true; |
---|
3159 | 3837 | copy.Reset(); // ResetMeshes(); |
---|
3160 | 3838 | copy.Touch(); |
---|
3161 | 3839 | objEditor.refreshContents(); |
---|
3162 | | - } else if (event.getSource() == stepItem) |
---|
| 3840 | + } else if (source == stepItem) |
---|
3163 | 3841 | { |
---|
3164 | 3842 | //cameraView.ONESTEP = true; |
---|
3165 | 3843 | Globals.ONESTEP = true; |
---|
3166 | 3844 | cameraView.repaint(); |
---|
3167 | 3845 | return; |
---|
3168 | | - } else if (event.getSource() == stepButton) |
---|
| 3846 | + } else if (source == stepButton) |
---|
3169 | 3847 | { |
---|
3170 | 3848 | copy.Step(); |
---|
3171 | 3849 | copy.Touch(); |
---|
3172 | 3850 | objEditor.refreshContents(); |
---|
3173 | | - } else if (event.getSource() == slowerButton) |
---|
| 3851 | + } else if (source == slowerButton) |
---|
3174 | 3852 | { |
---|
3175 | 3853 | copy.Slower(); |
---|
3176 | 3854 | copy.Touch(); |
---|
3177 | 3855 | objEditor.refreshContents(); |
---|
3178 | | - } else if (event.getSource() == fasterButton) |
---|
| 3856 | + } else if (source == fasterButton) |
---|
3179 | 3857 | { |
---|
3180 | 3858 | copy.Faster(); |
---|
3181 | 3859 | copy.Touch(); |
---|
3182 | 3860 | objEditor.refreshContents(); |
---|
3183 | | - } else if (event.getSource() == remarkButton) |
---|
| 3861 | + } else if (source == remarkButton) |
---|
3184 | 3862 | { |
---|
3185 | 3863 | copy.Remark(); |
---|
3186 | 3864 | copy.Touch(); |
---|
3187 | 3865 | objEditor.refreshContents(); |
---|
3188 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3866 | + } else if (source == stepAllButton) |
---|
3189 | 3867 | { |
---|
3190 | 3868 | copy.StepAll(); |
---|
3191 | 3869 | copy.Touch(); |
---|
3192 | 3870 | objEditor.refreshContents(); |
---|
3193 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3871 | + } else if (source == resetAllButton) |
---|
3194 | 3872 | { |
---|
3195 | 3873 | //CameraPane.fullreset = true; |
---|
3196 | 3874 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3223 | 3901 | // Close(); |
---|
3224 | 3902 | // } |
---|
3225 | 3903 | // else |
---|
3226 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3904 | + if (source == resetSlidersButton) |
---|
3227 | 3905 | { |
---|
3228 | 3906 | ResetSliders(); |
---|
3229 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3907 | + } else if (source == clearMaterialButton) |
---|
3230 | 3908 | { |
---|
3231 | 3909 | ClearMaterial(); |
---|
3232 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3910 | + } else if (source == createMaterialButton) |
---|
3233 | 3911 | { |
---|
3234 | 3912 | CreateMaterial(); |
---|
3235 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3913 | + } else if (source == clearPanelButton) |
---|
3236 | 3914 | { |
---|
3237 | 3915 | copy.ClearUI(); |
---|
3238 | 3916 | refreshContents(true); |
---|
3239 | | - } /* |
---|
3240 | | - } |
---|
3241 | | - |
---|
3242 | | - public boolean action(Event event, Object arg) |
---|
3243 | | - { |
---|
3244 | | - */ else if (event.getSource() == closeItem) |
---|
| 3917 | + } else if (source == importGFDItem) |
---|
| 3918 | + { |
---|
| 3919 | + ImportGFD(); |
---|
| 3920 | + } else |
---|
| 3921 | + if (source == importVRMLX3DItem) |
---|
| 3922 | + { |
---|
| 3923 | + ImportVRMLX3D(); |
---|
| 3924 | + } else |
---|
| 3925 | + if (source == import3DSItem) |
---|
| 3926 | + { |
---|
| 3927 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3928 | + } else |
---|
| 3929 | + if (source == importOBJItem) |
---|
| 3930 | + { |
---|
| 3931 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3932 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3933 | + browser.setVisible(true); |
---|
| 3934 | + String filename = browser.getFile(); |
---|
| 3935 | + if (filename != null && filename.length() > 0) |
---|
| 3936 | + { |
---|
| 3937 | + String fullname = browser.getDirectory() + filename; |
---|
| 3938 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3939 | + } |
---|
| 3940 | + } else |
---|
| 3941 | + if (source == closeItem) |
---|
3245 | 3942 | { |
---|
3246 | 3943 | Close(); |
---|
3247 | 3944 | //return true; |
---|
3248 | | - } else if (event.getSource() == loadItem) |
---|
| 3945 | + } else if (source == openItem) |
---|
3249 | 3946 | { |
---|
3250 | | - load(); |
---|
| 3947 | + Open(); |
---|
3251 | 3948 | //return true; |
---|
3252 | | - } else if (event.getSource() == saveItem) |
---|
| 3949 | + } else if (source == newItem) |
---|
| 3950 | + { |
---|
| 3951 | + New(); |
---|
| 3952 | + } else if (source == saveItem) |
---|
3253 | 3953 | { |
---|
3254 | 3954 | save(); |
---|
3255 | 3955 | //return true; |
---|
3256 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3956 | + } else if (source == saveAsItem) |
---|
3257 | 3957 | { |
---|
3258 | 3958 | saveAs(); |
---|
3259 | 3959 | //return true; |
---|
3260 | | - } else if (event.getSource() == reexportItem) |
---|
| 3960 | + } else if (source == reexportItem) |
---|
3261 | 3961 | { |
---|
3262 | 3962 | reexport(); |
---|
3263 | 3963 | //return true; |
---|
3264 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3964 | + } else if (source == exportAsItem) |
---|
3265 | 3965 | { |
---|
3266 | 3966 | export(); |
---|
3267 | 3967 | //return true; |
---|
3268 | | - } else if (event.getSource() == povItem) |
---|
| 3968 | + } else if (source == povItem) |
---|
3269 | 3969 | { |
---|
3270 | 3970 | generatePOV(); |
---|
3271 | 3971 | //return true; |
---|
3272 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3972 | + } else if (event.getSource() == archiveItem) |
---|
| 3973 | + { |
---|
| 3974 | + cTools.Archive(frame); |
---|
| 3975 | + return; |
---|
| 3976 | + } else if (source == zBufferItem) |
---|
3273 | 3977 | { |
---|
3274 | 3978 | try |
---|
3275 | 3979 | { |
---|
.. | .. |
---|
3291 | 3995 | cameraView.repaint(); |
---|
3292 | 3996 | //return true; |
---|
3293 | 3997 | } |
---|
3294 | | - */ else if (event.getSource() == editCameraItem) |
---|
3295 | | - { |
---|
3296 | | - cameraView.ProtectCamera(); |
---|
3297 | | - cameraView.repaint(); |
---|
3298 | | - return; |
---|
3299 | | - } else if (event.getSource() == revertCameraItem) |
---|
3300 | | - { |
---|
3301 | | - cameraView.RevertCamera(); |
---|
3302 | | - cameraView.repaint(); |
---|
3303 | | - return; |
---|
3304 | | -// } else if (event.getSource() == textureButton) |
---|
3305 | | -// { |
---|
3306 | | -// return; // true; |
---|
3307 | | - } else // combos... |
---|
3308 | | - if (event.getSource() == texresMenu) |
---|
| 3998 | + */ else // combos... |
---|
| 3999 | + if (source == texresMenu) |
---|
3309 | 4000 | { |
---|
3310 | 4001 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3311 | 4002 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3317 | 4008 | } |
---|
3318 | 4009 | } |
---|
3319 | 4010 | |
---|
| 4011 | + void New() |
---|
| 4012 | + { |
---|
| 4013 | + while (copy.Size() > 1) |
---|
| 4014 | + { |
---|
| 4015 | + copy.remove(1); |
---|
| 4016 | + } |
---|
| 4017 | + |
---|
| 4018 | + ResetModel(); |
---|
| 4019 | + objEditor.refreshContents(); |
---|
| 4020 | + } |
---|
| 4021 | + |
---|
| 4022 | + static public byte[] Compress(Object3D o) |
---|
| 4023 | + { |
---|
| 4024 | + // Slower to actually compress. |
---|
| 4025 | + try |
---|
| 4026 | + { |
---|
| 4027 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4028 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 4029 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
| 4030 | + |
---|
| 4031 | + Object3D parent = o.parent; |
---|
| 4032 | + o.parent = null; |
---|
| 4033 | + |
---|
| 4034 | + out.writeObject(o); |
---|
| 4035 | + |
---|
| 4036 | + o.parent = parent; |
---|
| 4037 | + |
---|
| 4038 | + out.flush(); |
---|
| 4039 | + |
---|
| 4040 | + baos //zstream |
---|
| 4041 | + .close(); |
---|
| 4042 | + out.close(); |
---|
| 4043 | + |
---|
| 4044 | + byte[] bytes = baos.toByteArray(); |
---|
| 4045 | + |
---|
| 4046 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 4047 | + return bytes; |
---|
| 4048 | + } catch (Exception e) |
---|
| 4049 | + { |
---|
| 4050 | + System.err.println(e); |
---|
| 4051 | + return null; |
---|
| 4052 | + } |
---|
| 4053 | + } |
---|
| 4054 | + |
---|
| 4055 | + static public Object Uncompress(byte[] bytes) |
---|
| 4056 | + { |
---|
| 4057 | + System.out.println("restore #bytes = " + bytes.length); |
---|
| 4058 | + try |
---|
| 4059 | + { |
---|
| 4060 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4061 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 4062 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
| 4063 | + Object obj = in.readObject(); |
---|
| 4064 | + |
---|
| 4065 | + bais //istream |
---|
| 4066 | + .close(); |
---|
| 4067 | + in.close(); |
---|
| 4068 | + |
---|
| 4069 | + return obj; |
---|
| 4070 | + } catch (Exception e) |
---|
| 4071 | + { |
---|
| 4072 | + System.err.println(e); |
---|
| 4073 | + return null; |
---|
| 4074 | + } |
---|
| 4075 | + } |
---|
| 4076 | + |
---|
| 4077 | + static public Object clone(Object o) |
---|
| 4078 | + { |
---|
| 4079 | + try |
---|
| 4080 | + { |
---|
| 4081 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 4082 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 4083 | + |
---|
| 4084 | + out.writeObject(o); |
---|
| 4085 | + |
---|
| 4086 | + out.flush(); |
---|
| 4087 | + out.close(); |
---|
| 4088 | + |
---|
| 4089 | + byte[] bytes = baos.toByteArray(); |
---|
| 4090 | + |
---|
| 4091 | + System.out.println("clone = " + bytes.length); |
---|
| 4092 | + |
---|
| 4093 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 4094 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 4095 | + Object obj = in.readObject(); |
---|
| 4096 | + in.close(); |
---|
| 4097 | + |
---|
| 4098 | + return obj; |
---|
| 4099 | + } catch (Exception e) |
---|
| 4100 | + { |
---|
| 4101 | + System.err.println(e); |
---|
| 4102 | + return null; |
---|
| 4103 | + } |
---|
| 4104 | + } |
---|
| 4105 | + |
---|
| 4106 | + cRadio GetCurrentTab() |
---|
| 4107 | + { |
---|
| 4108 | + cRadio ab; |
---|
| 4109 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4110 | + { |
---|
| 4111 | + ab = (cRadio)e.nextElement(); |
---|
| 4112 | + if(ab.GetObject() == copy) |
---|
| 4113 | + { |
---|
| 4114 | + return ab; |
---|
| 4115 | + } |
---|
| 4116 | + } |
---|
| 4117 | + |
---|
| 4118 | + return null; |
---|
| 4119 | + } |
---|
| 4120 | + |
---|
| 4121 | + |
---|
| 4122 | + public void Save() |
---|
| 4123 | + { |
---|
| 4124 | + //Save(true); |
---|
| 4125 | + Replace(); |
---|
| 4126 | + SetUndoStates(); |
---|
| 4127 | + } |
---|
| 4128 | + |
---|
| 4129 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 4130 | + { |
---|
| 4131 | + if (compress.length != name.length) |
---|
| 4132 | + { |
---|
| 4133 | + return false; |
---|
| 4134 | + } |
---|
| 4135 | + |
---|
| 4136 | + for (int i=compress.length; --i>=0;) |
---|
| 4137 | + { |
---|
| 4138 | + if (compress[i] != name[i]) |
---|
| 4139 | + return false; |
---|
| 4140 | + } |
---|
| 4141 | + |
---|
| 4142 | + return true; |
---|
| 4143 | + } |
---|
| 4144 | + |
---|
| 4145 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 4146 | + |
---|
| 4147 | + void DeleteVersion() |
---|
| 4148 | + { |
---|
| 4149 | + for (int i = copy.versionindex; i < copy.versionlist.length-1; i++) |
---|
| 4150 | + { |
---|
| 4151 | + copy.versionlist[i] = copy.versionlist[i+1]; |
---|
| 4152 | + } |
---|
| 4153 | + |
---|
| 4154 | + CopyChanged(); |
---|
| 4155 | + |
---|
| 4156 | + SetUndoStates(); |
---|
| 4157 | + } |
---|
| 4158 | + |
---|
| 4159 | + public boolean Save(boolean user) |
---|
| 4160 | + { |
---|
| 4161 | + System.err.println("Save"); |
---|
| 4162 | + Replace(); |
---|
| 4163 | + |
---|
| 4164 | + cRadio tab = GetCurrentTab(); |
---|
| 4165 | + |
---|
| 4166 | + Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
| 4167 | + |
---|
| 4168 | + boolean thesame = false; |
---|
| 4169 | + |
---|
| 4170 | +// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 4171 | +// { |
---|
| 4172 | +// thesame = true; |
---|
| 4173 | +// } |
---|
| 4174 | + |
---|
| 4175 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 4176 | + if (!thesame) |
---|
| 4177 | + { |
---|
| 4178 | + for (int i = copy.versionlist.length; --i > copy.versionindex+1;) |
---|
| 4179 | + { |
---|
| 4180 | + copy.versionlist[i] = copy.versionlist[i-1]; |
---|
| 4181 | + } |
---|
| 4182 | + |
---|
| 4183 | + //tab.user[tab.versionindex] = user; |
---|
| 4184 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 4185 | + |
---|
| 4186 | + copy.versionlist[++copy.versionindex] = compress; |
---|
| 4187 | + |
---|
| 4188 | + // if (increment) |
---|
| 4189 | + // tab.versionindex++; |
---|
| 4190 | + } |
---|
| 4191 | + |
---|
| 4192 | + //copy.RestoreBigData(versiontable); |
---|
| 4193 | + |
---|
| 4194 | + //assert(hashtable.isEmpty()); |
---|
| 4195 | + |
---|
| 4196 | +// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++) |
---|
| 4197 | +// { |
---|
| 4198 | +// //tab.user[i] = false; |
---|
| 4199 | +// copy.versionlist[i] = null; |
---|
| 4200 | +// } |
---|
| 4201 | + |
---|
| 4202 | + SetUndoStates(); |
---|
| 4203 | + |
---|
| 4204 | + // test save |
---|
| 4205 | + if (false) |
---|
| 4206 | + { |
---|
| 4207 | + try |
---|
| 4208 | + { |
---|
| 4209 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
| 4210 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4211 | + |
---|
| 4212 | + p.writeObject(copy); |
---|
| 4213 | + |
---|
| 4214 | + p.flush(); |
---|
| 4215 | + |
---|
| 4216 | + ostream.close(); |
---|
| 4217 | + } catch (Exception e) |
---|
| 4218 | + { |
---|
| 4219 | + e.printStackTrace(); |
---|
| 4220 | + } |
---|
| 4221 | + } |
---|
| 4222 | + |
---|
| 4223 | + return !thesame; |
---|
| 4224 | + } |
---|
| 4225 | + |
---|
| 4226 | + boolean flashIt = true; |
---|
| 4227 | + |
---|
| 4228 | + void RefreshSelection() |
---|
| 4229 | + { |
---|
| 4230 | + Object3D selection = new Object3D(); |
---|
| 4231 | + |
---|
| 4232 | + for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4233 | + { |
---|
| 4234 | + Object3D elem = copy.selection.elementAt(i); |
---|
| 4235 | + |
---|
| 4236 | + Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4237 | + |
---|
| 4238 | + if (obj == null) |
---|
| 4239 | + { |
---|
| 4240 | + copy.selection.remove(i--); |
---|
| 4241 | + } |
---|
| 4242 | + else |
---|
| 4243 | + { |
---|
| 4244 | + selection.add(obj); |
---|
| 4245 | + copy.selection.setElementAt(obj, i); |
---|
| 4246 | + } |
---|
| 4247 | + } |
---|
| 4248 | + |
---|
| 4249 | + flashIt = false; |
---|
| 4250 | + GetTree().clearSelection(); |
---|
| 4251 | + for (int i = 0; i < selection.size(); i++) |
---|
| 4252 | + GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath()); |
---|
| 4253 | + flashIt = true; |
---|
| 4254 | + |
---|
| 4255 | + //refreshContents(false); |
---|
| 4256 | + } |
---|
| 4257 | + |
---|
| 4258 | + void CopyChanged() |
---|
| 4259 | + { |
---|
| 4260 | + Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
| 4261 | + |
---|
| 4262 | + SetUndoStates(); |
---|
| 4263 | + |
---|
| 4264 | + boolean temp = CameraPane.SWITCH; |
---|
| 4265 | + CameraPane.SWITCH = false; |
---|
| 4266 | + |
---|
| 4267 | + copy.ExtractBigData(versiontable); |
---|
| 4268 | + |
---|
| 4269 | + copy.clear(); |
---|
| 4270 | + |
---|
| 4271 | + copy.skyboxname = obj.skyboxname; |
---|
| 4272 | + copy.skyboxext = obj.skyboxext; |
---|
| 4273 | + |
---|
| 4274 | + for (int i=0; i<obj.Size(); i++) |
---|
| 4275 | + { |
---|
| 4276 | + copy.add(obj.get(i)); |
---|
| 4277 | + } |
---|
| 4278 | + |
---|
| 4279 | + copy.RestoreBigData(versiontable); |
---|
| 4280 | + |
---|
| 4281 | + CameraPane.SWITCH = temp; |
---|
| 4282 | + |
---|
| 4283 | + RefreshSelection(); |
---|
| 4284 | + //assert(hashtable.isEmpty()); |
---|
| 4285 | + |
---|
| 4286 | + copy.Touch(); |
---|
| 4287 | + |
---|
| 4288 | + ResetModel(); |
---|
| 4289 | + copy.HardTouch(); // recompile? |
---|
| 4290 | + |
---|
| 4291 | + cRadio ab; |
---|
| 4292 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4293 | + { |
---|
| 4294 | + ab = (cRadio)e.nextElement(); |
---|
| 4295 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 4296 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 4297 | + if (test != null) |
---|
| 4298 | + { |
---|
| 4299 | + test.editWindow = ab.object.editWindow; |
---|
| 4300 | + ab.object = test; |
---|
| 4301 | + } |
---|
| 4302 | + } |
---|
| 4303 | + |
---|
| 4304 | + refreshContents(true); |
---|
| 4305 | + } |
---|
| 4306 | + |
---|
| 4307 | + cButton previousVersionButton; |
---|
| 4308 | + cButton restoreButton; |
---|
| 4309 | + cButton replaceButton; |
---|
| 4310 | + cButton nextVersionButton; |
---|
| 4311 | + cButton saveVersionButton; |
---|
| 4312 | + cButton deleteVersionButton; |
---|
| 4313 | + |
---|
| 4314 | + boolean muteSlider; |
---|
| 4315 | + |
---|
| 4316 | + int VersionCount() |
---|
| 4317 | + { |
---|
| 4318 | + int count = 0; |
---|
| 4319 | + |
---|
| 4320 | + for (int i = copy.versionlist.length; --i >= 0;) |
---|
| 4321 | + { |
---|
| 4322 | + if (copy.versionlist[i] != null) |
---|
| 4323 | + count++; |
---|
| 4324 | + } |
---|
| 4325 | + |
---|
| 4326 | + return count; |
---|
| 4327 | + } |
---|
| 4328 | + |
---|
| 4329 | + void SetUndoStates() |
---|
| 4330 | + { |
---|
| 4331 | + cRadio tab = GetCurrentTab(); |
---|
| 4332 | + |
---|
| 4333 | + restoreButton.setEnabled(true); // copy.versionindex != -1); |
---|
| 4334 | + replaceButton.setEnabled(true); // copy.versionindex != -1); |
---|
| 4335 | + |
---|
| 4336 | + previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
| 4337 | + nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4338 | + |
---|
| 4339 | + deleteVersionButton.setEnabled(//copy.versionindex > 0 && |
---|
| 4340 | + copy.versionlist[copy.versionindex + 1] != null); |
---|
| 4341 | + |
---|
| 4342 | + muteSlider = true; |
---|
| 4343 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 4344 | + versionSlider.setInteger(copy.versionindex); |
---|
| 4345 | + muteSlider = false; |
---|
| 4346 | + } |
---|
| 4347 | + |
---|
| 4348 | + public boolean PreviousVersion() |
---|
| 4349 | + { |
---|
| 4350 | + // Option? |
---|
| 4351 | + Replace(); |
---|
| 4352 | + |
---|
| 4353 | + System.err.println("Undo"); |
---|
| 4354 | + |
---|
| 4355 | + cRadio tab = GetCurrentTab(); |
---|
| 4356 | + |
---|
| 4357 | + if (copy.versionindex == 0) |
---|
| 4358 | + { |
---|
| 4359 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4360 | + return false; |
---|
| 4361 | + } |
---|
| 4362 | + |
---|
| 4363 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 4364 | +// { |
---|
| 4365 | +// if (Save(false)) |
---|
| 4366 | +// tab.versionindex -= 1; |
---|
| 4367 | +// else |
---|
| 4368 | +// { |
---|
| 4369 | +// if (tab.versionindex <= 0) |
---|
| 4370 | +// return false; |
---|
| 4371 | +// else |
---|
| 4372 | +// tab.versionindex -= 1; |
---|
| 4373 | +// } |
---|
| 4374 | +// } |
---|
| 4375 | + |
---|
| 4376 | + copy.versionindex -= 1; |
---|
| 4377 | + |
---|
| 4378 | + CopyChanged(); |
---|
| 4379 | + |
---|
| 4380 | + return true; |
---|
| 4381 | + } |
---|
| 4382 | + |
---|
| 4383 | + public boolean Restore() |
---|
| 4384 | + { |
---|
| 4385 | + System.err.println("Restore"); |
---|
| 4386 | + |
---|
| 4387 | + cRadio tab = GetCurrentTab(); |
---|
| 4388 | + |
---|
| 4389 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4390 | + { |
---|
| 4391 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4392 | + return false; |
---|
| 4393 | + } |
---|
| 4394 | + |
---|
| 4395 | + //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 4396 | + CopyChanged(); |
---|
| 4397 | + |
---|
| 4398 | + return true; |
---|
| 4399 | + } |
---|
| 4400 | + |
---|
| 4401 | + public boolean Replace() |
---|
| 4402 | + { |
---|
| 4403 | + System.err.println("Replace"); |
---|
| 4404 | + |
---|
| 4405 | + cRadio tab = GetCurrentTab(); |
---|
| 4406 | + |
---|
| 4407 | + if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
| 4408 | + { |
---|
| 4409 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4410 | + return false; |
---|
| 4411 | + } |
---|
| 4412 | + |
---|
| 4413 | + copy.versionlist[copy.versionindex] = Duplicate(copy); |
---|
| 4414 | + |
---|
| 4415 | + return true; |
---|
| 4416 | + } |
---|
| 4417 | + |
---|
| 4418 | + public void NextVersion() |
---|
| 4419 | + { |
---|
| 4420 | + // Option? |
---|
| 4421 | + Replace(); |
---|
| 4422 | + |
---|
| 4423 | + cRadio tab = GetCurrentTab(); |
---|
| 4424 | + |
---|
| 4425 | + if (copy.versionlist[copy.versionindex + 1] == null) |
---|
| 4426 | + { |
---|
| 4427 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 4428 | + return; |
---|
| 4429 | + } |
---|
| 4430 | + |
---|
| 4431 | + copy.versionindex += 1; |
---|
| 4432 | + |
---|
| 4433 | + CopyChanged(); |
---|
| 4434 | + |
---|
| 4435 | + //if (!tab.user[tab.versionindex]) |
---|
| 4436 | + // tab.graphs[tab.versionindex] = null; |
---|
| 4437 | + } |
---|
| 4438 | + |
---|
| 4439 | + void ImportGFD() |
---|
| 4440 | + { |
---|
| 4441 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
| 4442 | + browser.show(); |
---|
| 4443 | + String filename = browser.getFile(); |
---|
| 4444 | + if (filename != null && filename.length() > 0) |
---|
| 4445 | + { |
---|
| 4446 | + String fullname = browser.getDirectory() + filename; |
---|
| 4447 | + |
---|
| 4448 | + //Object3D readobj = |
---|
| 4449 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 4450 | + //makeSomething(readobj); |
---|
| 4451 | + } |
---|
| 4452 | + } |
---|
| 4453 | + |
---|
| 4454 | + void ImportVRMLX3D() |
---|
| 4455 | + { |
---|
| 4456 | + if (Grafreed.standAlone) |
---|
| 4457 | + { |
---|
| 4458 | + /**/ |
---|
| 4459 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 4460 | + browser.show(); |
---|
| 4461 | + String filename = browser.getFile(); |
---|
| 4462 | + if (filename != null && filename.length() > 0) |
---|
| 4463 | + { |
---|
| 4464 | + String fullname = browser.getDirectory() + filename; |
---|
| 4465 | + LoadVRMLX3D(fullname); |
---|
| 4466 | + } |
---|
| 4467 | + /**/ |
---|
| 4468 | + } |
---|
| 4469 | + } |
---|
| 4470 | + |
---|
3320 | 4471 | void ToggleAnimation() |
---|
3321 | 4472 | { |
---|
3322 | 4473 | if (!Globals.ANIMATION) |
---|
3323 | 4474 | { |
---|
3324 | 4475 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3325 | | - browser.show(); |
---|
| 4476 | + browser.setVisible(true); |
---|
3326 | 4477 | String filename = browser.getFile(); |
---|
3327 | 4478 | if (filename != null && filename.length() > 0) |
---|
3328 | 4479 | { |
---|
.. | .. |
---|
3332 | 4483 | |
---|
3333 | 4484 | Globals.ANIMATION ^= true; |
---|
3334 | 4485 | |
---|
3335 | | - GrafreeD.wav.cursor = 0; |
---|
3336 | | - GrafreeD.wav.loop = 0; |
---|
| 4486 | + Grafreed.wav.cursor = 0; |
---|
| 4487 | + Grafreed.wav.loop = 0; |
---|
3337 | 4488 | } |
---|
3338 | 4489 | } else |
---|
3339 | 4490 | { |
---|
.. | .. |
---|
3383 | 4534 | void CreateMaterial() |
---|
3384 | 4535 | { |
---|
3385 | 4536 | //copy.ClearMaterial(); // PATCH |
---|
3386 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 4537 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3387 | 4538 | if (copy.selection.size() > 0) |
---|
3388 | 4539 | //SetMaterial(copy); |
---|
3389 | 4540 | { |
---|
.. | .. |
---|
3434 | 4585 | assert false; |
---|
3435 | 4586 | } |
---|
3436 | 4587 | |
---|
3437 | | - void EditSelection() |
---|
| 4588 | + void EditSelection(boolean newWindow) |
---|
3438 | 4589 | { |
---|
3439 | 4590 | } |
---|
3440 | 4591 | |
---|
.. | .. |
---|
3442 | 4593 | { |
---|
3443 | 4594 | copy.ResetBlockLoop(); // temporary problem |
---|
3444 | 4595 | |
---|
3445 | | - boolean random = CameraPane.RANDOM; |
---|
3446 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 4596 | + boolean random = CameraPane.SWITCH; |
---|
| 4597 | + CameraPane.SWITCH = false; // parse everything |
---|
3447 | 4598 | copy.ResetDisplayList(); |
---|
3448 | 4599 | copy.HardTouch(); |
---|
3449 | | - CameraPane.RANDOM = random; |
---|
| 4600 | + CameraPane.SWITCH = random; |
---|
3450 | 4601 | } |
---|
3451 | 4602 | |
---|
3452 | 4603 | // public void applySelf() |
---|
.. | .. |
---|
3493 | 4644 | //copy.material = new cMaterial(copy.GetMaterial()); |
---|
3494 | 4645 | |
---|
3495 | 4646 | current.color = (float) colorField.getFloat(); |
---|
3496 | | - current.modulation = (float) modulationField.getFloat(); |
---|
| 4647 | + current.modulation = (float) saturationField.getFloat(); |
---|
3497 | 4648 | current.metalness = (float) metalnessField.getFloat(); |
---|
3498 | 4649 | current.diffuse = (float) diffuseField.getFloat(); |
---|
3499 | 4650 | current.specular = (float) specularField.getFloat(); |
---|
.. | .. |
---|
3516 | 4667 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3517 | 4668 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3518 | 4669 | |
---|
3519 | | - if (!NumberSlider.frozen) |
---|
| 4670 | + if (!cNumberSlider.frozen) |
---|
3520 | 4671 | { |
---|
3521 | 4672 | //System.out.println("Propagate = " + propagate); |
---|
3522 | 4673 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 4674 | + |
---|
| 4675 | + if (copy.material != null) |
---|
| 4676 | + { |
---|
| 4677 | + cMaterial mat = copy.material; |
---|
| 4678 | + |
---|
| 4679 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4680 | + saturationField.SetToolTipValue((mat.modulation)); |
---|
| 4681 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4682 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4683 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4684 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4685 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4686 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4687 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4688 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4689 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4690 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4691 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4692 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4693 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4694 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4695 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4696 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4697 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4698 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4699 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4700 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4701 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4702 | + } |
---|
| 4703 | + |
---|
3523 | 4704 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3524 | 4705 | { |
---|
3525 | 4706 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3548 | 4729 | //copy.Touch(); |
---|
3549 | 4730 | } |
---|
3550 | 4731 | |
---|
| 4732 | + cNumberSlider versionSlider; |
---|
| 4733 | + |
---|
3551 | 4734 | public void stateChanged(ChangeEvent e) |
---|
3552 | 4735 | { |
---|
3553 | 4736 | // assert(false); |
---|
| 4737 | + if (e.getSource() == versionSlider) |
---|
| 4738 | + { |
---|
| 4739 | + if (muteSlider) |
---|
| 4740 | + return; |
---|
| 4741 | + |
---|
| 4742 | + int version = versionSlider.getInteger(); |
---|
| 4743 | + |
---|
| 4744 | + if (copy.versionlist[version] != null) |
---|
| 4745 | + { |
---|
| 4746 | + copy.versionindex = version; |
---|
| 4747 | + CopyChanged(); |
---|
| 4748 | + } |
---|
| 4749 | + |
---|
| 4750 | + return; |
---|
| 4751 | + } |
---|
3554 | 4752 | |
---|
3555 | 4753 | if (freezematerial) |
---|
3556 | 4754 | { |
---|
.. | .. |
---|
3564 | 4762 | || e.getSource() == apertureField |
---|
3565 | 4763 | || e.getSource() == shadowblurField) |
---|
3566 | 4764 | { |
---|
| 4765 | + new Exception().printStackTrace(); |
---|
3567 | 4766 | System.exit(0); |
---|
3568 | 4767 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3569 | 4768 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3585 | 4784 | { |
---|
3586 | 4785 | //System.out.println("stateChanged = " + this); |
---|
3587 | 4786 | materialtouched = true; |
---|
| 4787 | + |
---|
| 4788 | + if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001) |
---|
| 4789 | + { |
---|
| 4790 | + saturationField.setFloat(1); |
---|
| 4791 | + } |
---|
| 4792 | + |
---|
3588 | 4793 | applySelf(); |
---|
3589 | 4794 | //System.out.println("this = " + this); |
---|
3590 | 4795 | //System.out.println("PARENT = " + parent); |
---|
.. | .. |
---|
3634 | 4839 | } |
---|
3635 | 4840 | |
---|
3636 | 4841 | if (normalpushField != null) |
---|
3637 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 4842 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3638 | 4843 | } |
---|
3639 | 4844 | |
---|
3640 | 4845 | void SnapObject() |
---|
.. | .. |
---|
3884 | 5089 | { |
---|
3885 | 5090 | if (GetTree() != null) |
---|
3886 | 5091 | { |
---|
| 5092 | + GetTree().revalidate(); |
---|
3887 | 5093 | GetTree().repaint(); |
---|
3888 | 5094 | } |
---|
3889 | 5095 | |
---|
3890 | 5096 | radioPanel.revalidate(); |
---|
3891 | 5097 | radioPanel.repaint(); |
---|
3892 | | - ctrlPanel.revalidate(); // ? new |
---|
| 5098 | + ctrlPanel.validate(); // ? new |
---|
3893 | 5099 | ctrlPanel.repaint(); |
---|
3894 | 5100 | } |
---|
| 5101 | + |
---|
| 5102 | + if (previousVersionButton != null && copy.versionlist != null) |
---|
| 5103 | + SetUndoStates(); |
---|
3895 | 5104 | } |
---|
3896 | 5105 | |
---|
3897 | 5106 | static TweenManager tweenManager = new TweenManager(); |
---|
3898 | 5107 | |
---|
3899 | 5108 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3900 | 5109 | { |
---|
| 5110 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
| 5111 | + Save(); |
---|
3901 | 5112 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3902 | 5113 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3903 | 5114 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3984 | 5195 | { |
---|
3985 | 5196 | ResetModel(); |
---|
3986 | 5197 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 5198 | + |
---|
| 5199 | + if (thing.Size() == 0) |
---|
| 5200 | + { |
---|
| 5201 | + //EditSelection(false); |
---|
| 5202 | + } |
---|
| 5203 | + |
---|
3987 | 5204 | refreshContents(); |
---|
3988 | 5205 | } |
---|
3989 | 5206 | |
---|
.. | .. |
---|
4101 | 5318 | } |
---|
4102 | 5319 | } |
---|
4103 | 5320 | } |
---|
| 5321 | + |
---|
4104 | 5322 | LoadGFDThread loadGFDThread; |
---|
4105 | 5323 | |
---|
4106 | 5324 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4120 | 5338 | |
---|
4121 | 5339 | try |
---|
4122 | 5340 | { |
---|
| 5341 | + // Try compressed version first. |
---|
4123 | 5342 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4124 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5343 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 5344 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4125 | 5345 | |
---|
4126 | 5346 | readobj = (Object3D) p.readObject(); |
---|
4127 | 5347 | istream.close(); |
---|
.. | .. |
---|
4129 | 5349 | readobj.ResetDisplayList(); |
---|
4130 | 5350 | } catch (Exception e) |
---|
4131 | 5351 | { |
---|
4132 | | - e.printStackTrace(); |
---|
| 5352 | + if (!e.toString().contains("GZIP")) |
---|
| 5353 | + e.printStackTrace(); |
---|
| 5354 | + |
---|
| 5355 | + try |
---|
| 5356 | + { |
---|
| 5357 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 5358 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 5359 | + |
---|
| 5360 | + readobj = (Object3D) p.readObject(); |
---|
| 5361 | + istream.close(); |
---|
| 5362 | + |
---|
| 5363 | + readobj.ResetDisplayList(); |
---|
| 5364 | + } catch (Exception e2) |
---|
| 5365 | + { |
---|
| 5366 | + e2.printStackTrace(); |
---|
| 5367 | + } |
---|
4133 | 5368 | } |
---|
4134 | 5369 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4135 | 5370 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4175 | 5410 | |
---|
4176 | 5411 | void LoadIt(Object obj) |
---|
4177 | 5412 | { |
---|
| 5413 | + if (obj == null) |
---|
| 5414 | + { |
---|
| 5415 | + // Invalid file |
---|
| 5416 | + return; |
---|
| 5417 | + } |
---|
| 5418 | + |
---|
4178 | 5419 | System.out.println("Loaded " + obj); |
---|
4179 | 5420 | //new Exception().printStackTrace(); |
---|
4180 | 5421 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4184 | 5425 | |
---|
4185 | 5426 | if (readobj != null) |
---|
4186 | 5427 | { |
---|
| 5428 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 5429 | + // Save(); |
---|
4187 | 5430 | try |
---|
4188 | 5431 | { |
---|
4189 | 5432 | //readobj.deepCopySelf(copy); |
---|
4190 | 5433 | copy.clear(); // june 2014 |
---|
| 5434 | + copy.skyboxname = readobj.skyboxname; |
---|
| 5435 | + copy.skyboxext = readobj.skyboxext; |
---|
4191 | 5436 | for (int i = 0; i < readobj.size(); i++) |
---|
4192 | 5437 | { |
---|
4193 | 5438 | Object3D child = readobj.get(i); // reserve(i); |
---|
.. | .. |
---|
4228 | 5473 | } |
---|
4229 | 5474 | } catch (ClassCastException e) |
---|
4230 | 5475 | { |
---|
| 5476 | + e.printStackTrace(); |
---|
4231 | 5477 | assert (false); |
---|
4232 | 5478 | Composite c = (Composite) copy; |
---|
4233 | 5479 | c.children.clear(); |
---|
.. | .. |
---|
4238 | 5484 | c.addChild(csg); |
---|
4239 | 5485 | } |
---|
4240 | 5486 | |
---|
| 5487 | + copy.versionlist = readobj.versionlist; |
---|
| 5488 | + copy.versionindex = readobj.versionindex; |
---|
| 5489 | + |
---|
| 5490 | + if (copy.versionlist == null) |
---|
| 5491 | + { |
---|
| 5492 | + copy.versionlist = new Object3D[100]; |
---|
| 5493 | + copy.versionindex = -1; |
---|
| 5494 | + } |
---|
| 5495 | + |
---|
| 5496 | + //? SetUndoStates(); |
---|
| 5497 | + |
---|
4241 | 5498 | ResetModel(); |
---|
4242 | 5499 | copy.HardTouch(); // recompile? |
---|
4243 | 5500 | refreshContents(); |
---|
4244 | 5501 | } |
---|
4245 | 5502 | } |
---|
4246 | 5503 | |
---|
4247 | | - void load() // throws ClassNotFoundException |
---|
| 5504 | + void Open() // throws ClassNotFoundException |
---|
4248 | 5505 | { |
---|
4249 | | - if (GrafreeD.standAlone) |
---|
| 5506 | + if (Grafreed.standAlone) |
---|
4250 | 5507 | { |
---|
4251 | | - FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
| 5508 | + FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD); |
---|
4252 | 5509 | browser.show(); |
---|
4253 | 5510 | String filename = browser.getFile(); |
---|
4254 | 5511 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4333 | 5590 | try |
---|
4334 | 5591 | { |
---|
4335 | 5592 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4336 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 5593 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5594 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4337 | 5595 | |
---|
4338 | 5596 | p.writeObject(copy); |
---|
4339 | 5597 | p.flush(); |
---|
4340 | 5598 | |
---|
| 5599 | + zstream.close(); |
---|
4341 | 5600 | ostream.close(); |
---|
4342 | 5601 | |
---|
4343 | 5602 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4345 | 5604 | //ps.print(buffer.toString()); |
---|
4346 | 5605 | } catch (IOException e) |
---|
4347 | 5606 | { |
---|
| 5607 | + e.printStackTrace(); |
---|
4348 | 5608 | } |
---|
4349 | 5609 | } |
---|
| 5610 | + |
---|
4350 | 5611 | String lastname; |
---|
4351 | 5612 | |
---|
4352 | 5613 | void saveAs() |
---|
4353 | 5614 | { |
---|
4354 | | - if (GrafreeD.standAlone) |
---|
| 5615 | + if (Grafreed.standAlone) |
---|
4355 | 5616 | { |
---|
4356 | 5617 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4357 | 5618 | browser.setVisible(true); |
---|
4358 | 5619 | String filename = browser.getFile(); |
---|
4359 | 5620 | if (filename != null && filename.length() > 0) |
---|
4360 | 5621 | { |
---|
| 5622 | + if (!filename.endsWith(".gfd")) |
---|
| 5623 | + filename += ".gfd"; |
---|
4361 | 5624 | lastname = browser.getDirectory() + filename; |
---|
4362 | 5625 | save(); |
---|
4363 | 5626 | } |
---|
.. | .. |
---|
4456 | 5719 | try |
---|
4457 | 5720 | { |
---|
4458 | 5721 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4459 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4460 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 5722 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5723 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4461 | 5724 | |
---|
4462 | 5725 | Object3D objectparent = obj.parent; |
---|
4463 | 5726 | obj.parent = null; |
---|
4464 | 5727 | |
---|
4465 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 5728 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4466 | 5729 | |
---|
4467 | 5730 | obj.parent = objectparent; |
---|
4468 | 5731 | |
---|
.. | .. |
---|
4474 | 5737 | p.writeObject(object); |
---|
4475 | 5738 | p.flush(); |
---|
4476 | 5739 | |
---|
| 5740 | + zstream.close(); |
---|
4477 | 5741 | ostream.close(); |
---|
4478 | | - // zstream.close(); |
---|
4479 | 5742 | |
---|
4480 | 5743 | // group.selection.get(0).parent = parent; |
---|
4481 | 5744 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4496 | 5759 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4497 | 5760 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4498 | 5761 | copy.generatePOV(buffer); |
---|
4499 | | - if (GrafreeD.standAlone) |
---|
| 5762 | + if (Grafreed.standAlone) |
---|
4500 | 5763 | { |
---|
4501 | 5764 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4502 | 5765 | browser.show(); |
---|
.. | .. |
---|
4522 | 5785 | Object3D client; |
---|
4523 | 5786 | Object3D copy; |
---|
4524 | 5787 | MenuBar menuBar; |
---|
4525 | | - Menu windowMenu; |
---|
4526 | | - MenuItem loadItem; |
---|
| 5788 | + Menu fileMenu; |
---|
| 5789 | + MenuItem newItem; |
---|
| 5790 | + MenuItem openItem; |
---|
4527 | 5791 | MenuItem saveItem; |
---|
4528 | 5792 | MenuItem saveAsItem; |
---|
4529 | 5793 | MenuItem exportAsItem; |
---|
4530 | 5794 | MenuItem reexportItem; |
---|
4531 | 5795 | MenuItem povItem; |
---|
4532 | 5796 | MenuItem closeItem; |
---|
4533 | | - Menu cameraMenu; |
---|
| 5797 | + |
---|
4534 | 5798 | CheckboxMenuItem zBufferItem; |
---|
4535 | 5799 | //MenuItem normalLensItem; |
---|
4536 | | - MenuItem editCameraItem; |
---|
4537 | | - MenuItem revertCameraItem; |
---|
4538 | | - CheckboxMenuItem toggleLiveItem; |
---|
4539 | 5800 | MenuItem stepItem; |
---|
| 5801 | + CheckboxMenuItem toggleLiveItem; |
---|
4540 | 5802 | CheckboxMenuItem toggleFullScreenItem; |
---|
4541 | 5803 | CheckboxMenuItem toggleTimelineItem; |
---|
4542 | 5804 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4545 | 5807 | CheckboxMenuItem toggleFootContactItem; |
---|
4546 | 5808 | CheckboxMenuItem toggleDLItem; |
---|
4547 | 5809 | CheckboxMenuItem toggleTextureItem; |
---|
4548 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 5810 | + CheckboxMenuItem toggleSwitchItem; |
---|
4549 | 5811 | CheckboxMenuItem toggleRootItem; |
---|
4550 | 5812 | CheckboxMenuItem animationItem; |
---|
| 5813 | + MenuItem archiveItem; |
---|
4551 | 5814 | CheckboxMenuItem toggleHandleItem; |
---|
4552 | 5815 | CheckboxMenuItem togglePaintItem; |
---|
4553 | 5816 | JSplitPane mainPanel; |
---|
4554 | 5817 | JScrollPane scrollpane; |
---|
| 5818 | + |
---|
4555 | 5819 | JPanel toolbarPanel; |
---|
4556 | | - JPanel treePanel; |
---|
| 5820 | + |
---|
| 5821 | + cGridBag treePanel; |
---|
| 5822 | + |
---|
4557 | 5823 | JPanel radioPanel; |
---|
4558 | 5824 | ButtonGroup buttonGroup; |
---|
4559 | | - JPanel ctrlPanel; |
---|
4560 | | - JPanel materialPanel; |
---|
| 5825 | + |
---|
| 5826 | + cGridBag toolboxPanel; |
---|
| 5827 | + cGridBag skyboxPanel; |
---|
| 5828 | + cGridBag materialPanel; |
---|
| 5829 | + cGridBag ctrlPanel; |
---|
| 5830 | + |
---|
4561 | 5831 | JScrollPane infoPanel; |
---|
4562 | | - JPanel optionsPanel; |
---|
| 5832 | + |
---|
| 5833 | + cGridBag optionsPanel; |
---|
| 5834 | + |
---|
4563 | 5835 | JTabbedPane objectPanel; |
---|
| 5836 | + boolean materialFlushed; |
---|
| 5837 | + Object3D latestObject; |
---|
| 5838 | + |
---|
4564 | 5839 | cGridBag XYZPanel; |
---|
| 5840 | + |
---|
4565 | 5841 | JSplitPane gridPanel; |
---|
4566 | 5842 | JSplitPane bigPanel; |
---|
| 5843 | + |
---|
4567 | 5844 | cGridBag bigThree; |
---|
4568 | 5845 | cGridBag scenePanel; |
---|
4569 | 5846 | cGridBag centralPanel; |
---|
.. | .. |
---|
4619 | 5896 | // MATERIAL |
---|
4620 | 5897 | JLabel materialLabel; |
---|
4621 | 5898 | JLabel colorLabel; |
---|
4622 | | - NumberSlider colorField; |
---|
| 5899 | + cNumberSlider colorField; |
---|
4623 | 5900 | JLabel modulationLabel; |
---|
4624 | | - NumberSlider modulationField; |
---|
| 5901 | + cNumberSlider saturationField; |
---|
4625 | 5902 | JLabel metalnessLabel; |
---|
4626 | | - NumberSlider metalnessField; |
---|
| 5903 | + cNumberSlider metalnessField; |
---|
4627 | 5904 | JLabel diffuseLabel; |
---|
4628 | | - NumberSlider diffuseField; |
---|
| 5905 | + cNumberSlider diffuseField; |
---|
4629 | 5906 | JLabel specularLabel; |
---|
4630 | | - NumberSlider specularField; |
---|
| 5907 | + cNumberSlider specularField; |
---|
4631 | 5908 | JLabel shininessLabel; |
---|
4632 | | - NumberSlider shininessField; |
---|
| 5909 | + cNumberSlider shininessField; |
---|
4633 | 5910 | JLabel shiftLabel; |
---|
4634 | | - NumberSlider shiftField; |
---|
| 5911 | + cNumberSlider shiftField; |
---|
4635 | 5912 | JLabel ambientLabel; |
---|
4636 | | - NumberSlider ambientField; |
---|
| 5913 | + cNumberSlider ambientField; |
---|
4637 | 5914 | JLabel lightareaLabel; |
---|
4638 | | - NumberSlider lightareaField; |
---|
| 5915 | + cNumberSlider lightareaField; |
---|
4639 | 5916 | JLabel diffusenessLabel; |
---|
4640 | | - NumberSlider diffusenessField; |
---|
| 5917 | + cNumberSlider diffusenessField; |
---|
4641 | 5918 | JLabel velvetLabel; |
---|
4642 | | - NumberSlider velvetField; |
---|
| 5919 | + cNumberSlider velvetField; |
---|
4643 | 5920 | JLabel sheenLabel; |
---|
4644 | | - NumberSlider sheenField; |
---|
| 5921 | + cNumberSlider sheenField; |
---|
4645 | 5922 | JLabel subsurfaceLabel; |
---|
4646 | | - NumberSlider subsurfaceField; |
---|
| 5923 | + cNumberSlider subsurfaceField; |
---|
4647 | 5924 | //JLabel bumpLabel; |
---|
4648 | 5925 | //NumberSlider bumpField; |
---|
4649 | 5926 | JLabel backlitLabel; |
---|
4650 | | - NumberSlider backlitField; |
---|
| 5927 | + cNumberSlider backlitField; |
---|
4651 | 5928 | JLabel anisoLabel; |
---|
4652 | | - NumberSlider anisoField; |
---|
| 5929 | + cNumberSlider anisoField; |
---|
4653 | 5930 | JLabel anisoVLabel; |
---|
4654 | | - NumberSlider anisoVField; |
---|
| 5931 | + cNumberSlider anisoVField; |
---|
| 5932 | + |
---|
4655 | 5933 | JLabel cameraLabel; |
---|
4656 | | - NumberSlider cameraField; |
---|
| 5934 | + cNumberSlider cameraField; |
---|
4657 | 5935 | JLabel selfshadowLabel; |
---|
4658 | | - NumberSlider selfshadowField; |
---|
| 5936 | + cNumberSlider selfshadowField; |
---|
4659 | 5937 | JLabel shadowLabel; |
---|
4660 | | - NumberSlider shadowField; |
---|
| 5938 | + cNumberSlider shadowField; |
---|
4661 | 5939 | JLabel textureLabel; |
---|
4662 | | - NumberSlider textureField; |
---|
| 5940 | + cNumberSlider textureField; |
---|
4663 | 5941 | JLabel opacityLabel; |
---|
4664 | | - NumberSlider opacityField; |
---|
| 5942 | + cNumberSlider opacityField; |
---|
4665 | 5943 | JLabel fakedepthLabel; |
---|
4666 | | - NumberSlider fakedepthField; |
---|
| 5944 | + cNumberSlider fakedepthField; |
---|
4667 | 5945 | JLabel shadowbiasLabel; |
---|
4668 | | - NumberSlider shadowbiasField; |
---|
| 5946 | + cNumberSlider shadowbiasField; |
---|
| 5947 | + |
---|
4669 | 5948 | JLabel bumpLabel; |
---|
4670 | | - NumberSlider bumpField; |
---|
| 5949 | + cNumberSlider bumpField; |
---|
4671 | 5950 | JLabel noiseLabel; |
---|
4672 | | - NumberSlider noiseField; |
---|
| 5951 | + cNumberSlider noiseField; |
---|
4673 | 5952 | JLabel powerLabel; |
---|
4674 | | - NumberSlider powerField; |
---|
| 5953 | + cNumberSlider powerField; |
---|
4675 | 5954 | JLabel borderfadeLabel; |
---|
4676 | | - NumberSlider borderfadeField; |
---|
| 5955 | + cNumberSlider borderfadeField; |
---|
4677 | 5956 | JLabel fogLabel; |
---|
4678 | | - NumberSlider fogField; |
---|
| 5957 | + cNumberSlider fogField; |
---|
4679 | 5958 | JLabel opacityPowerLabel; |
---|
4680 | | - NumberSlider opacityPowerField; |
---|
4681 | | - JTree jTree; |
---|
| 5959 | + cNumberSlider opacityPowerField; |
---|
| 5960 | + cTree jTree; |
---|
4682 | 5961 | //ObjectUI parent; |
---|
4683 | 5962 | |
---|
4684 | | - NumberSlider normalpushField; |
---|
| 5963 | + cNumberSlider normalpushField; |
---|
| 5964 | + |
---|
| 5965 | + private MenuItem importGFDItem; |
---|
| 5966 | + private MenuItem importVRMLX3DItem; |
---|
| 5967 | + private MenuItem import3DSItem; |
---|
| 5968 | + private MenuItem importOBJItem; |
---|
4685 | 5969 | } |
---|