.. | .. |
---|
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.*; |
---|
.. | .. |
---|
19 | 20 | import //weka.core. |
---|
20 | 21 | matrix.Matrix; |
---|
21 | 22 | |
---|
| 23 | +import grafeme.ui.*; |
---|
| 24 | + |
---|
22 | 25 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 26 | ActionListener, ChangeListener, |
---|
24 | 27 | InputMethodListener, |
---|
.. | .. |
---|
33 | 36 | |
---|
34 | 37 | GroupEditor callee; |
---|
35 | 38 | JFrame frame; |
---|
| 39 | + |
---|
| 40 | + static ObjEditor theFrame; |
---|
| 41 | + |
---|
| 42 | + cButton GetButton(String name, boolean border) |
---|
| 43 | + { |
---|
| 44 | + try |
---|
| 45 | + { |
---|
| 46 | + ImageIcon icon = GetIcon(name); |
---|
| 47 | + return new cButton(icon, border); |
---|
| 48 | + } |
---|
| 49 | + catch (Exception e) |
---|
| 50 | + { |
---|
| 51 | + return new cButton(name, border); |
---|
| 52 | + } |
---|
| 53 | + } |
---|
| 54 | + |
---|
| 55 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 56 | + { |
---|
| 57 | + try |
---|
| 58 | + { |
---|
| 59 | + ImageIcon icon = GetIcon(name); |
---|
| 60 | + return new cToggleButton(icon, border); |
---|
| 61 | + } |
---|
| 62 | + catch (Exception e) |
---|
| 63 | + { |
---|
| 64 | + return new cToggleButton(name, border); |
---|
| 65 | + } |
---|
| 66 | + } |
---|
| 67 | + |
---|
| 68 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 69 | + { |
---|
| 70 | + try |
---|
| 71 | + { |
---|
| 72 | + ImageIcon icon = GetIcon(name); |
---|
| 73 | + return new cCheckBox(icon, border); |
---|
| 74 | + } |
---|
| 75 | + catch (Exception e) |
---|
| 76 | + { |
---|
| 77 | + return new cCheckBox(name, border); |
---|
| 78 | + } |
---|
| 79 | + } |
---|
| 80 | + |
---|
| 81 | + private ImageIcon GetIcon(String name) throws IOException |
---|
| 82 | + { |
---|
| 83 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 84 | + |
---|
| 85 | + if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 86 | + { |
---|
| 87 | + BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
| 88 | + Graphics2D g = resized.createGraphics(); |
---|
| 89 | + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 90 | + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 91 | + g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 92 | + g.dispose(); |
---|
| 93 | + |
---|
| 94 | + image = resized; |
---|
| 95 | + } |
---|
| 96 | + |
---|
| 97 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 98 | + return icon; |
---|
| 99 | + } |
---|
36 | 100 | |
---|
37 | 101 | // SCRIPT |
---|
38 | 102 | |
---|
.. | .. |
---|
124 | 188 | void keyPressed(int key, int modifiers) |
---|
125 | 189 | { |
---|
126 | 190 | System.out.println("KEY PRESSED"); |
---|
127 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 191 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
128 | 192 | } |
---|
129 | 193 | */ |
---|
130 | 194 | |
---|
.. | .. |
---|
136 | 200 | public void closeUI() |
---|
137 | 201 | { |
---|
138 | 202 | //new Exception().printStackTrace(); |
---|
139 | | - System.out.println("this = " + this); |
---|
140 | | - System.out.println("objEditor = " + objEditor); |
---|
| 203 | +// System.out.println("this = " + this); |
---|
| 204 | +// System.out.println("objEditor = " + objEditor); |
---|
141 | 205 | //nameField.removeActionListener(this); |
---|
142 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 206 | +// objEditor.ctrlPanel.remove(nameField); |
---|
| 207 | + |
---|
| 208 | + objEditor.ctrlPanel.remove(namePanel); |
---|
143 | 209 | |
---|
144 | 210 | if (!GroupEditor.allparams) |
---|
145 | 211 | return; |
---|
146 | 212 | |
---|
147 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
148 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
149 | | - objEditor.ctrlPanel.remove(markCB); |
---|
150 | | - |
---|
151 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
152 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
153 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
154 | | - |
---|
155 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
156 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
157 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
158 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
159 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
160 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
161 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
162 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
163 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
164 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 213 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 214 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 215 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 216 | +// |
---|
| 217 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 218 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 219 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 220 | +// |
---|
| 221 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 222 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 223 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 224 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 225 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 226 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 227 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 228 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 229 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 230 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
165 | 231 | |
---|
166 | | - Remove(normalpushField); |
---|
| 232 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 233 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 234 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
| 235 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 236 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 237 | + |
---|
| 238 | + //Remove(normalpushField); |
---|
167 | 239 | } |
---|
168 | 240 | |
---|
169 | 241 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
234 | 306 | //localCopy.parent = null; |
---|
235 | 307 | |
---|
236 | 308 | frame = new JFrame(); |
---|
| 309 | + frame.setUndecorated(true); |
---|
237 | 310 | objEditor = this; |
---|
238 | 311 | this.callee = callee; |
---|
239 | 312 | |
---|
.. | .. |
---|
267 | 340 | void SetupMenu() |
---|
268 | 341 | { |
---|
269 | 342 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
270 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
271 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
272 | | - windowMenu.add("-"); |
---|
273 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
274 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 343 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 344 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 345 | + fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
| 346 | + |
---|
| 347 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 348 | + Menu menu = new Menu("Import"); |
---|
| 349 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 350 | + importOBJItem.addActionListener(this); |
---|
| 351 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 352 | + import3DSItem.addActionListener(this); |
---|
| 353 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 354 | + importVRMLX3DItem.addActionListener(this); |
---|
| 355 | + menu.add("-"); |
---|
| 356 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 357 | + importGFDItem.addActionListener(this); |
---|
| 358 | + fileMenu.add(menu); |
---|
| 359 | + fileMenu.add("-"); |
---|
| 360 | + |
---|
| 361 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 362 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
275 | 363 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
276 | | - windowMenu.add("-"); |
---|
277 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
278 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
279 | | - windowMenu.add("-"); |
---|
| 364 | + fileMenu.add("-"); |
---|
| 365 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 366 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 367 | + fileMenu.add("-"); |
---|
280 | 368 | if (client.parent != null) |
---|
281 | 369 | { |
---|
282 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 370 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
283 | 371 | } else |
---|
284 | 372 | { |
---|
285 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 373 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
286 | 374 | } |
---|
287 | 375 | |
---|
| 376 | + newItem.addActionListener(this); |
---|
288 | 377 | loadItem.addActionListener(this); |
---|
289 | 378 | saveItem.addActionListener(this); |
---|
290 | 379 | saveAsItem.addActionListener(this); |
---|
.. | .. |
---|
293 | 382 | //povItem.addActionListener(this); |
---|
294 | 383 | closeItem.addActionListener(this); |
---|
295 | 384 | |
---|
296 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
297 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
298 | | - //zBufferItem.addActionListener(this); |
---|
299 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
300 | | - //normalLensItem.addActionListener(this); |
---|
301 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
302 | | - revertCameraItem.addActionListener(this); |
---|
303 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
304 | | - toggleTimelineItem.addItemListener(this); |
---|
305 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
306 | | - toggleFullScreenItem.addItemListener(this); |
---|
307 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
308 | | - cameraMenu.add("-"); |
---|
309 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
310 | | - toggleTextureItem.addItemListener(this); |
---|
311 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
312 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
313 | | - toggleLiveItem.addItemListener(this); |
---|
314 | | - toggleLiveItem.setState(Globals.isLIVE()); |
---|
315 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
316 | | - stepItem.addActionListener(this); |
---|
317 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
318 | | -// toggleDLItem.addItemListener(this); |
---|
319 | | -// toggleDLItem.setState(false); |
---|
320 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
321 | | - toggleRenderItem.addItemListener(this); |
---|
322 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
323 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
324 | | - toggleDebugItem.addItemListener(this); |
---|
325 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
326 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
327 | | - toggleFrustumItem.addItemListener(this); |
---|
328 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
329 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
330 | | - toggleFootContactItem.addItemListener(this); |
---|
331 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
332 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
333 | | - toggleRandomItem.addItemListener(this); |
---|
334 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
335 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
336 | | - toggleHandleItem.addItemListener(this); |
---|
337 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
338 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
339 | | - togglePaintItem.addItemListener(this); |
---|
340 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
341 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
342 | | -// toggleRootItem.addItemListener(this); |
---|
343 | | -// toggleRootItem.setState(false); |
---|
344 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
345 | | -// animationItem.addItemListener(this); |
---|
346 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
347 | | - cameraMenu.add("-"); |
---|
348 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
349 | | - editCameraItem.addActionListener(this); |
---|
350 | | - |
---|
351 | 385 | objectPanel = new JTabbedPane(); |
---|
| 386 | + |
---|
| 387 | + ChangeListener changeListener = new ChangeListener() |
---|
| 388 | + { |
---|
| 389 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 390 | + { |
---|
| 391 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 392 | +// { |
---|
| 393 | +// if (latestObject != null) |
---|
| 394 | +// { |
---|
| 395 | +// refreshContents(true); |
---|
| 396 | +// SetMaterial(latestObject); |
---|
| 397 | +// } |
---|
| 398 | +// |
---|
| 399 | +// materialFlushed = true; |
---|
| 400 | +// } |
---|
| 401 | + |
---|
| 402 | + refreshContents(false); // To refresh Info tab |
---|
| 403 | + } |
---|
| 404 | + }; |
---|
| 405 | + objectPanel.addChangeListener(changeListener); |
---|
| 406 | + |
---|
352 | 407 | toolbarPanel = new JPanel(); |
---|
353 | 408 | toolbarPanel.setName("Toolbar"); |
---|
354 | | - treePanel = new JPanel(); |
---|
| 409 | + treePanel = new cGridBag(); |
---|
355 | 410 | treePanel.setName("Tree"); |
---|
356 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
357 | | - ctrlPanel.setName("Edit"); |
---|
358 | | - materialPanel = new JPanel(); |
---|
| 411 | + |
---|
| 412 | + editPanel = new cGridBag().setVertical(true); |
---|
| 413 | + editPanel.setName("Edit"); |
---|
| 414 | + |
---|
| 415 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
| 416 | + |
---|
| 417 | + editCommandsPanel = new cGridBag(); |
---|
| 418 | + editPanel.add(editCommandsPanel); |
---|
| 419 | + editPanel.add(ctrlPanel); |
---|
| 420 | + |
---|
| 421 | + toolboxPanel = new cGridBag().setVertical(false); |
---|
| 422 | + toolboxPanel.setName("Toolbox"); |
---|
| 423 | + |
---|
| 424 | + materialPanel = new cGridBag().setVertical(true); |
---|
359 | 425 | materialPanel.setName("Material"); |
---|
| 426 | + |
---|
360 | 427 | /*JTextPane*/ |
---|
361 | 428 | infoarea = createTextPane(); |
---|
| 429 | + doc = infoarea.getStyledDocument(); |
---|
| 430 | + |
---|
362 | 431 | infoarea.setEditable(true); |
---|
363 | 432 | SetText(); |
---|
364 | 433 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
365 | 434 | // infoarea.setOpaque(false); |
---|
366 | 435 | // //infoarea.setForeground(textcolor); |
---|
367 | | - infoarea.setLineWrap(true); |
---|
368 | | - infoarea.setWrapStyleWord(true); |
---|
| 436 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 437 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
369 | 438 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
370 | 439 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
371 | 440 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
376 | 445 | mainPanel.setName("Main"); |
---|
377 | 446 | mainPanel.setContinuousLayout(true); |
---|
378 | 447 | mainPanel.setOneTouchExpandable(true); |
---|
379 | | - mainPanel.setDividerLocation(1.0); |
---|
380 | 448 | mainPanel.setDividerSize(9); |
---|
381 | | - mainPanel.setResizeWeight(0); |
---|
| 449 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 450 | + mainPanel.setResizeWeight(0.5); |
---|
382 | 451 | |
---|
383 | 452 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
384 | 453 | //mainPanel.setLayout(new GridBagLayout()); |
---|
385 | 454 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
386 | | - treePanel.setLayout(new GridBagLayout()); |
---|
387 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
388 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 455 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 456 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 457 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
389 | 458 | |
---|
390 | 459 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
391 | 460 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
424 | 493 | static String newline = "\n"; |
---|
425 | 494 | protected static final String buttonString = "JButton"; |
---|
426 | 495 | StyledDocument doc; |
---|
427 | | - JTextArea infoarea; |
---|
| 496 | + JTextPane infoarea; |
---|
428 | 497 | |
---|
429 | 498 | void ClearInfo() |
---|
430 | 499 | { |
---|
.. | .. |
---|
447 | 516 | e.printStackTrace(); |
---|
448 | 517 | } |
---|
449 | 518 | |
---|
450 | | - String selection = infoarea.getText(); |
---|
451 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
452 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
453 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 519 | +// String selection = infoarea.getText(); |
---|
| 520 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 521 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 522 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
454 | 523 | //clipboard.setContents(data, data); |
---|
455 | 524 | } |
---|
456 | 525 | |
---|
.. | .. |
---|
473 | 542 | //SendInfo("Name:", "bold"); |
---|
474 | 543 | if (sel.GetTextures() != null || debug) |
---|
475 | 544 | { |
---|
476 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 545 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
477 | 546 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
478 | 547 | if (sel.Size() > 0) |
---|
479 | 548 | { |
---|
480 | 549 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
481 | 550 | } |
---|
482 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 551 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
483 | 552 | if (debug) |
---|
484 | 553 | { |
---|
485 | 554 | try |
---|
.. | .. |
---|
491 | 560 | } |
---|
492 | 561 | |
---|
493 | 562 | if (full) |
---|
494 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 563 | + { |
---|
| 564 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 565 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 566 | + } |
---|
495 | 567 | |
---|
496 | 568 | if (sel.bRep != null) |
---|
497 | 569 | { |
---|
.. | .. |
---|
518 | 590 | } |
---|
519 | 591 | if (sel.support != null) |
---|
520 | 592 | { |
---|
521 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 593 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
522 | 594 | } |
---|
523 | 595 | if (sel.scriptnode != null) |
---|
524 | 596 | { |
---|
.. | .. |
---|
589 | 661 | { |
---|
590 | 662 | CameraPane.pointflow = (PointFlow) sel; |
---|
591 | 663 | } |
---|
| 664 | + |
---|
| 665 | + si.SendInfo("_____________________", "regular"); |
---|
| 666 | + si.SendInfo("", "regular"); |
---|
592 | 667 | } |
---|
593 | 668 | } |
---|
594 | 669 | |
---|
.. | .. |
---|
604 | 679 | } |
---|
605 | 680 | } |
---|
606 | 681 | |
---|
| 682 | +static GraphicsDevice device = GraphicsEnvironment |
---|
| 683 | + .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 684 | + |
---|
| 685 | + Rectangle keeprect; |
---|
| 686 | + cRadio radio; |
---|
| 687 | + |
---|
| 688 | +cButton keepButton; |
---|
| 689 | + cButton twoButton; // Full 3D |
---|
| 690 | + cButton sixButton; |
---|
| 691 | + cButton threeButton; |
---|
| 692 | + cButton sevenButton; |
---|
| 693 | + cButton fourButton; // full panel |
---|
| 694 | + cButton oneButton; // full XYZ |
---|
| 695 | + //cButton currentLayout; |
---|
| 696 | + |
---|
| 697 | + boolean maximized; |
---|
| 698 | + |
---|
| 699 | + cButton fullscreenLayout; |
---|
| 700 | + |
---|
| 701 | + void Minimize() |
---|
| 702 | + { |
---|
| 703 | + frame.setState(Frame.ICONIFIED); |
---|
| 704 | + } |
---|
| 705 | + |
---|
| 706 | + void Maximize() |
---|
| 707 | + { |
---|
| 708 | + if (maximized) |
---|
| 709 | + { |
---|
| 710 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 711 | + } |
---|
| 712 | + else |
---|
| 713 | + { |
---|
| 714 | + keeprect = frame.getBounds(); |
---|
| 715 | + Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 716 | + Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 717 | + frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 718 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 719 | + } |
---|
| 720 | + |
---|
| 721 | + maximized ^= true; |
---|
| 722 | + } |
---|
| 723 | + |
---|
607 | 724 | void ToggleFullScreen() |
---|
608 | 725 | { |
---|
609 | 726 | if (CameraPane.FULLSCREEN) |
---|
610 | 727 | { |
---|
611 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
612 | | - framePanel.add(bigThree); |
---|
613 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 728 | + device.setFullScreenWindow(null); |
---|
| 729 | + //frame.setVisible(false); |
---|
| 730 | +// frame.removeNotify(); |
---|
| 731 | +// frame.setUndecorated(false); |
---|
| 732 | +// frame.addNotify(); |
---|
| 733 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 734 | + |
---|
| 735 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 736 | +// X framePanel.add(bigThree); |
---|
| 737 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 738 | + framePanel.setDividerLocation(1); |
---|
| 739 | + |
---|
| 740 | + //frame.setVisible(true); |
---|
| 741 | + radio.layout = keepButton; |
---|
| 742 | + //theFrame = null; |
---|
| 743 | + keepButton = null; |
---|
| 744 | + radio.layout.doClick(); |
---|
| 745 | + |
---|
614 | 746 | } else |
---|
615 | 747 | { |
---|
616 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
617 | | - framePanel.remove(bigThree); |
---|
618 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 748 | + keepButton = radio.layout; |
---|
| 749 | + //keeprect = frame.getBounds(); |
---|
| 750 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 751 | +// frame.getToolkit().getScreenSize().height); |
---|
| 752 | + //frame.setVisible(false); |
---|
| 753 | + device.setFullScreenWindow(frame); |
---|
| 754 | +// frame.removeNotify(); |
---|
| 755 | +// frame.setUndecorated(true); |
---|
| 756 | +// frame.addNotify(); |
---|
| 757 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 758 | +// X framePanel.remove(bigThree); |
---|
| 759 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 760 | + framePanel.setDividerLocation(0); |
---|
| 761 | + |
---|
| 762 | + radio.layout = fullscreenLayout; |
---|
| 763 | + radio.layout.doClick(); |
---|
| 764 | + //frame.setVisible(true); |
---|
619 | 765 | } |
---|
| 766 | + |
---|
620 | 767 | cameraView.ToggleFullScreen(); |
---|
621 | 768 | } |
---|
622 | 769 | |
---|
623 | | - private JTextArea createTextPane() |
---|
| 770 | + private JTextPane createTextPane() |
---|
624 | 771 | { |
---|
625 | | - String[] initString = |
---|
626 | | - { |
---|
627 | | - "This is an editable JTextPane, ", //regular |
---|
628 | | - "another ", //italic |
---|
629 | | - "styled ", //bold |
---|
630 | | - "text ", //small |
---|
631 | | - "component, ", //large |
---|
632 | | - "which supports embedded components..." + newline,//regular |
---|
633 | | - " " + newline, //button |
---|
634 | | - "...and embedded icons..." + newline, //regular |
---|
635 | | - " ", //icon |
---|
636 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
637 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
638 | | - + "cover methods for interacting with those objects." |
---|
639 | | - }; |
---|
| 772 | +// TEXTAREA String[] initString = |
---|
| 773 | +// { |
---|
| 774 | +// "This is an editable JTextPane, ", //regular |
---|
| 775 | +// "another ", //italic |
---|
| 776 | +// "styled ", //bold |
---|
| 777 | +// "text ", //small |
---|
| 778 | +// "component, ", //large |
---|
| 779 | +// "which supports embedded components..." + newline,//regular |
---|
| 780 | +// " " + newline, //button |
---|
| 781 | +// "...and embedded icons..." + newline, //regular |
---|
| 782 | +// " ", //icon |
---|
| 783 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 784 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 785 | +// + "cover methods for interacting with those objects." |
---|
| 786 | +// }; |
---|
| 787 | +// |
---|
| 788 | +// String[] initStyles = |
---|
| 789 | +// { |
---|
| 790 | +// "regular", "italic", "bold", "small", "large", |
---|
| 791 | +// "regular", "button", "regular", "icon", |
---|
| 792 | +// "regular" |
---|
| 793 | +// }; |
---|
| 794 | +// |
---|
| 795 | +// JTextPane textPane = new JTextPane(); |
---|
| 796 | +// textPane.setEditable(true); |
---|
| 797 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 798 | +// addStylesToDocument(doc); |
---|
| 799 | +// |
---|
| 800 | +// try |
---|
| 801 | +// { |
---|
| 802 | +// for (int j = 0; j < 2; j++) |
---|
| 803 | +// { |
---|
| 804 | +// for (int i = 0; i < initString.length; i++) |
---|
| 805 | +// { |
---|
| 806 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 807 | +// doc.getStyle(initStyles[i])); |
---|
| 808 | +// } |
---|
| 809 | +// } |
---|
| 810 | +// } catch (BadLocationException ble) |
---|
| 811 | +// { |
---|
| 812 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 813 | +// } |
---|
640 | 814 | |
---|
641 | | - String[] initStyles = |
---|
642 | | - { |
---|
643 | | - "regular", "italic", "bold", "small", "large", |
---|
644 | | - "regular", "button", "regular", "icon", |
---|
645 | | - "regular" |
---|
646 | | - }; |
---|
647 | | - |
---|
648 | | - JTextPane textPane = new JTextPane(); |
---|
649 | | - textPane.setEditable(true); |
---|
650 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
651 | | - addStylesToDocument(doc); |
---|
652 | | - |
---|
653 | | - try |
---|
654 | | - { |
---|
655 | | - for (int j = 0; j < 2; j++) |
---|
656 | | - { |
---|
657 | | - for (int i = 0; i < initString.length; i++) |
---|
658 | | - { |
---|
659 | | - doc.insertString(doc.getLength(), initString[i], |
---|
660 | | - doc.getStyle(initStyles[i])); |
---|
661 | | - } |
---|
662 | | - } |
---|
663 | | - } catch (BadLocationException ble) |
---|
664 | | - { |
---|
665 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
666 | | - } |
---|
667 | | - |
---|
668 | | - return new JTextArea(); // textPane; |
---|
| 815 | + return new JTextPane(); // textPane; |
---|
669 | 816 | } |
---|
670 | 817 | |
---|
671 | 818 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
718 | 865 | protected static ImageIcon createImageIcon(String path, |
---|
719 | 866 | String description) |
---|
720 | 867 | { |
---|
721 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 868 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
722 | 869 | if (imgURL != null) |
---|
723 | 870 | { |
---|
724 | 871 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
750 | 897 | // NumberSlider vDivsField; |
---|
751 | 898 | // JCheckBox endcaps; |
---|
752 | 899 | JCheckBox liveCB; |
---|
| 900 | + JCheckBox selectCB; |
---|
753 | 901 | JCheckBox hideCB; |
---|
754 | 902 | JCheckBox link2masterCB; |
---|
755 | 903 | JCheckBox markCB; |
---|
.. | .. |
---|
757 | 905 | JCheckBox speedupCB; |
---|
758 | 906 | JCheckBox rewindCB; |
---|
759 | 907 | JCheckBox flipVCB; |
---|
| 908 | + |
---|
| 909 | + cCheckBox toggleTextureCB; |
---|
| 910 | + cCheckBox toggleSwitchCB; |
---|
| 911 | + |
---|
760 | 912 | JComboBox texresMenu; |
---|
| 913 | + |
---|
761 | 914 | JButton resetButton; |
---|
762 | 915 | JButton stepButton; |
---|
763 | 916 | JButton stepAllButton; |
---|
.. | .. |
---|
765 | 918 | JButton slowerButton; |
---|
766 | 919 | JButton fasterButton; |
---|
767 | 920 | JButton remarkButton; |
---|
| 921 | + |
---|
| 922 | + cGridBag editPanel; |
---|
| 923 | + cGridBag editCommandsPanel; |
---|
| 924 | + |
---|
| 925 | + cGridBag namePanel; |
---|
| 926 | + cGridBag setupPanel; |
---|
| 927 | + cGridBag setupPanel2; |
---|
| 928 | + cGridBag objectCommandsPanel; |
---|
| 929 | + cGridBag pushPanel; |
---|
| 930 | + cGridBag fillPanel; |
---|
768 | 931 | |
---|
769 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 932 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
770 | 933 | { |
---|
771 | 934 | JCheckBox cb; |
---|
772 | 935 | |
---|
773 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
774 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
775 | | -// oe.aConstraints.weightx = 1; |
---|
776 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
777 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 936 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
778 | 937 | cb.addItemListener(this); |
---|
779 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
780 | | - oe.aConstraints.gridwidth = 1; |
---|
781 | | - oe.aConstraints.gridx += 1; |
---|
782 | 938 | |
---|
783 | 939 | return cb; |
---|
784 | 940 | } |
---|
785 | 941 | |
---|
786 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 942 | + cButton AddButton(cGridBag panel, String label) |
---|
787 | 943 | { |
---|
788 | 944 | cButton cb; |
---|
789 | 945 | |
---|
790 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
791 | | - oe.aConstraints.gridwidth = 1; |
---|
792 | | -// oe.aConstraints.weightx = 1; |
---|
793 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
794 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 946 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
795 | 947 | cb.addActionListener(this); |
---|
796 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
797 | | - oe.aConstraints.gridwidth = 1; |
---|
798 | | - oe.aConstraints.gridx += 1; |
---|
799 | 948 | |
---|
800 | 949 | return cb; |
---|
801 | 950 | } |
---|
802 | 951 | |
---|
803 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 952 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
804 | 953 | { |
---|
805 | 954 | JComboBox combo; |
---|
806 | 955 | |
---|
807 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
808 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
809 | | - oe.aConstraints.gridx += 1; |
---|
| 956 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
810 | 957 | combo.addActionListener(this); |
---|
811 | 958 | |
---|
812 | 959 | return combo; |
---|
813 | 960 | } |
---|
814 | 961 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 962 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
816 | 963 | { |
---|
817 | | - NumberSlider combo; |
---|
| 964 | + cGridBag control = new cGridBag(); |
---|
| 965 | + |
---|
| 966 | + cNumberSlider combo; |
---|
818 | 967 | |
---|
819 | 968 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 969 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
823 | | - aConstraints.gridwidth = 1; |
---|
824 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
825 | | - aConstraints.gridx += 1; |
---|
826 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
827 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
828 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
829 | | - aConstraints.gridx += 1; |
---|
830 | | - aConstraints.gridwidth = 1; |
---|
831 | | - |
---|
| 970 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 971 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 972 | combo.setFloat(current); |
---|
833 | | - |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 973 | + |
---|
| 974 | + panel.add(control); |
---|
| 975 | + |
---|
| 976 | + return control; |
---|
839 | 977 | } |
---|
840 | 978 | |
---|
841 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 979 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
842 | 980 | { |
---|
843 | | - NumberSlider combo; |
---|
| 981 | + cGridBag control = new cGridBag(); |
---|
| 982 | + |
---|
| 983 | + cNumberSlider combo; |
---|
844 | 984 | |
---|
845 | 985 | JLabel jlabel = new JLabel(label); |
---|
846 | | - |
---|
847 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
848 | 986 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
849 | | - aConstraints.gridwidth = 2; |
---|
850 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
851 | | - aConstraints.gridx += 1; |
---|
852 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
853 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
854 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
855 | | - aConstraints.gridx += 1; |
---|
856 | | - aConstraints.gridwidth = 1; |
---|
857 | | - |
---|
| 987 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 988 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
858 | 989 | combo.setInteger(current); |
---|
859 | 990 | |
---|
860 | | - combo.label = jlabel; |
---|
861 | | - |
---|
862 | | - combo.addChangeListener(this); |
---|
863 | | - |
---|
864 | | - return combo; |
---|
| 991 | + panel.add(control); |
---|
| 992 | + |
---|
| 993 | + return control; |
---|
865 | 994 | } |
---|
866 | 995 | |
---|
867 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 996 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
868 | 997 | { |
---|
869 | 998 | JTextArea text; |
---|
870 | 999 | |
---|
871 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
872 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
873 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1000 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
874 | 1001 | text.addCaretListener(this); |
---|
875 | | - aConstraints.gridx += 1; |
---|
876 | | - aConstraints.gridwidth = 1; |
---|
877 | 1002 | |
---|
878 | 1003 | return text; |
---|
879 | 1004 | } |
---|
.. | .. |
---|
903 | 1028 | objEditor.ctrlPanel.remove(j); |
---|
904 | 1029 | } |
---|
905 | 1030 | |
---|
| 1031 | + void Remove(cNumberSlider j) |
---|
| 1032 | + { |
---|
| 1033 | + j.removeChangeListener(this); |
---|
| 1034 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 1035 | + objEditor.ctrlPanel.remove(j); |
---|
| 1036 | + } |
---|
| 1037 | + |
---|
906 | 1038 | /* |
---|
907 | 1039 | */ |
---|
908 | | - void Return() // ObjEditor oe) |
---|
| 1040 | + void Return0() // ObjEditor oe) |
---|
909 | 1041 | { |
---|
910 | 1042 | aConstraints.gridy += 1; |
---|
911 | 1043 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
960 | 1092 | |
---|
961 | 1093 | void SetupUI2(ObjEditor oe) |
---|
962 | 1094 | { |
---|
963 | | -// oe.aConstraints.weightx = 0; |
---|
964 | | -// oe.aConstraints.weighty = 0; |
---|
965 | | -// oe.aConstraints.gridx = 0; |
---|
966 | | -// oe.aConstraints.gridy = 0; |
---|
967 | | - SetupName(oe); |
---|
| 1095 | + //SetupName(oe); |
---|
| 1096 | + |
---|
| 1097 | + namePanel = new cGridBag(); |
---|
| 1098 | + |
---|
| 1099 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 1100 | + namePanel.add(nameField); |
---|
| 1101 | + oe.ctrlPanel.add(namePanel); |
---|
| 1102 | + |
---|
| 1103 | + oe.ctrlPanel.Return(); |
---|
968 | 1104 | |
---|
969 | 1105 | if (!GroupEditor.allparams) |
---|
970 | 1106 | return; |
---|
971 | 1107 | |
---|
972 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
973 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
974 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1108 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1109 | + |
---|
| 1110 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1111 | + liveCB.setToolTipText("Animate object"); |
---|
| 1112 | + selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1113 | + selectCB.setToolTipText("Make object selectable"); |
---|
975 | 1114 | // Return(); |
---|
976 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
977 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
978 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
979 | | - Return(); |
---|
980 | | - resetButton = AddButton(oe, "Reset"); |
---|
981 | | - stepButton = AddButton(oe, "Step"); |
---|
| 1115 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1116 | + hideCB.setToolTipText("Hide object"); |
---|
| 1117 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 1118 | + markCB.setToolTipText("Set the animation target transform"); |
---|
| 1119 | + |
---|
| 1120 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1121 | + |
---|
| 1122 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1123 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1124 | + |
---|
| 1125 | + randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
| 1126 | + randomCB.setToolTipText("Randomly Rewind or Go back and forth"); |
---|
| 1127 | + |
---|
| 1128 | + if (Globals.ADVANCED) |
---|
| 1129 | + { |
---|
| 1130 | + link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
| 1131 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1132 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1133 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1134 | + } |
---|
| 1135 | + |
---|
| 1136 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1137 | + oe.ctrlPanel.Return(); |
---|
| 1138 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1139 | + oe.ctrlPanel.Return(); |
---|
| 1140 | + |
---|
| 1141 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
| 1142 | + |
---|
| 1143 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1144 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1145 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1146 | + stepButton.setToolTipText("Step one frame"); |
---|
982 | 1147 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
983 | 1148 | // stepAllButton = AddButton(oe, "Step All"); |
---|
984 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
985 | 1149 | // Return(); |
---|
986 | | - slowerButton = AddButton(oe, "Slow"); |
---|
987 | | - fasterButton = AddButton(oe, "Fast"); |
---|
988 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1150 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1151 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1152 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1153 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1154 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1155 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
989 | 1156 | |
---|
990 | | - Return(); |
---|
| 1157 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
| 1158 | + oe.ctrlPanel.Return(); |
---|
991 | 1159 | |
---|
992 | | - normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
993 | | - Return(); |
---|
| 1160 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1161 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1162 | + //Return(); |
---|
| 1163 | + |
---|
| 1164 | + oe.ctrlPanel.Return(); |
---|
994 | 1165 | |
---|
995 | 1166 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
996 | 1167 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1085 | 1256 | oe.aConstraints.gridwidth = 1; |
---|
1086 | 1257 | /**/ |
---|
1087 | 1258 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1088 | | - Return(); |
---|
| 1259 | + oe.ctrlPanel.Return(); |
---|
1089 | 1260 | |
---|
1090 | 1261 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1091 | 1262 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1187 | 1358 | //JPanel worldPanel = |
---|
1188 | 1359 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1189 | 1360 | //worldPanel.setName("World"); |
---|
1190 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
1191 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1192 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1361 | + centralPanel = new cGridBag(); |
---|
| 1362 | + centralPanel.preferredWidth = 20; |
---|
| 1363 | + |
---|
| 1364 | + if (Globals.ADVANCED) |
---|
| 1365 | + { |
---|
| 1366 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1367 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1193 | 1368 | |
---|
1194 | 1369 | cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
1195 | 1370 | cameraPanel.setContinuousLayout(true); |
---|
.. | .. |
---|
1198 | 1373 | // cameraPanel.setDividerSize(9); |
---|
1199 | 1374 | cameraPanel.setResizeWeight(1.0); |
---|
1200 | 1375 | |
---|
| 1376 | + } |
---|
| 1377 | + |
---|
1201 | 1378 | centralPanel.add(cameraView); |
---|
| 1379 | + centralPanel.setFocusable(true); |
---|
1202 | 1380 | //frame.setJMenuBar(timelineMenubar); |
---|
1203 | 1381 | //centralPanel.add(timelinePanel); |
---|
1204 | 1382 | |
---|
.. | .. |
---|
1217 | 1395 | //frontView.object = copy; |
---|
1218 | 1396 | //sideView.object = copy; |
---|
1219 | 1397 | |
---|
1220 | | - XYZPanel = new JPanel(); |
---|
1221 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1398 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1399 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1222 | 1400 | |
---|
1223 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1224 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1225 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1401 | + XYZPanel.preferredWidth = 5; |
---|
| 1402 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1403 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1404 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1226 | 1405 | |
---|
1227 | 1406 | /* |
---|
1228 | 1407 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1260 | 1439 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1261 | 1440 | //tmp.setName("Edit"); |
---|
1262 | 1441 | objectPanel.add(materialPanel); |
---|
1263 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1264 | | - north.setName("Edit"); |
---|
1265 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1266 | | - objectPanel.add(north); |
---|
| 1442 | + objectPanel.add(toolboxPanel); |
---|
| 1443 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1444 | +// north.setName("Edit"); |
---|
| 1445 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1446 | +// objectPanel.add(north); |
---|
| 1447 | + objectPanel.add(editPanel); |
---|
1267 | 1448 | objectPanel.add(infoPanel); |
---|
1268 | 1449 | |
---|
1269 | 1450 | /* |
---|
.. | .. |
---|
1284 | 1465 | scrollpane.setWheelScrollingEnabled(true); |
---|
1285 | 1466 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1286 | 1467 | |
---|
1287 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1288 | | - scenePanel.add(scrollpane); |
---|
| 1468 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1469 | + scenePanel.preferredWidth = 6; |
---|
| 1470 | + |
---|
| 1471 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1472 | + tabbedPane.add(scrollpane); |
---|
1289 | 1473 | |
---|
1290 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
1291 | | - |
---|
1292 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1474 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1293 | 1475 | |
---|
1294 | 1476 | optionsPanel.setName("Options"); |
---|
1295 | | - scenePanel.add(optionsPanel); |
---|
| 1477 | + |
---|
| 1478 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1479 | + |
---|
| 1480 | + tabbedPane.add(optionsPanel); |
---|
| 1481 | + |
---|
| 1482 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1296 | 1483 | |
---|
| 1484 | + scenePanel.add(tabbedPane); |
---|
1297 | 1485 | |
---|
1298 | 1486 | /* |
---|
1299 | 1487 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1327 | 1515 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1328 | 1516 | //bigPanel.add(ctrlPanel); |
---|
1329 | 1517 | //bigPanel.add(gridPanel); |
---|
| 1518 | + /** |
---|
1330 | 1519 | bigThree = new JPanel(); |
---|
1331 | 1520 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1332 | 1521 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1350 | 1539 | // aConstraints.gridheight = 3; |
---|
1351 | 1540 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1352 | 1541 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1542 | + /**/ |
---|
1353 | 1543 | |
---|
| 1544 | + bigThree = new cGridBag(); |
---|
| 1545 | + bigThree.addComponent(scenePanel); |
---|
| 1546 | + bigThree.addComponent(centralPanel); |
---|
| 1547 | + bigThree.addComponent(XYZPanel); |
---|
| 1548 | + |
---|
1354 | 1549 | // // SIDE EFFECT!!! |
---|
1355 | 1550 | // aConstraints.gridx = 0; |
---|
1356 | 1551 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1377 | 1572 | |
---|
1378 | 1573 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1379 | 1574 | |
---|
1380 | | - frame.setSize(1024, 768); |
---|
1381 | | - frame.show(); |
---|
| 1575 | + frame.setSize(1280, 860); |
---|
| 1576 | + |
---|
| 1577 | + frame.validate(); |
---|
| 1578 | + frame.setVisible(true); |
---|
1382 | 1579 | |
---|
| 1580 | + cameraView.requestFocusInWindow(); |
---|
| 1581 | + |
---|
1383 | 1582 | gridPanel.setDividerLocation(1.0); |
---|
1384 | 1583 | |
---|
1385 | 1584 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
.. | .. |
---|
1393 | 1592 | }); |
---|
1394 | 1593 | } |
---|
1395 | 1594 | |
---|
| 1595 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1596 | + { |
---|
| 1597 | + } |
---|
| 1598 | + |
---|
1396 | 1599 | JTree GetTree() |
---|
1397 | 1600 | { |
---|
1398 | 1601 | return objEditor.jTree; |
---|
.. | .. |
---|
1404 | 1607 | ctrlPanel.removeAll(); |
---|
1405 | 1608 | } |
---|
1406 | 1609 | |
---|
1407 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1610 | + void SetupMaterial(cGridBag panel) |
---|
1408 | 1611 | { |
---|
1409 | | - aConstraints.weighty = 0; |
---|
1410 | | - //aConstraints.weightx = 1; |
---|
1411 | | - /* |
---|
| 1612 | + /* |
---|
1412 | 1613 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1413 | 1614 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1414 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1415 | | - aConstraints.gridx += 1; |
---|
1416 | 1615 | */ |
---|
1417 | 1616 | |
---|
1418 | | - aConstraints.gridwidth = 1; |
---|
1419 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1420 | | - aConstraints.gridx += 1; |
---|
1421 | | - aConstraints.weighty = 0; |
---|
1422 | | - aConstraints.gridwidth = 1; |
---|
| 1617 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 1618 | + |
---|
| 1619 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1620 | + createMaterialButton.setToolTipText("Create material"); |
---|
1423 | 1621 | |
---|
1424 | 1622 | /* |
---|
1425 | 1623 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1426 | | - aConstraints.gridx += 1; |
---|
1427 | | - aConstraints.weighty = 0; |
---|
1428 | | - aConstraints.gridwidth = 1; |
---|
1429 | 1624 | */ |
---|
1430 | 1625 | |
---|
1431 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1432 | | - aConstraints.gridx += 1; |
---|
| 1626 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1627 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1628 | + |
---|
| 1629 | + if (Globals.ADVANCED) |
---|
| 1630 | + { |
---|
| 1631 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1632 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1633 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1634 | + } |
---|
1433 | 1635 | |
---|
1434 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1435 | | - |
---|
1436 | | - aConstraints.gridx += 1; |
---|
1437 | | - |
---|
1438 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1439 | | - |
---|
1440 | | - aConstraints.gridx += 1; |
---|
1441 | | - |
---|
1442 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1443 | | - |
---|
1444 | | - aConstraints.gridx = 0; |
---|
1445 | | - aConstraints.gridy += 1; |
---|
1446 | | - aConstraints.weighty = 0; |
---|
1447 | | - aConstraints.gridwidth = 1; |
---|
| 1636 | + editBar.preferredHeight = 15; |
---|
| 1637 | + |
---|
| 1638 | + panel.add(editBar); |
---|
| 1639 | + |
---|
1448 | 1640 | /**/ |
---|
1449 | 1641 | //aConstraints.weighty = 0; |
---|
1450 | 1642 | ////aConstraints.weightx = 1; |
---|
1451 | 1643 | //aConstraints.weighty = 1; |
---|
1452 | 1644 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1453 | 1645 | //aConstraints.gridx += 1; |
---|
1454 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1455 | | - aConstraints.weighty = 0; |
---|
1456 | | - aConstraints.gridx = 0; |
---|
1457 | | - aConstraints.gridy += 1; |
---|
1458 | | - aConstraints.gridwidth = 1; |
---|
| 1646 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1459 | 1647 | |
---|
1460 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1461 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1462 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1463 | | - aConstraints.gridx += 1; |
---|
1464 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1465 | | - //aConstraints.weightx = 0; |
---|
1466 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1467 | | - aConstraints.gridx = 0; |
---|
1468 | | - aConstraints.gridy += 1; |
---|
1469 | | - aConstraints.gridwidth = 1; |
---|
| 1648 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1649 | + |
---|
| 1650 | + cGridBag color = new cGridBag(); |
---|
| 1651 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1652 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1653 | + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1654 | + //colorField.preferredWidth = 200; |
---|
| 1655 | + colorSection.add(color); |
---|
1470 | 1656 | |
---|
1471 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1472 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1473 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1474 | | - aConstraints.gridx += 1; |
---|
1475 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1476 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1477 | | - aConstraints.gridx = 0; |
---|
1478 | | - aConstraints.gridy += 1; |
---|
1479 | | - aConstraints.gridwidth = 1; |
---|
| 1657 | + cGridBag modulation = new cGridBag(); |
---|
| 1658 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 1659 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1660 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1661 | + colorSection.add(modulation); |
---|
1480 | 1662 | |
---|
1481 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1482 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1483 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1484 | | - aConstraints.gridx += 1; |
---|
1485 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1486 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1487 | | - aConstraints.gridx = 0; |
---|
1488 | | - aConstraints.gridy += 1; |
---|
1489 | | - aConstraints.gridwidth = 1; |
---|
| 1663 | + cGridBag texture = new cGridBag(); |
---|
| 1664 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 1665 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1666 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1667 | + colorSection.add(texture); |
---|
1490 | 1668 | |
---|
1491 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1492 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1493 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1494 | | - aConstraints.gridx += 1; |
---|
1495 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1496 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1497 | | - aConstraints.gridx = 0; |
---|
1498 | | - aConstraints.gridy += 1; |
---|
1499 | | - aConstraints.gridwidth = 1; |
---|
| 1669 | + cGridBag anisoU = new cGridBag(); |
---|
| 1670 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1671 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1672 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1673 | + colorSection.add(anisoU); |
---|
1500 | 1674 | |
---|
1501 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1502 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1503 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1504 | | - aConstraints.gridx += 1; |
---|
1505 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1506 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1507 | | - aConstraints.gridx = 0; |
---|
1508 | | - aConstraints.gridy += 1; |
---|
1509 | | - aConstraints.gridwidth = 1; |
---|
| 1675 | + cGridBag anisoV = new cGridBag(); |
---|
| 1676 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1677 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1678 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1679 | + colorSection.add(anisoV); |
---|
1510 | 1680 | |
---|
1511 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1512 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1513 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1514 | | - aConstraints.gridx += 1; |
---|
1515 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1516 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1517 | | - aConstraints.gridx = 0; |
---|
1518 | | - aConstraints.gridy += 1; |
---|
1519 | | - aConstraints.gridwidth = 1; |
---|
| 1681 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1682 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1683 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1684 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1685 | + colorSection.add(shadowbias); |
---|
1520 | 1686 | |
---|
1521 | | - //aConstraints.weighty = 1; |
---|
1522 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1523 | | - //aConstraints.gridx += 1; |
---|
1524 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1525 | | - aConstraints.weighty = 0; |
---|
1526 | | - aConstraints.gridx = 0; |
---|
1527 | | - aConstraints.gridy += 1; |
---|
1528 | | - aConstraints.gridwidth = 1; |
---|
| 1687 | + panel.add(new JSeparator()); |
---|
| 1688 | + |
---|
| 1689 | + panel.add(colorSection); |
---|
| 1690 | + |
---|
| 1691 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1692 | + |
---|
| 1693 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 1694 | + |
---|
| 1695 | + cGridBag diffuse = new cGridBag(); |
---|
| 1696 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 1697 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1698 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1699 | + diffuseSection.add(diffuse); |
---|
1529 | 1700 | |
---|
1530 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1531 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1532 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1533 | | - aConstraints.gridx += 1; |
---|
1534 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1535 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1536 | | - aConstraints.gridx = 0; |
---|
1537 | | - aConstraints.gridy += 1; |
---|
1538 | | - aConstraints.gridwidth = 1; |
---|
| 1701 | + cGridBag diffuseness = new cGridBag(); |
---|
| 1702 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 1703 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1704 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1705 | + diffuseSection.add(diffuseness); |
---|
1539 | 1706 | |
---|
1540 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1541 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1542 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1543 | | - aConstraints.gridx += 1; |
---|
1544 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1545 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1546 | | - aConstraints.gridx = 0; |
---|
1547 | | - aConstraints.gridy += 1; |
---|
1548 | | - aConstraints.gridwidth = 1; |
---|
| 1707 | + cGridBag selfshadow = new cGridBag(); |
---|
| 1708 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 1709 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1710 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1711 | + diffuseSection.add(selfshadow); |
---|
1549 | 1712 | |
---|
1550 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1551 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1552 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1553 | | - aConstraints.gridx += 1; |
---|
1554 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1555 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1556 | | - aConstraints.gridx = 0; |
---|
1557 | | - aConstraints.gridy += 1; |
---|
1558 | | - aConstraints.gridwidth = 1; |
---|
| 1713 | + cGridBag sheen = new cGridBag(); |
---|
| 1714 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 1715 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1716 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1717 | + diffuseSection.add(sheen); |
---|
1559 | 1718 | |
---|
1560 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1561 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1562 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1563 | | - aConstraints.gridx += 1; |
---|
1564 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1565 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1566 | | - aConstraints.gridx = 0; |
---|
1567 | | - aConstraints.gridy += 1; |
---|
1568 | | - aConstraints.gridwidth = 1; |
---|
| 1719 | + cGridBag subsurface = new cGridBag(); |
---|
| 1720 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 1721 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1722 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1723 | + diffuseSection.add(subsurface); |
---|
1569 | 1724 | |
---|
1570 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1571 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1572 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1573 | | - aConstraints.gridx += 1; |
---|
1574 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1575 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1576 | | - aConstraints.gridx = 0; |
---|
1577 | | - aConstraints.gridy += 1; |
---|
1578 | | - aConstraints.gridwidth = 1; |
---|
| 1725 | + cGridBag shadow = new cGridBag(); |
---|
| 1726 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 1727 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1728 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1729 | + diffuseSection.add(shadow); |
---|
1579 | 1730 | |
---|
1580 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1581 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1582 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1583 | | - aConstraints.gridx += 1; |
---|
1584 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1585 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1586 | | - aConstraints.gridx = 0; |
---|
1587 | | - aConstraints.gridy += 1; |
---|
1588 | | - aConstraints.gridwidth = 1; |
---|
| 1731 | + cGridBag fakedepth = new cGridBag(); |
---|
| 1732 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 1733 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1734 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1735 | + diffuseSection.add(fakedepth); |
---|
1589 | 1736 | |
---|
1590 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1591 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1592 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1593 | | - aConstraints.gridx += 1; |
---|
1594 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1595 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1596 | | - aConstraints.gridx = 0; |
---|
1597 | | - aConstraints.gridy += 1; |
---|
1598 | | - aConstraints.gridwidth = 1; |
---|
| 1737 | + panel.add(new JSeparator()); |
---|
| 1738 | + |
---|
| 1739 | + panel.add(diffuseSection); |
---|
| 1740 | + |
---|
| 1741 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1742 | + |
---|
| 1743 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1599 | 1744 | |
---|
1600 | | - //aConstraints.weighty = 1; |
---|
1601 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1602 | | - //aConstraints.gridx += 1; |
---|
1603 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1604 | | - aConstraints.weighty = 0; |
---|
1605 | | - aConstraints.gridx = 0; |
---|
1606 | | - aConstraints.gridy += 1; |
---|
1607 | | - aConstraints.gridwidth = 1; |
---|
| 1745 | + cGridBag specular = new cGridBag(); |
---|
| 1746 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 1747 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1748 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1749 | + specularSection.add(specular); |
---|
1608 | 1750 | |
---|
1609 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1610 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1611 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1612 | | - aConstraints.gridx += 1; |
---|
1613 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1614 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1615 | | - aConstraints.gridx = 0; |
---|
1616 | | - aConstraints.gridy += 1; |
---|
1617 | | - aConstraints.gridwidth = 1; |
---|
| 1751 | + cGridBag lightarea = new cGridBag(); |
---|
| 1752 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 1753 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1754 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1755 | + specularSection.add(lightarea); |
---|
1618 | 1756 | |
---|
1619 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1620 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1621 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1622 | | - aConstraints.gridx += 1; |
---|
1623 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1624 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1625 | | - aConstraints.gridx = 0; |
---|
1626 | | - aConstraints.gridy += 1; |
---|
1627 | | - aConstraints.gridwidth = 1; |
---|
| 1757 | + cGridBag shininess = new cGridBag(); |
---|
| 1758 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 1759 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1760 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1761 | + specularSection.add(shininess); |
---|
1628 | 1762 | |
---|
1629 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1630 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1631 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1632 | | - aConstraints.gridx += 1; |
---|
1633 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1634 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1635 | | - aConstraints.gridx = 0; |
---|
1636 | | - aConstraints.gridy += 1; |
---|
1637 | | - aConstraints.gridwidth = 1; |
---|
| 1763 | + cGridBag metalness = new cGridBag(); |
---|
| 1764 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 1765 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1766 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1767 | + specularSection.add(metalness); |
---|
1638 | 1768 | |
---|
1639 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1640 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1641 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1642 | | - aConstraints.gridx += 1; |
---|
1643 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1644 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1645 | | - aConstraints.gridx = 0; |
---|
1646 | | - aConstraints.gridy += 1; |
---|
1647 | | - aConstraints.gridwidth = 1; |
---|
| 1769 | + cGridBag velvet = new cGridBag(); |
---|
| 1770 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 1771 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1772 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1773 | + specularSection.add(velvet); |
---|
1648 | 1774 | |
---|
1649 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1650 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1651 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1652 | | - aConstraints.gridx += 1; |
---|
1653 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1654 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1655 | | - aConstraints.gridx = 0; |
---|
1656 | | - aConstraints.gridy += 1; |
---|
1657 | | - aConstraints.gridwidth = 1; |
---|
1658 | | - |
---|
1659 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1660 | | - Return(); |
---|
| 1775 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1776 | + //Return(); |
---|
1661 | 1777 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1662 | 1778 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1663 | 1779 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1668 | 1784 | // aConstraints.gridy += 1; |
---|
1669 | 1785 | // aConstraints.gridwidth = 1; |
---|
1670 | 1786 | |
---|
1671 | | - //aConstraints.weighty = 1; |
---|
1672 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1673 | | - //aConstraints.gridx += 1; |
---|
1674 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1675 | | - aConstraints.weighty = 0; |
---|
1676 | | - aConstraints.gridx = 0; |
---|
1677 | | - aConstraints.gridy += 1; |
---|
1678 | | - aConstraints.gridwidth = 1; |
---|
1679 | 1787 | |
---|
1680 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1681 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1682 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1683 | | - aConstraints.gridx += 1; |
---|
1684 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1685 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1686 | | - aConstraints.gridx = 0; |
---|
1687 | | - aConstraints.gridy += 1; |
---|
1688 | | - aConstraints.gridwidth = 1; |
---|
| 1788 | + panel.add(new JSeparator()); |
---|
| 1789 | + |
---|
| 1790 | + panel.add(specularSection); |
---|
| 1791 | + |
---|
| 1792 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1793 | + |
---|
| 1794 | + cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1689 | 1795 | |
---|
1690 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1691 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1692 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1693 | | - aConstraints.gridx += 1; |
---|
1694 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1695 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1696 | | - aConstraints.gridx = 0; |
---|
1697 | | - aConstraints.gridy += 1; |
---|
1698 | | - aConstraints.gridwidth = 1; |
---|
| 1796 | + cGridBag camera = new cGridBag(); |
---|
| 1797 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 1798 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1799 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1800 | + globalSection.add(camera); |
---|
1699 | 1801 | |
---|
1700 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1701 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1702 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1703 | | - aConstraints.gridx += 1; |
---|
1704 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1705 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1706 | | - aConstraints.gridx = 0; |
---|
1707 | | - aConstraints.gridy += 1; |
---|
1708 | | - aConstraints.gridwidth = 1; |
---|
| 1802 | + cGridBag ambient = new cGridBag(); |
---|
| 1803 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 1804 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1805 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1806 | + globalSection.add(ambient); |
---|
1709 | 1807 | |
---|
1710 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1711 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1712 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1713 | | - aConstraints.gridx += 1; |
---|
1714 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1715 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1716 | | - aConstraints.gridx = 0; |
---|
1717 | | - aConstraints.gridy += 1; |
---|
1718 | | - aConstraints.gridwidth = 1; |
---|
1719 | | - aConstraints.weighty = 0; |
---|
| 1808 | + cGridBag backlit = new cGridBag(); |
---|
| 1809 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 1810 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1811 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1812 | + globalSection.add(backlit); |
---|
1720 | 1813 | |
---|
1721 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1722 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1723 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1724 | | - aConstraints.gridx += 1; |
---|
1725 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1726 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1727 | | - aConstraints.gridx = 0; |
---|
1728 | | - aConstraints.gridy += 1; |
---|
1729 | | - aConstraints.gridwidth = 1; |
---|
| 1814 | + cGridBag opacity = new cGridBag(); |
---|
| 1815 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1816 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1817 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1818 | + globalSection.add(opacity); |
---|
1730 | 1819 | |
---|
1731 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1732 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1733 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1734 | | - aConstraints.gridx += 1; |
---|
1735 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1736 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1737 | | - aConstraints.gridx = 0; |
---|
1738 | | - aConstraints.gridy += 1; |
---|
1739 | | - aConstraints.gridwidth = 1; |
---|
| 1820 | + panel.add(new JSeparator()); |
---|
| 1821 | + |
---|
| 1822 | + panel.add(globalSection); |
---|
| 1823 | + |
---|
| 1824 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1825 | + |
---|
| 1826 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1740 | 1827 | |
---|
1741 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1742 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1743 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1744 | | - aConstraints.gridx += 1; |
---|
1745 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1746 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1747 | | - aConstraints.gridx = 0; |
---|
1748 | | - aConstraints.gridy += 1; |
---|
1749 | | - aConstraints.gridwidth = 1; |
---|
| 1828 | + cGridBag bump = new cGridBag(); |
---|
| 1829 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 1830 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1831 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1832 | + textureSection.add(bump); |
---|
1750 | 1833 | |
---|
1751 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1752 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1753 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1754 | | - aConstraints.gridx += 1; |
---|
1755 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1756 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1757 | | - aConstraints.gridx = 0; |
---|
1758 | | - aConstraints.gridy += 1; |
---|
1759 | | - aConstraints.gridwidth = 1; |
---|
| 1834 | + cGridBag noise = new cGridBag(); |
---|
| 1835 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 1836 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1837 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 1838 | + textureSection.add(noise); |
---|
1760 | 1839 | |
---|
1761 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1762 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1763 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1764 | | - aConstraints.gridx += 1; |
---|
1765 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1766 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1767 | | - aConstraints.gridx = 0; |
---|
1768 | | - aConstraints.gridy += 1; |
---|
1769 | | - aConstraints.gridwidth = 1; |
---|
| 1840 | + cGridBag power = new cGridBag(); |
---|
| 1841 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 1842 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1843 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 1844 | + textureSection.add(power); |
---|
1770 | 1845 | |
---|
1771 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1772 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1773 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1774 | | - aConstraints.gridx += 1; |
---|
1775 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1776 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1777 | | - aConstraints.gridx = 0; |
---|
1778 | | - aConstraints.gridy += 1; |
---|
1779 | | - aConstraints.gridwidth = 1; |
---|
| 1846 | + cGridBag borderfade = new cGridBag(); |
---|
| 1847 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 1848 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1849 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1850 | + textureSection.add(borderfade); |
---|
1780 | 1851 | |
---|
1781 | | - //aConstraints.weighty = 1; |
---|
1782 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1783 | | - //aConstraints.gridx += 1; |
---|
1784 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1785 | | - aConstraints.weighty = 0; |
---|
| 1852 | + cGridBag fog = new cGridBag(); |
---|
| 1853 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 1854 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1855 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 1856 | + textureSection.add(fog); |
---|
1786 | 1857 | |
---|
1787 | | - aConstraints.gridx = 0; |
---|
1788 | | - aConstraints.gridy = 0; |
---|
1789 | | - aConstraints.gridwidth = 1; |
---|
| 1858 | + cGridBag opacityPower = new cGridBag(); |
---|
| 1859 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 1860 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1861 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 1862 | + textureSection.add(opacityPower); |
---|
| 1863 | + |
---|
| 1864 | + panel.add(new JSeparator()); |
---|
| 1865 | + |
---|
| 1866 | + panel.add(textureSection); |
---|
| 1867 | + |
---|
| 1868 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1790 | 1869 | |
---|
1791 | 1870 | SetMaterial(copy); // .GetMaterial()); |
---|
1792 | 1871 | |
---|
1793 | | - colorField.addChangeListener(this); |
---|
1794 | | - modulationField.addChangeListener(this); |
---|
| 1872 | + //colorField.addChangeListener(this); |
---|
| 1873 | +// modulationField.addChangeListener(this); |
---|
1795 | 1874 | metalnessField.addChangeListener(this); |
---|
1796 | 1875 | diffuseField.addChangeListener(this); |
---|
1797 | 1876 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1821 | 1900 | opacityPowerField.addChangeListener(this); |
---|
1822 | 1901 | /**/ |
---|
1823 | 1902 | |
---|
1824 | | - resetSlidersButton.addActionListener(this); |
---|
1825 | 1903 | clearMaterialButton.addActionListener(this); |
---|
1826 | 1904 | createMaterialButton.addActionListener(this); |
---|
1827 | | - |
---|
1828 | | - propagateToggle.addItemListener(this); |
---|
1829 | | - multiplyToggle.addItemListener(this); |
---|
| 1905 | + |
---|
| 1906 | + if (Globals.ADVANCED) |
---|
| 1907 | + { |
---|
| 1908 | + resetSlidersButton.addActionListener(this); |
---|
| 1909 | + propagateToggle.addItemListener(this); |
---|
| 1910 | + multiplyToggle.addItemListener(this); |
---|
| 1911 | + } |
---|
1830 | 1912 | } |
---|
1831 | 1913 | |
---|
1832 | 1914 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1997 | 2079 | |
---|
1998 | 2080 | //? flashIt = false; |
---|
1999 | 2081 | CameraPane pane = (CameraPane) cameraView; |
---|
2000 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2082 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
2001 | 2083 | pane.clickEnd(location.x, location.y, 0, true); |
---|
2002 | 2084 | |
---|
2003 | 2085 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2046 | 2128 | e2.printStackTrace(); |
---|
2047 | 2129 | } |
---|
2048 | 2130 | } |
---|
| 2131 | + |
---|
2049 | 2132 | LoadJMEThread loadThread; |
---|
2050 | 2133 | |
---|
2051 | 2134 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2103 | 2186 | //LoadFile0(filename, converter); |
---|
2104 | 2187 | } |
---|
2105 | 2188 | } |
---|
| 2189 | + |
---|
2106 | 2190 | LoadOBJThread loadObjThread; |
---|
2107 | 2191 | |
---|
2108 | 2192 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2181 | 2265 | |
---|
2182 | 2266 | void LoadObjFile(String fullname) |
---|
2183 | 2267 | { |
---|
2184 | | - /* |
---|
| 2268 | + System.out.println("Loading " + fullname); |
---|
| 2269 | + /**/ |
---|
2185 | 2270 | //lastFilename = fullname; |
---|
2186 | 2271 | if(loadObjThread == null) |
---|
2187 | 2272 | { |
---|
2188 | | - loadObjThread = new LoadOBJThread(); |
---|
2189 | | - loadObjThread.start(); |
---|
| 2273 | + loadObjThread = new LoadOBJThread(); |
---|
| 2274 | + loadObjThread.start(); |
---|
2190 | 2275 | } |
---|
2191 | 2276 | |
---|
2192 | 2277 | loadObjThread.add(fullname); |
---|
2193 | | - */ |
---|
| 2278 | + /**/ |
---|
2194 | 2279 | |
---|
2195 | | - System.out.println("Loading " + fullname); |
---|
2196 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2280 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2197 | 2281 | } |
---|
2198 | 2282 | |
---|
2199 | 2283 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2454 | 2538 | |
---|
2455 | 2539 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2456 | 2540 | { |
---|
2457 | | - if (GrafreeD.standAlone) |
---|
| 2541 | + if (Grafreed.standAlone) |
---|
2458 | 2542 | { |
---|
2459 | 2543 | /**/ |
---|
2460 | 2544 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2461 | | - browser.show(); |
---|
| 2545 | + browser.setVisible(true); |
---|
2462 | 2546 | String filename = browser.getFile(); |
---|
2463 | 2547 | if (filename != null && filename.length() > 0) |
---|
2464 | 2548 | { |
---|
.. | .. |
---|
2603 | 2687 | } |
---|
2604 | 2688 | if (input == null) |
---|
2605 | 2689 | { |
---|
| 2690 | + new Exception().printStackTrace(); |
---|
2606 | 2691 | System.exit(0); |
---|
2607 | 2692 | } |
---|
2608 | 2693 | |
---|
.. | .. |
---|
2809 | 2894 | |
---|
2810 | 2895 | void SetMaterial(Object3D object) |
---|
2811 | 2896 | { |
---|
| 2897 | + latestObject = object; |
---|
| 2898 | + |
---|
2812 | 2899 | cMaterial mat = object.material; |
---|
2813 | 2900 | |
---|
2814 | 2901 | if (mat == null) |
---|
.. | .. |
---|
2817 | 2904 | return; |
---|
2818 | 2905 | } |
---|
2819 | 2906 | |
---|
2820 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2907 | + if (multiplyToggle != null) |
---|
| 2908 | + multiplyToggle.setSelected(mat.multiply); |
---|
2821 | 2909 | |
---|
2822 | 2910 | assert (object.projectedVertices != null); |
---|
2823 | 2911 | |
---|
.. | .. |
---|
2993 | 3081 | cameraView.ToggleDL(); |
---|
2994 | 3082 | cameraView.repaint(); |
---|
2995 | 3083 | return; |
---|
2996 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3084 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2997 | 3085 | { |
---|
2998 | 3086 | cameraView.ToggleTexture(); |
---|
2999 | 3087 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
3032 | 3120 | frame.validate(); |
---|
3033 | 3121 | |
---|
3034 | 3122 | return; |
---|
3035 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3123 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
3036 | 3124 | { |
---|
3037 | | - cameraView.ToggleRandom(); |
---|
| 3125 | + cameraView.ToggleSwitch(); |
---|
3038 | 3126 | cameraView.repaint(); |
---|
3039 | 3127 | return; |
---|
3040 | 3128 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3063 | 3151 | { |
---|
3064 | 3152 | copy.live ^= true; |
---|
3065 | 3153 | return; |
---|
| 3154 | + } else if (event.getSource() == selectCB) |
---|
| 3155 | + { |
---|
| 3156 | + copy.dontselect ^= true; |
---|
| 3157 | + return; |
---|
3066 | 3158 | } else if (event.getSource() == hideCB) |
---|
3067 | 3159 | { |
---|
3068 | 3160 | copy.hide ^= true; |
---|
.. | .. |
---|
3077 | 3169 | if (event.getSource() == randomCB) |
---|
3078 | 3170 | { |
---|
3079 | 3171 | copy.random ^= true; |
---|
| 3172 | + objEditor.refreshContents(); |
---|
3080 | 3173 | return; |
---|
3081 | 3174 | } |
---|
3082 | 3175 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3100 | 3193 | |
---|
3101 | 3194 | public void actionPerformed(ActionEvent event) |
---|
3102 | 3195 | { |
---|
| 3196 | + Object source = event.getSource(); |
---|
3103 | 3197 | // SCRIPT DIALOG |
---|
3104 | | - if (event.getSource() == okbutton) |
---|
| 3198 | + if (source == okbutton) |
---|
3105 | 3199 | { |
---|
3106 | 3200 | textpanel.setVisible(false); |
---|
3107 | 3201 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3113 | 3207 | textarea = null; |
---|
3114 | 3208 | textpanel = null; |
---|
3115 | 3209 | } |
---|
3116 | | - if (event.getSource() == cancelbutton) |
---|
| 3210 | + if (source == cancelbutton) |
---|
3117 | 3211 | { |
---|
3118 | 3212 | textpanel.setVisible(false); |
---|
3119 | 3213 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3125 | 3219 | //applySelf(); |
---|
3126 | 3220 | //client.refreshEditWindow(); |
---|
3127 | 3221 | //refreshContents(); |
---|
3128 | | - if (event.getSource() == nameField) |
---|
| 3222 | + if (source == nameField) |
---|
3129 | 3223 | { |
---|
3130 | 3224 | //System.out.println("ObjEditor " + event); |
---|
3131 | 3225 | applySelf0(true); |
---|
3132 | 3226 | //parent.applySelf(); |
---|
3133 | 3227 | objEditor.refreshContents(); |
---|
3134 | | - } else if (event.getSource() == resetButton) |
---|
| 3228 | + } else if (source == resetButton) |
---|
3135 | 3229 | { |
---|
3136 | 3230 | CameraPane.fullreset = true; |
---|
3137 | 3231 | copy.Reset(); // ResetMeshes(); |
---|
3138 | 3232 | copy.Touch(); |
---|
3139 | 3233 | objEditor.refreshContents(); |
---|
3140 | | - } else if (event.getSource() == stepItem) |
---|
| 3234 | + } else if (source == stepItem) |
---|
3141 | 3235 | { |
---|
3142 | 3236 | //cameraView.ONESTEP = true; |
---|
3143 | 3237 | Globals.ONESTEP = true; |
---|
3144 | 3238 | cameraView.repaint(); |
---|
3145 | 3239 | return; |
---|
3146 | | - } else if (event.getSource() == stepButton) |
---|
| 3240 | + } else if (source == stepButton) |
---|
3147 | 3241 | { |
---|
3148 | 3242 | copy.Step(); |
---|
3149 | 3243 | copy.Touch(); |
---|
3150 | 3244 | objEditor.refreshContents(); |
---|
3151 | | - } else if (event.getSource() == slowerButton) |
---|
| 3245 | + } else if (source == slowerButton) |
---|
3152 | 3246 | { |
---|
3153 | 3247 | copy.Slower(); |
---|
3154 | 3248 | copy.Touch(); |
---|
3155 | 3249 | objEditor.refreshContents(); |
---|
3156 | | - } else if (event.getSource() == fasterButton) |
---|
| 3250 | + } else if (source == fasterButton) |
---|
3157 | 3251 | { |
---|
3158 | 3252 | copy.Faster(); |
---|
3159 | 3253 | copy.Touch(); |
---|
3160 | 3254 | objEditor.refreshContents(); |
---|
3161 | | - } else if (event.getSource() == remarkButton) |
---|
| 3255 | + } else if (source == remarkButton) |
---|
3162 | 3256 | { |
---|
3163 | 3257 | copy.Remark(); |
---|
3164 | 3258 | copy.Touch(); |
---|
3165 | 3259 | objEditor.refreshContents(); |
---|
3166 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3260 | + } else if (source == stepAllButton) |
---|
3167 | 3261 | { |
---|
3168 | 3262 | copy.StepAll(); |
---|
3169 | 3263 | copy.Touch(); |
---|
3170 | 3264 | objEditor.refreshContents(); |
---|
3171 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3265 | + } else if (source == resetAllButton) |
---|
3172 | 3266 | { |
---|
3173 | 3267 | //CameraPane.fullreset = true; |
---|
3174 | 3268 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3201 | 3295 | // Close(); |
---|
3202 | 3296 | // } |
---|
3203 | 3297 | // else |
---|
3204 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3298 | + if (source == resetSlidersButton) |
---|
3205 | 3299 | { |
---|
3206 | 3300 | ResetSliders(); |
---|
3207 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3301 | + } else if (source == clearMaterialButton) |
---|
3208 | 3302 | { |
---|
3209 | 3303 | ClearMaterial(); |
---|
3210 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3304 | + } else if (source == createMaterialButton) |
---|
3211 | 3305 | { |
---|
3212 | 3306 | CreateMaterial(); |
---|
3213 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3307 | + } else if (source == clearPanelButton) |
---|
3214 | 3308 | { |
---|
3215 | 3309 | copy.ClearUI(); |
---|
3216 | 3310 | refreshContents(true); |
---|
3217 | | - } /* |
---|
3218 | | - } |
---|
3219 | | - |
---|
3220 | | - public boolean action(Event event, Object arg) |
---|
3221 | | - { |
---|
3222 | | - */ else if (event.getSource() == closeItem) |
---|
| 3311 | + } else if (source == importGFDItem) |
---|
| 3312 | + { |
---|
| 3313 | + ImportGFD(); |
---|
| 3314 | + } else |
---|
| 3315 | + if (source == importVRMLX3DItem) |
---|
| 3316 | + { |
---|
| 3317 | + ImportVRMLX3D(); |
---|
| 3318 | + } else |
---|
| 3319 | + if (source == import3DSItem) |
---|
| 3320 | + { |
---|
| 3321 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3322 | + } else |
---|
| 3323 | + if (source == importOBJItem) |
---|
| 3324 | + { |
---|
| 3325 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3326 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3327 | + browser.setVisible(true); |
---|
| 3328 | + String filename = browser.getFile(); |
---|
| 3329 | + if (filename != null && filename.length() > 0) |
---|
| 3330 | + { |
---|
| 3331 | + String fullname = browser.getDirectory() + filename; |
---|
| 3332 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3333 | + } |
---|
| 3334 | + } else |
---|
| 3335 | + if (source == closeItem) |
---|
3223 | 3336 | { |
---|
3224 | 3337 | Close(); |
---|
3225 | 3338 | //return true; |
---|
3226 | | - } else if (event.getSource() == loadItem) |
---|
| 3339 | + } else if (source == loadItem) |
---|
3227 | 3340 | { |
---|
3228 | 3341 | load(); |
---|
3229 | 3342 | //return true; |
---|
3230 | | - } else if (event.getSource() == saveItem) |
---|
| 3343 | + } else if (source == newItem) |
---|
| 3344 | + { |
---|
| 3345 | + New(); |
---|
| 3346 | + } else if (source == saveItem) |
---|
3231 | 3347 | { |
---|
3232 | 3348 | save(); |
---|
3233 | 3349 | //return true; |
---|
3234 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3350 | + } else if (source == saveAsItem) |
---|
3235 | 3351 | { |
---|
3236 | 3352 | saveAs(); |
---|
3237 | 3353 | //return true; |
---|
3238 | | - } else if (event.getSource() == reexportItem) |
---|
| 3354 | + } else if (source == reexportItem) |
---|
3239 | 3355 | { |
---|
3240 | 3356 | reexport(); |
---|
3241 | 3357 | //return true; |
---|
3242 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3358 | + } else if (source == exportAsItem) |
---|
3243 | 3359 | { |
---|
3244 | 3360 | export(); |
---|
3245 | 3361 | //return true; |
---|
3246 | | - } else if (event.getSource() == povItem) |
---|
| 3362 | + } else if (source == povItem) |
---|
3247 | 3363 | { |
---|
3248 | 3364 | generatePOV(); |
---|
3249 | 3365 | //return true; |
---|
3250 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3366 | + } else if (source == zBufferItem) |
---|
3251 | 3367 | { |
---|
3252 | 3368 | try |
---|
3253 | 3369 | { |
---|
.. | .. |
---|
3269 | 3385 | cameraView.repaint(); |
---|
3270 | 3386 | //return true; |
---|
3271 | 3387 | } |
---|
3272 | | - */ else if (event.getSource() == editCameraItem) |
---|
3273 | | - { |
---|
3274 | | - cameraView.ProtectCamera(); |
---|
3275 | | - cameraView.repaint(); |
---|
3276 | | - return; |
---|
3277 | | - } else if (event.getSource() == revertCameraItem) |
---|
3278 | | - { |
---|
3279 | | - cameraView.RevertCamera(); |
---|
3280 | | - cameraView.repaint(); |
---|
3281 | | - return; |
---|
3282 | | -// } else if (event.getSource() == textureButton) |
---|
3283 | | -// { |
---|
3284 | | -// return; // true; |
---|
3285 | | - } else // combos... |
---|
3286 | | - if (event.getSource() == texresMenu) |
---|
| 3388 | + */ else // combos... |
---|
| 3389 | + if (source == texresMenu) |
---|
3287 | 3390 | { |
---|
3288 | 3391 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3289 | 3392 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3295 | 3398 | } |
---|
3296 | 3399 | } |
---|
3297 | 3400 | |
---|
3298 | | - void ToggleAnimation() |
---|
| 3401 | + void New() |
---|
3299 | 3402 | { |
---|
3300 | | - if (!CameraPane.ANIMATION) |
---|
| 3403 | + while (copy.Size() > 1) |
---|
3301 | 3404 | { |
---|
3302 | | - FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3405 | + copy.remove(1); |
---|
| 3406 | + } |
---|
| 3407 | + |
---|
| 3408 | + ResetModel(); |
---|
| 3409 | + objEditor.refreshContents(); |
---|
| 3410 | + } |
---|
| 3411 | + |
---|
| 3412 | + static public byte[] Compress(Object3D o) |
---|
| 3413 | + { |
---|
| 3414 | + try |
---|
| 3415 | + { |
---|
| 3416 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3417 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3418 | + ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 3419 | + |
---|
| 3420 | + Object3D parent = o.parent; |
---|
| 3421 | + o.parent = null; |
---|
| 3422 | + |
---|
| 3423 | + out.writeObject(o); |
---|
| 3424 | + |
---|
| 3425 | + o.parent = parent; |
---|
| 3426 | + |
---|
| 3427 | + out.flush(); |
---|
| 3428 | + |
---|
| 3429 | + zstream.close(); |
---|
| 3430 | + out.close(); |
---|
| 3431 | + |
---|
| 3432 | + return baos.toByteArray(); |
---|
| 3433 | + } catch (Exception e) |
---|
| 3434 | + { |
---|
| 3435 | + System.err.println(e); |
---|
| 3436 | + return null; |
---|
| 3437 | + } |
---|
| 3438 | + } |
---|
| 3439 | + |
---|
| 3440 | + static public Object Uncompress(byte[] bytes) |
---|
| 3441 | + { |
---|
| 3442 | + System.out.println("#bytes = " + bytes.length); |
---|
| 3443 | + try |
---|
| 3444 | + { |
---|
| 3445 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3446 | + java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3447 | + ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 3448 | + Object obj = in.readObject(); |
---|
| 3449 | + in.close(); |
---|
| 3450 | + |
---|
| 3451 | + return obj; |
---|
| 3452 | + } catch (Exception e) |
---|
| 3453 | + { |
---|
| 3454 | + System.err.println(e); |
---|
| 3455 | + return null; |
---|
| 3456 | + } |
---|
| 3457 | + } |
---|
| 3458 | + |
---|
| 3459 | + static public Object clone(Object o) |
---|
| 3460 | + { |
---|
| 3461 | + try |
---|
| 3462 | + { |
---|
| 3463 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3464 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3465 | + |
---|
| 3466 | + out.writeObject(o); |
---|
| 3467 | + |
---|
| 3468 | + out.flush(); |
---|
| 3469 | + out.close(); |
---|
| 3470 | + |
---|
| 3471 | + byte[] bytes = baos.toByteArray(); |
---|
| 3472 | + |
---|
| 3473 | + System.out.println("clone = " + bytes.length); |
---|
| 3474 | + |
---|
| 3475 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3476 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3477 | + Object obj = in.readObject(); |
---|
| 3478 | + in.close(); |
---|
| 3479 | + |
---|
| 3480 | + return obj; |
---|
| 3481 | + } catch (Exception e) |
---|
| 3482 | + { |
---|
| 3483 | + System.err.println(e); |
---|
| 3484 | + return null; |
---|
| 3485 | + } |
---|
| 3486 | + } |
---|
| 3487 | + |
---|
| 3488 | + cRadio GetCurrentTab() |
---|
| 3489 | + { |
---|
| 3490 | + cRadio ab; |
---|
| 3491 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3492 | + { |
---|
| 3493 | + ab = (cRadio)e.nextElement(); |
---|
| 3494 | + if(ab.GetObject() == copy) |
---|
| 3495 | + { |
---|
| 3496 | + return ab; |
---|
| 3497 | + } |
---|
| 3498 | + } |
---|
| 3499 | + |
---|
| 3500 | + return null; |
---|
| 3501 | + } |
---|
| 3502 | + |
---|
| 3503 | + java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3504 | + |
---|
| 3505 | + public void Save() |
---|
| 3506 | + { |
---|
| 3507 | + System.err.println("Save"); |
---|
| 3508 | + |
---|
| 3509 | + cRadio tab = GetCurrentTab(); |
---|
| 3510 | + |
---|
| 3511 | + boolean temp = CameraPane.SWITCH; |
---|
| 3512 | + CameraPane.SWITCH = false; |
---|
| 3513 | + |
---|
| 3514 | + copy.ExtractBigData(hashtable); |
---|
| 3515 | + |
---|
| 3516 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3517 | + tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3518 | + |
---|
| 3519 | + copy.RestoreBigData(hashtable); |
---|
| 3520 | + |
---|
| 3521 | + CameraPane.SWITCH = temp; |
---|
| 3522 | + |
---|
| 3523 | + //assert(hashtable.isEmpty()); |
---|
| 3524 | + |
---|
| 3525 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3526 | + { |
---|
| 3527 | + tab.graphs[i] = null; |
---|
| 3528 | + } |
---|
| 3529 | + |
---|
| 3530 | + // test save |
---|
| 3531 | + if (false) |
---|
| 3532 | + { |
---|
| 3533 | + try |
---|
| 3534 | + { |
---|
| 3535 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3536 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3537 | + |
---|
| 3538 | + p.writeObject(copy); |
---|
| 3539 | + |
---|
| 3540 | + p.flush(); |
---|
| 3541 | + |
---|
| 3542 | + ostream.close(); |
---|
| 3543 | + } catch (Exception e) |
---|
| 3544 | + { |
---|
| 3545 | + e.printStackTrace(); |
---|
| 3546 | + } |
---|
| 3547 | + } |
---|
| 3548 | + } |
---|
| 3549 | + |
---|
| 3550 | + void CopyChanged(Object3D obj) |
---|
| 3551 | + { |
---|
| 3552 | + boolean temp = CameraPane.SWITCH; |
---|
| 3553 | + CameraPane.SWITCH = false; |
---|
| 3554 | + |
---|
| 3555 | + copy.ExtractBigData(hashtable); |
---|
| 3556 | + |
---|
| 3557 | + copy.clear(); |
---|
| 3558 | + |
---|
| 3559 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3560 | + { |
---|
| 3561 | + copy.add(obj.get(i)); |
---|
| 3562 | + } |
---|
| 3563 | + |
---|
| 3564 | + copy.RestoreBigData(hashtable); |
---|
| 3565 | + |
---|
| 3566 | + CameraPane.SWITCH = temp; |
---|
| 3567 | + |
---|
| 3568 | + //assert(hashtable.isEmpty()); |
---|
| 3569 | + |
---|
| 3570 | + copy.Touch(); |
---|
| 3571 | + |
---|
| 3572 | + ResetModel(); |
---|
| 3573 | + copy.HardTouch(); // recompile? |
---|
| 3574 | + |
---|
| 3575 | + cRadio ab; |
---|
| 3576 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3577 | + { |
---|
| 3578 | + ab = (cRadio)e.nextElement(); |
---|
| 3579 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3580 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3581 | + if (test != null) |
---|
| 3582 | + { |
---|
| 3583 | + test.editWindow = ab.object.editWindow; |
---|
| 3584 | + ab.object = test; |
---|
| 3585 | + } |
---|
| 3586 | + } |
---|
| 3587 | + |
---|
| 3588 | + refreshContents(); |
---|
| 3589 | + } |
---|
| 3590 | + |
---|
| 3591 | + public void Undo() |
---|
| 3592 | + { |
---|
| 3593 | + System.err.println("Undo"); |
---|
| 3594 | + |
---|
| 3595 | + cRadio tab = GetCurrentTab(); |
---|
| 3596 | + |
---|
| 3597 | + if (tab.undoindex == 0) |
---|
| 3598 | + { |
---|
| 3599 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3600 | + return; |
---|
| 3601 | + } |
---|
| 3602 | + |
---|
| 3603 | + if (tab.graphs[tab.undoindex] == null) |
---|
| 3604 | + { |
---|
| 3605 | + Save(); |
---|
| 3606 | + tab.undoindex -= 1; |
---|
| 3607 | + } |
---|
| 3608 | + |
---|
| 3609 | + tab.undoindex -= 1; |
---|
| 3610 | + |
---|
| 3611 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3612 | + } |
---|
| 3613 | + |
---|
| 3614 | + public void Redo() |
---|
| 3615 | + { |
---|
| 3616 | + cRadio tab = GetCurrentTab(); |
---|
| 3617 | + |
---|
| 3618 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3619 | + { |
---|
| 3620 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3621 | + return; |
---|
| 3622 | + } |
---|
| 3623 | + |
---|
| 3624 | + tab.undoindex += 1; |
---|
| 3625 | + |
---|
| 3626 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3627 | + } |
---|
| 3628 | + |
---|
| 3629 | + void ImportGFD() |
---|
| 3630 | + { |
---|
| 3631 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
3303 | 3632 | browser.show(); |
---|
3304 | 3633 | String filename = browser.getFile(); |
---|
3305 | 3634 | if (filename != null && filename.length() > 0) |
---|
3306 | 3635 | { |
---|
3307 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3636 | + String fullname = browser.getDirectory() + filename; |
---|
| 3637 | + |
---|
| 3638 | + //Object3D readobj = |
---|
| 3639 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3640 | + //makeSomething(readobj); |
---|
| 3641 | + } |
---|
| 3642 | + } |
---|
| 3643 | + |
---|
| 3644 | + void ImportVRMLX3D() |
---|
| 3645 | + { |
---|
| 3646 | + if (Grafreed.standAlone) |
---|
| 3647 | + { |
---|
| 3648 | + /**/ |
---|
| 3649 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3650 | + browser.show(); |
---|
| 3651 | + String filename = browser.getFile(); |
---|
| 3652 | + if (filename != null && filename.length() > 0) |
---|
| 3653 | + { |
---|
| 3654 | + String fullname = browser.getDirectory() + filename; |
---|
| 3655 | + LoadVRMLX3D(fullname); |
---|
| 3656 | + } |
---|
| 3657 | + /**/ |
---|
| 3658 | + } |
---|
| 3659 | + } |
---|
| 3660 | + |
---|
| 3661 | + void ToggleAnimation() |
---|
| 3662 | + { |
---|
| 3663 | + if (!Globals.ANIMATION) |
---|
| 3664 | + { |
---|
| 3665 | + FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3666 | + browser.setVisible(true); |
---|
| 3667 | + String filename = browser.getFile(); |
---|
| 3668 | + if (filename != null && filename.length() > 0) |
---|
| 3669 | + { |
---|
| 3670 | + Globals.filename = browser.getDirectory() + filename; |
---|
3308 | 3671 | //CameraPane.framecount = 0; |
---|
3309 | | - CameraPane.imagecount = 0; |
---|
| 3672 | + Globals.imagecount = 0; |
---|
3310 | 3673 | |
---|
3311 | | - CameraPane.ANIMATION ^= true; |
---|
| 3674 | + Globals.ANIMATION ^= true; |
---|
3312 | 3675 | |
---|
3313 | | - GrafreeD.wav.cursor = 0; |
---|
3314 | | - GrafreeD.wav.loop = 0; |
---|
| 3676 | + Grafreed.wav.cursor = 0; |
---|
| 3677 | + Grafreed.wav.loop = 0; |
---|
3315 | 3678 | } |
---|
3316 | 3679 | } else |
---|
3317 | 3680 | { |
---|
3318 | | - CameraPane.ANIMATION ^= true; |
---|
| 3681 | + Globals.ANIMATION ^= true; |
---|
3319 | 3682 | } |
---|
3320 | 3683 | } |
---|
3321 | 3684 | |
---|
.. | .. |
---|
3361 | 3724 | void CreateMaterial() |
---|
3362 | 3725 | { |
---|
3363 | 3726 | //copy.ClearMaterial(); // PATCH |
---|
3364 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3727 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3365 | 3728 | if (copy.selection.size() > 0) |
---|
3366 | 3729 | //SetMaterial(copy); |
---|
3367 | 3730 | { |
---|
.. | .. |
---|
3412 | 3775 | assert false; |
---|
3413 | 3776 | } |
---|
3414 | 3777 | |
---|
3415 | | - void EditSelection() |
---|
| 3778 | + void EditSelection(boolean newWindow) |
---|
3416 | 3779 | { |
---|
3417 | 3780 | } |
---|
3418 | 3781 | |
---|
.. | .. |
---|
3420 | 3783 | { |
---|
3421 | 3784 | copy.ResetBlockLoop(); // temporary problem |
---|
3422 | 3785 | |
---|
3423 | | - boolean random = CameraPane.RANDOM; |
---|
3424 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3786 | + boolean random = CameraPane.SWITCH; |
---|
| 3787 | + CameraPane.SWITCH = false; // parse everything |
---|
3425 | 3788 | copy.ResetDisplayList(); |
---|
3426 | 3789 | copy.HardTouch(); |
---|
3427 | | - CameraPane.RANDOM = random; |
---|
| 3790 | + CameraPane.SWITCH = random; |
---|
3428 | 3791 | } |
---|
3429 | 3792 | |
---|
3430 | 3793 | // public void applySelf() |
---|
.. | .. |
---|
3494 | 3857 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3495 | 3858 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3496 | 3859 | |
---|
3497 | | - if (!NumberSlider.frozen) |
---|
| 3860 | + if (!cNumberSlider.frozen) |
---|
3498 | 3861 | { |
---|
3499 | 3862 | //System.out.println("Propagate = " + propagate); |
---|
3500 | 3863 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 3864 | + |
---|
| 3865 | + if (copy.material != null) |
---|
| 3866 | + { |
---|
| 3867 | + cMaterial mat = copy.material; |
---|
| 3868 | + |
---|
| 3869 | + colorField.SetToolTipValue((mat.color)); |
---|
| 3870 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 3871 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 3872 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 3873 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 3874 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 3875 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 3876 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 3877 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 3878 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 3879 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 3880 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 3881 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 3882 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 3883 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 3884 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 3885 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 3886 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 3887 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 3888 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 3889 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 3890 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 3891 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 3892 | + } |
---|
| 3893 | + |
---|
3501 | 3894 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3502 | 3895 | { |
---|
3503 | 3896 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3542 | 3935 | || e.getSource() == apertureField |
---|
3543 | 3936 | || e.getSource() == shadowblurField) |
---|
3544 | 3937 | { |
---|
| 3938 | + new Exception().printStackTrace(); |
---|
3545 | 3939 | System.exit(0); |
---|
3546 | 3940 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3547 | 3941 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3612 | 4006 | } |
---|
3613 | 4007 | |
---|
3614 | 4008 | if (normalpushField != null) |
---|
3615 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 4009 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3616 | 4010 | } |
---|
3617 | 4011 | |
---|
3618 | 4012 | void SnapObject() |
---|
.. | .. |
---|
3867 | 4261 | |
---|
3868 | 4262 | radioPanel.revalidate(); |
---|
3869 | 4263 | radioPanel.repaint(); |
---|
3870 | | - ctrlPanel.revalidate(); // ? new |
---|
| 4264 | + ctrlPanel.validate(); // ? new |
---|
3871 | 4265 | ctrlPanel.repaint(); |
---|
3872 | 4266 | } |
---|
3873 | 4267 | } |
---|
.. | .. |
---|
3876 | 4270 | |
---|
3877 | 4271 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3878 | 4272 | { |
---|
| 4273 | + if (Globals.SAVEONMAKE) // && resetmodel) |
---|
| 4274 | + Save(); |
---|
3879 | 4275 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3880 | 4276 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3881 | 4277 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3962 | 4358 | { |
---|
3963 | 4359 | ResetModel(); |
---|
3964 | 4360 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4361 | + |
---|
| 4362 | + if (thing.Size() == 0) |
---|
| 4363 | + { |
---|
| 4364 | + //EditSelection(false); |
---|
| 4365 | + } |
---|
| 4366 | + |
---|
3965 | 4367 | refreshContents(); |
---|
3966 | 4368 | } |
---|
3967 | 4369 | |
---|
.. | .. |
---|
4079 | 4481 | } |
---|
4080 | 4482 | } |
---|
4081 | 4483 | } |
---|
| 4484 | + |
---|
4082 | 4485 | LoadGFDThread loadGFDThread; |
---|
4083 | 4486 | |
---|
4084 | 4487 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4098 | 4501 | |
---|
4099 | 4502 | try |
---|
4100 | 4503 | { |
---|
| 4504 | + // Try compressed version first. |
---|
4101 | 4505 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4102 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4506 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4507 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4103 | 4508 | |
---|
4104 | 4509 | readobj = (Object3D) p.readObject(); |
---|
4105 | 4510 | istream.close(); |
---|
.. | .. |
---|
4107 | 4512 | readobj.ResetDisplayList(); |
---|
4108 | 4513 | } catch (Exception e) |
---|
4109 | 4514 | { |
---|
4110 | | - e.printStackTrace(); |
---|
| 4515 | + //e.printStackTrace(); |
---|
| 4516 | + try |
---|
| 4517 | + { |
---|
| 4518 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4519 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4520 | + |
---|
| 4521 | + readobj = (Object3D) p.readObject(); |
---|
| 4522 | + istream.close(); |
---|
| 4523 | + |
---|
| 4524 | + readobj.ResetDisplayList(); |
---|
| 4525 | + } catch (Exception e2) |
---|
| 4526 | + { |
---|
| 4527 | + e2.printStackTrace(); |
---|
| 4528 | + } |
---|
4111 | 4529 | } |
---|
4112 | 4530 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4113 | 4531 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4153 | 4571 | |
---|
4154 | 4572 | void LoadIt(Object obj) |
---|
4155 | 4573 | { |
---|
| 4574 | + if (obj == null) |
---|
| 4575 | + { |
---|
| 4576 | + // Invalid file |
---|
| 4577 | + return; |
---|
| 4578 | + } |
---|
| 4579 | + |
---|
4156 | 4580 | System.out.println("Loaded " + obj); |
---|
4157 | 4581 | //new Exception().printStackTrace(); |
---|
4158 | 4582 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4162 | 4586 | |
---|
4163 | 4587 | if (readobj != null) |
---|
4164 | 4588 | { |
---|
| 4589 | + if (Globals.SAVEONMAKE) |
---|
| 4590 | + Save(); |
---|
4165 | 4591 | try |
---|
4166 | 4592 | { |
---|
4167 | 4593 | //readobj.deepCopySelf(copy); |
---|
.. | .. |
---|
4224 | 4650 | |
---|
4225 | 4651 | void load() // throws ClassNotFoundException |
---|
4226 | 4652 | { |
---|
4227 | | - if (GrafreeD.standAlone) |
---|
| 4653 | + if (Grafreed.standAlone) |
---|
4228 | 4654 | { |
---|
4229 | 4655 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4230 | 4656 | browser.show(); |
---|
.. | .. |
---|
4311 | 4737 | try |
---|
4312 | 4738 | { |
---|
4313 | 4739 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4314 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4740 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4741 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4315 | 4742 | |
---|
4316 | 4743 | p.writeObject(copy); |
---|
4317 | 4744 | p.flush(); |
---|
4318 | 4745 | |
---|
| 4746 | + zstream.close(); |
---|
4319 | 4747 | ostream.close(); |
---|
4320 | 4748 | |
---|
4321 | 4749 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4325 | 4753 | { |
---|
4326 | 4754 | } |
---|
4327 | 4755 | } |
---|
| 4756 | + |
---|
4328 | 4757 | String lastname; |
---|
4329 | 4758 | |
---|
4330 | 4759 | void saveAs() |
---|
4331 | 4760 | { |
---|
4332 | | - if (GrafreeD.standAlone) |
---|
| 4761 | + if (Grafreed.standAlone) |
---|
4333 | 4762 | { |
---|
4334 | 4763 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4335 | 4764 | browser.setVisible(true); |
---|
.. | .. |
---|
4434 | 4863 | try |
---|
4435 | 4864 | { |
---|
4436 | 4865 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4437 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4438 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 4866 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4867 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4439 | 4868 | |
---|
4440 | 4869 | Object3D objectparent = obj.parent; |
---|
4441 | 4870 | obj.parent = null; |
---|
4442 | 4871 | |
---|
4443 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 4872 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4444 | 4873 | |
---|
4445 | 4874 | obj.parent = objectparent; |
---|
4446 | 4875 | |
---|
.. | .. |
---|
4452 | 4881 | p.writeObject(object); |
---|
4453 | 4882 | p.flush(); |
---|
4454 | 4883 | |
---|
| 4884 | + zstream.close(); |
---|
4455 | 4885 | ostream.close(); |
---|
4456 | | - // zstream.close(); |
---|
4457 | 4886 | |
---|
4458 | 4887 | // group.selection.get(0).parent = parent; |
---|
4459 | 4888 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4474 | 4903 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4475 | 4904 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4476 | 4905 | copy.generatePOV(buffer); |
---|
4477 | | - if (GrafreeD.standAlone) |
---|
| 4906 | + if (Grafreed.standAlone) |
---|
4478 | 4907 | { |
---|
4479 | 4908 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4480 | 4909 | browser.show(); |
---|
.. | .. |
---|
4500 | 4929 | Object3D client; |
---|
4501 | 4930 | Object3D copy; |
---|
4502 | 4931 | MenuBar menuBar; |
---|
4503 | | - Menu windowMenu; |
---|
| 4932 | + Menu fileMenu; |
---|
| 4933 | + MenuItem newItem; |
---|
4504 | 4934 | MenuItem loadItem; |
---|
4505 | 4935 | MenuItem saveItem; |
---|
4506 | 4936 | MenuItem saveAsItem; |
---|
.. | .. |
---|
4508 | 4938 | MenuItem reexportItem; |
---|
4509 | 4939 | MenuItem povItem; |
---|
4510 | 4940 | MenuItem closeItem; |
---|
4511 | | - Menu cameraMenu; |
---|
| 4941 | + |
---|
4512 | 4942 | CheckboxMenuItem zBufferItem; |
---|
4513 | 4943 | //MenuItem normalLensItem; |
---|
4514 | | - MenuItem editCameraItem; |
---|
4515 | | - MenuItem revertCameraItem; |
---|
4516 | | - CheckboxMenuItem toggleLiveItem; |
---|
4517 | 4944 | MenuItem stepItem; |
---|
| 4945 | + CheckboxMenuItem toggleLiveItem; |
---|
4518 | 4946 | CheckboxMenuItem toggleFullScreenItem; |
---|
4519 | 4947 | CheckboxMenuItem toggleTimelineItem; |
---|
4520 | 4948 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4523 | 4951 | CheckboxMenuItem toggleFootContactItem; |
---|
4524 | 4952 | CheckboxMenuItem toggleDLItem; |
---|
4525 | 4953 | CheckboxMenuItem toggleTextureItem; |
---|
4526 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 4954 | + CheckboxMenuItem toggleSwitchItem; |
---|
4527 | 4955 | CheckboxMenuItem toggleRootItem; |
---|
4528 | 4956 | CheckboxMenuItem animationItem; |
---|
4529 | 4957 | CheckboxMenuItem toggleHandleItem; |
---|
4530 | 4958 | CheckboxMenuItem togglePaintItem; |
---|
4531 | 4959 | JSplitPane mainPanel; |
---|
4532 | 4960 | JScrollPane scrollpane; |
---|
| 4961 | + |
---|
4533 | 4962 | JPanel toolbarPanel; |
---|
4534 | | - JPanel treePanel; |
---|
| 4963 | + |
---|
| 4964 | + cGridBag treePanel; |
---|
| 4965 | + |
---|
4535 | 4966 | JPanel radioPanel; |
---|
4536 | 4967 | ButtonGroup buttonGroup; |
---|
4537 | | - JPanel ctrlPanel; |
---|
4538 | | - JPanel materialPanel; |
---|
| 4968 | + |
---|
| 4969 | + cGridBag toolboxPanel; |
---|
| 4970 | + cGridBag materialPanel; |
---|
| 4971 | + cGridBag ctrlPanel; |
---|
| 4972 | + |
---|
4539 | 4973 | JScrollPane infoPanel; |
---|
4540 | | - JPanel optionsPanel; |
---|
| 4974 | + |
---|
| 4975 | + cGridBag optionsPanel; |
---|
| 4976 | + |
---|
4541 | 4977 | JTabbedPane objectPanel; |
---|
4542 | | - JPanel XYZPanel; |
---|
| 4978 | + boolean materialFlushed; |
---|
| 4979 | + Object3D latestObject; |
---|
| 4980 | + |
---|
| 4981 | + cGridBag XYZPanel; |
---|
| 4982 | + |
---|
4543 | 4983 | JSplitPane gridPanel; |
---|
4544 | 4984 | JSplitPane bigPanel; |
---|
4545 | | - JPanel bigThree; |
---|
4546 | | - JTabbedPane scenePanel; |
---|
4547 | | - JPanel centralPanel; |
---|
| 4985 | + |
---|
| 4986 | + cGridBag bigThree; |
---|
| 4987 | + cGridBag scenePanel; |
---|
| 4988 | + cGridBag centralPanel; |
---|
4548 | 4989 | JSplitPane cameraPanel; |
---|
4549 | 4990 | JPanel timelinePanel; |
---|
4550 | 4991 | JMenuBar timelineMenubar; |
---|
.. | .. |
---|
4597 | 5038 | // MATERIAL |
---|
4598 | 5039 | JLabel materialLabel; |
---|
4599 | 5040 | JLabel colorLabel; |
---|
4600 | | - NumberSlider colorField; |
---|
| 5041 | + cNumberSlider colorField; |
---|
4601 | 5042 | JLabel modulationLabel; |
---|
4602 | | - NumberSlider modulationField; |
---|
| 5043 | + cNumberSlider modulationField; |
---|
4603 | 5044 | JLabel metalnessLabel; |
---|
4604 | | - NumberSlider metalnessField; |
---|
| 5045 | + cNumberSlider metalnessField; |
---|
4605 | 5046 | JLabel diffuseLabel; |
---|
4606 | | - NumberSlider diffuseField; |
---|
| 5047 | + cNumberSlider diffuseField; |
---|
4607 | 5048 | JLabel specularLabel; |
---|
4608 | | - NumberSlider specularField; |
---|
| 5049 | + cNumberSlider specularField; |
---|
4609 | 5050 | JLabel shininessLabel; |
---|
4610 | | - NumberSlider shininessField; |
---|
| 5051 | + cNumberSlider shininessField; |
---|
4611 | 5052 | JLabel shiftLabel; |
---|
4612 | | - NumberSlider shiftField; |
---|
| 5053 | + cNumberSlider shiftField; |
---|
4613 | 5054 | JLabel ambientLabel; |
---|
4614 | | - NumberSlider ambientField; |
---|
| 5055 | + cNumberSlider ambientField; |
---|
4615 | 5056 | JLabel lightareaLabel; |
---|
4616 | | - NumberSlider lightareaField; |
---|
| 5057 | + cNumberSlider lightareaField; |
---|
4617 | 5058 | JLabel diffusenessLabel; |
---|
4618 | | - NumberSlider diffusenessField; |
---|
| 5059 | + cNumberSlider diffusenessField; |
---|
4619 | 5060 | JLabel velvetLabel; |
---|
4620 | | - NumberSlider velvetField; |
---|
| 5061 | + cNumberSlider velvetField; |
---|
4621 | 5062 | JLabel sheenLabel; |
---|
4622 | | - NumberSlider sheenField; |
---|
| 5063 | + cNumberSlider sheenField; |
---|
4623 | 5064 | JLabel subsurfaceLabel; |
---|
4624 | | - NumberSlider subsurfaceField; |
---|
| 5065 | + cNumberSlider subsurfaceField; |
---|
4625 | 5066 | //JLabel bumpLabel; |
---|
4626 | 5067 | //NumberSlider bumpField; |
---|
4627 | 5068 | JLabel backlitLabel; |
---|
4628 | | - NumberSlider backlitField; |
---|
| 5069 | + cNumberSlider backlitField; |
---|
4629 | 5070 | JLabel anisoLabel; |
---|
4630 | | - NumberSlider anisoField; |
---|
| 5071 | + cNumberSlider anisoField; |
---|
4631 | 5072 | JLabel anisoVLabel; |
---|
4632 | | - NumberSlider anisoVField; |
---|
| 5073 | + cNumberSlider anisoVField; |
---|
4633 | 5074 | JLabel cameraLabel; |
---|
4634 | | - NumberSlider cameraField; |
---|
| 5075 | + cNumberSlider cameraField; |
---|
4635 | 5076 | JLabel selfshadowLabel; |
---|
4636 | | - NumberSlider selfshadowField; |
---|
| 5077 | + cNumberSlider selfshadowField; |
---|
4637 | 5078 | JLabel shadowLabel; |
---|
4638 | | - NumberSlider shadowField; |
---|
| 5079 | + cNumberSlider shadowField; |
---|
4639 | 5080 | JLabel textureLabel; |
---|
4640 | | - NumberSlider textureField; |
---|
| 5081 | + cNumberSlider textureField; |
---|
4641 | 5082 | JLabel opacityLabel; |
---|
4642 | | - NumberSlider opacityField; |
---|
| 5083 | + cNumberSlider opacityField; |
---|
4643 | 5084 | JLabel fakedepthLabel; |
---|
4644 | | - NumberSlider fakedepthField; |
---|
| 5085 | + cNumberSlider fakedepthField; |
---|
4645 | 5086 | JLabel shadowbiasLabel; |
---|
4646 | | - NumberSlider shadowbiasField; |
---|
| 5087 | + cNumberSlider shadowbiasField; |
---|
4647 | 5088 | JLabel bumpLabel; |
---|
4648 | | - NumberSlider bumpField; |
---|
| 5089 | + cNumberSlider bumpField; |
---|
4649 | 5090 | JLabel noiseLabel; |
---|
4650 | | - NumberSlider noiseField; |
---|
| 5091 | + cNumberSlider noiseField; |
---|
4651 | 5092 | JLabel powerLabel; |
---|
4652 | | - NumberSlider powerField; |
---|
| 5093 | + cNumberSlider powerField; |
---|
4653 | 5094 | JLabel borderfadeLabel; |
---|
4654 | | - NumberSlider borderfadeField; |
---|
| 5095 | + cNumberSlider borderfadeField; |
---|
4655 | 5096 | JLabel fogLabel; |
---|
4656 | | - NumberSlider fogField; |
---|
| 5097 | + cNumberSlider fogField; |
---|
4657 | 5098 | JLabel opacityPowerLabel; |
---|
4658 | | - NumberSlider opacityPowerField; |
---|
4659 | | - JTree jTree; |
---|
| 5099 | + cNumberSlider opacityPowerField; |
---|
| 5100 | + cTree jTree; |
---|
4660 | 5101 | //ObjectUI parent; |
---|
4661 | 5102 | |
---|
4662 | | - NumberSlider normalpushField; |
---|
| 5103 | + cNumberSlider normalpushField; |
---|
| 5104 | + |
---|
| 5105 | + private MenuItem importGFDItem; |
---|
| 5106 | + private MenuItem importVRMLX3DItem; |
---|
| 5107 | + private MenuItem import3DSItem; |
---|
| 5108 | + private MenuItem importOBJItem; |
---|
4663 | 5109 | } |
---|