.. | .. |
---|
19 | 19 | import //weka.core. |
---|
20 | 20 | matrix.Matrix; |
---|
21 | 21 | |
---|
| 22 | +import grafeme.ui.*; |
---|
| 23 | + |
---|
22 | 24 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 25 | ActionListener, ChangeListener, |
---|
24 | 26 | InputMethodListener, |
---|
.. | .. |
---|
31 | 33 | boolean timeline; |
---|
32 | 34 | boolean wasFullScreen; |
---|
33 | 35 | |
---|
| 36 | + GroupEditor callee; |
---|
| 37 | + JFrame frame; |
---|
| 38 | + |
---|
| 39 | + static ObjEditor theFrame; |
---|
| 40 | + |
---|
34 | 41 | // SCRIPT |
---|
35 | 42 | |
---|
36 | 43 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
121 | 128 | void keyPressed(int key, int modifiers) |
---|
122 | 129 | { |
---|
123 | 130 | System.out.println("KEY PRESSED"); |
---|
124 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 131 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
125 | 132 | } |
---|
126 | 133 | */ |
---|
127 | 134 | |
---|
128 | 135 | static GridBagConstraints aConstraints; |
---|
129 | 136 | static GridBagConstraints aWindowConstraints; |
---|
130 | | - GroupEditor callee; |
---|
131 | | - JFrame frame; |
---|
| 137 | + |
---|
132 | 138 | static int GRIDWIDTH = 100; // 4; |
---|
133 | 139 | |
---|
134 | 140 | public void closeUI() |
---|
135 | 141 | { |
---|
136 | 142 | //new Exception().printStackTrace(); |
---|
137 | | - System.out.println("this = " + this); |
---|
138 | | - System.out.println("objEditor = " + objEditor); |
---|
| 143 | +// System.out.println("this = " + this); |
---|
| 144 | +// System.out.println("objEditor = " + objEditor); |
---|
139 | 145 | //nameField.removeActionListener(this); |
---|
140 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 146 | +// objEditor.ctrlPanel.remove(nameField); |
---|
| 147 | + |
---|
| 148 | + objEditor.ctrlPanel.remove(namePanel); |
---|
141 | 149 | |
---|
142 | 150 | if (!GroupEditor.allparams) |
---|
143 | 151 | return; |
---|
144 | 152 | |
---|
145 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
146 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
147 | | - objEditor.ctrlPanel.remove(markCB); |
---|
148 | | - |
---|
149 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
150 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
151 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
152 | | - |
---|
153 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
154 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
155 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
156 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
157 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
158 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
159 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
160 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
161 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
162 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 153 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 154 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 155 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 156 | +// |
---|
| 157 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 158 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 159 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 160 | +// |
---|
| 161 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 162 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 163 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 164 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 165 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 166 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 167 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 168 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 169 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 170 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
163 | 171 | |
---|
164 | | - Remove(normalpushField); |
---|
| 172 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 173 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 174 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
| 175 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 176 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 177 | + |
---|
| 178 | + //Remove(normalpushField); |
---|
165 | 179 | } |
---|
166 | 180 | |
---|
167 | 181 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
232 | 246 | //localCopy.parent = null; |
---|
233 | 247 | |
---|
234 | 248 | frame = new JFrame(); |
---|
| 249 | + frame.setUndecorated(true); |
---|
235 | 250 | objEditor = this; |
---|
236 | 251 | this.callee = callee; |
---|
237 | 252 | |
---|
.. | .. |
---|
265 | 280 | void SetupMenu() |
---|
266 | 281 | { |
---|
267 | 282 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
268 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
269 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
270 | | - windowMenu.add("-"); |
---|
271 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
272 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 283 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 284 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 285 | + fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
| 286 | + |
---|
| 287 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 288 | + Menu menu = new Menu("Import"); |
---|
| 289 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 290 | + importOBJItem.addActionListener(this); |
---|
| 291 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 292 | + import3DSItem.addActionListener(this); |
---|
| 293 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 294 | + importVRMLX3DItem.addActionListener(this); |
---|
| 295 | + menu.add("-"); |
---|
| 296 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 297 | + importGFDItem.addActionListener(this); |
---|
| 298 | + fileMenu.add(menu); |
---|
| 299 | + fileMenu.add("-"); |
---|
| 300 | + |
---|
| 301 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 302 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
273 | 303 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
274 | | - windowMenu.add("-"); |
---|
275 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
276 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
277 | | - windowMenu.add("-"); |
---|
| 304 | + fileMenu.add("-"); |
---|
| 305 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 306 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 307 | + fileMenu.add("-"); |
---|
278 | 308 | if (client.parent != null) |
---|
279 | 309 | { |
---|
280 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 310 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
281 | 311 | } else |
---|
282 | 312 | { |
---|
283 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 313 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
284 | 314 | } |
---|
285 | 315 | |
---|
| 316 | + newItem.addActionListener(this); |
---|
286 | 317 | loadItem.addActionListener(this); |
---|
287 | 318 | saveItem.addActionListener(this); |
---|
288 | 319 | saveAsItem.addActionListener(this); |
---|
.. | .. |
---|
291 | 322 | //povItem.addActionListener(this); |
---|
292 | 323 | closeItem.addActionListener(this); |
---|
293 | 324 | |
---|
294 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
295 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
296 | | - //zBufferItem.addActionListener(this); |
---|
297 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
298 | | - //normalLensItem.addActionListener(this); |
---|
299 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
300 | | - revertCameraItem.addActionListener(this); |
---|
301 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
302 | | - toggleTimelineItem.addItemListener(this); |
---|
303 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
304 | | - toggleFullScreenItem.addItemListener(this); |
---|
305 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
306 | | - cameraMenu.add("-"); |
---|
307 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
308 | | - toggleTextureItem.addItemListener(this); |
---|
309 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
310 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
311 | | - toggleLiveItem.addItemListener(this); |
---|
312 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
313 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
314 | | - stepItem.addActionListener(this); |
---|
315 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
316 | | -// toggleDLItem.addItemListener(this); |
---|
317 | | -// toggleDLItem.setState(false); |
---|
318 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
319 | | - toggleRenderItem.addItemListener(this); |
---|
320 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
321 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
322 | | - toggleDebugItem.addItemListener(this); |
---|
323 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
324 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
325 | | - toggleFrustumItem.addItemListener(this); |
---|
326 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
327 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
328 | | - toggleFootContactItem.addItemListener(this); |
---|
329 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
330 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
331 | | - toggleRandomItem.addItemListener(this); |
---|
332 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
333 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
334 | | - toggleHandleItem.addItemListener(this); |
---|
335 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
336 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
337 | | - togglePaintItem.addItemListener(this); |
---|
338 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
339 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
340 | | -// toggleRootItem.addItemListener(this); |
---|
341 | | -// toggleRootItem.setState(false); |
---|
342 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
343 | | -// animationItem.addItemListener(this); |
---|
344 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
345 | | - cameraMenu.add("-"); |
---|
346 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
347 | | - editCameraItem.addActionListener(this); |
---|
348 | | - |
---|
349 | 325 | objectPanel = new JTabbedPane(); |
---|
350 | 326 | toolbarPanel = new JPanel(); |
---|
351 | 327 | toolbarPanel.setName("Toolbar"); |
---|
352 | | - treePanel = new JPanel(); |
---|
| 328 | + treePanel = new cGridBag(); |
---|
353 | 329 | treePanel.setName("Tree"); |
---|
354 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
355 | | - ctrlPanel.setName("Edit"); |
---|
356 | | - materialPanel = new JPanel(); |
---|
| 330 | + |
---|
| 331 | + editPanel = new cGridBag().setVertical(true); |
---|
| 332 | + editPanel.setName("Edit"); |
---|
| 333 | + |
---|
| 334 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
| 335 | + |
---|
| 336 | + editCommandsPanel = new cGridBag(); |
---|
| 337 | + editPanel.add(editCommandsPanel); |
---|
| 338 | + editPanel.add(ctrlPanel); |
---|
| 339 | + |
---|
| 340 | + materialPanel = new cGridBag().setVertical(true); |
---|
| 341 | + |
---|
357 | 342 | materialPanel.setName("Material"); |
---|
358 | 343 | /*JTextPane*/ |
---|
359 | 344 | infoarea = createTextPane(); |
---|
| 345 | + doc = infoarea.getStyledDocument(); |
---|
| 346 | + |
---|
360 | 347 | infoarea.setEditable(true); |
---|
361 | 348 | SetText(); |
---|
362 | 349 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
363 | 350 | // infoarea.setOpaque(false); |
---|
364 | 351 | // //infoarea.setForeground(textcolor); |
---|
365 | | - infoarea.setLineWrap(true); |
---|
366 | | - infoarea.setWrapStyleWord(true); |
---|
| 352 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 353 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
367 | 354 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
368 | 355 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
369 | 356 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
374 | 361 | mainPanel.setName("Main"); |
---|
375 | 362 | mainPanel.setContinuousLayout(true); |
---|
376 | 363 | mainPanel.setOneTouchExpandable(true); |
---|
377 | | - mainPanel.setDividerLocation(1.0); |
---|
378 | 364 | mainPanel.setDividerSize(9); |
---|
379 | | - mainPanel.setResizeWeight(0); |
---|
| 365 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 366 | + mainPanel.setResizeWeight(0.5); |
---|
380 | 367 | |
---|
381 | 368 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
382 | 369 | //mainPanel.setLayout(new GridBagLayout()); |
---|
383 | 370 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
384 | | - treePanel.setLayout(new GridBagLayout()); |
---|
385 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
386 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 371 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 372 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 373 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
387 | 374 | |
---|
388 | 375 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
389 | 376 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
422 | 409 | static String newline = "\n"; |
---|
423 | 410 | protected static final String buttonString = "JButton"; |
---|
424 | 411 | StyledDocument doc; |
---|
425 | | - JTextArea infoarea; |
---|
| 412 | + JTextPane infoarea; |
---|
426 | 413 | |
---|
427 | 414 | void ClearInfo() |
---|
428 | 415 | { |
---|
.. | .. |
---|
445 | 432 | e.printStackTrace(); |
---|
446 | 433 | } |
---|
447 | 434 | |
---|
448 | | - String selection = infoarea.getText(); |
---|
449 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
450 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
451 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 435 | +// String selection = infoarea.getText(); |
---|
| 436 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 437 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 438 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
452 | 439 | //clipboard.setContents(data, data); |
---|
453 | 440 | } |
---|
454 | 441 | |
---|
.. | .. |
---|
471 | 458 | //SendInfo("Name:", "bold"); |
---|
472 | 459 | if (sel.GetTextures() != null || debug) |
---|
473 | 460 | { |
---|
474 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 461 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
475 | 462 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
476 | 463 | if (sel.Size() > 0) |
---|
477 | 464 | { |
---|
478 | 465 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
479 | 466 | } |
---|
480 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 467 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
481 | 468 | if (debug) |
---|
482 | 469 | { |
---|
483 | 470 | try |
---|
.. | .. |
---|
489 | 476 | } |
---|
490 | 477 | |
---|
491 | 478 | if (full) |
---|
492 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 479 | + { |
---|
| 480 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 481 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 482 | + } |
---|
493 | 483 | |
---|
494 | 484 | if (sel.bRep != null) |
---|
495 | 485 | { |
---|
.. | .. |
---|
516 | 506 | } |
---|
517 | 507 | if (sel.support != null) |
---|
518 | 508 | { |
---|
519 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 509 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
520 | 510 | } |
---|
521 | 511 | if (sel.scriptnode != null) |
---|
522 | 512 | { |
---|
.. | .. |
---|
587 | 577 | { |
---|
588 | 578 | CameraPane.pointflow = (PointFlow) sel; |
---|
589 | 579 | } |
---|
| 580 | + |
---|
| 581 | + si.SendInfo("_____________________", "regular"); |
---|
| 582 | + si.SendInfo("", "regular"); |
---|
590 | 583 | } |
---|
591 | 584 | } |
---|
592 | 585 | |
---|
.. | .. |
---|
602 | 595 | } |
---|
603 | 596 | } |
---|
604 | 597 | |
---|
| 598 | +static GraphicsDevice device = GraphicsEnvironment |
---|
| 599 | + .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 600 | + |
---|
| 601 | + Rectangle keeprect; |
---|
| 602 | + cRadio radio; |
---|
| 603 | + |
---|
| 604 | +cButton keepButton; |
---|
| 605 | + cButton twoButton; // Full 3D |
---|
| 606 | + cButton sixButton; |
---|
| 607 | + cButton threeButton; |
---|
| 608 | + cButton sevenButton; |
---|
| 609 | + cButton fourButton; // full panel |
---|
| 610 | + cButton oneButton; // full XYZ |
---|
| 611 | + //cButton currentLayout; |
---|
| 612 | + |
---|
| 613 | + boolean maximized; |
---|
| 614 | + |
---|
| 615 | + void Minimize() |
---|
| 616 | + { |
---|
| 617 | + frame.setState(Frame.ICONIFIED); |
---|
| 618 | + } |
---|
| 619 | + |
---|
| 620 | + void Maximize() |
---|
| 621 | + { |
---|
| 622 | + if (maximized) |
---|
| 623 | + { |
---|
| 624 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 625 | + } |
---|
| 626 | + else |
---|
| 627 | + { |
---|
| 628 | + keeprect = frame.getBounds(); |
---|
| 629 | + Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 630 | + Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 631 | + frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 632 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 633 | + } |
---|
| 634 | + |
---|
| 635 | + maximized ^= true; |
---|
| 636 | + } |
---|
| 637 | + |
---|
605 | 638 | void ToggleFullScreen() |
---|
606 | 639 | { |
---|
607 | 640 | if (CameraPane.FULLSCREEN) |
---|
608 | 641 | { |
---|
609 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
610 | | - framePanel.add(bigThree); |
---|
611 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 642 | + device.setFullScreenWindow(null); |
---|
| 643 | + //frame.setVisible(false); |
---|
| 644 | +// frame.removeNotify(); |
---|
| 645 | +// frame.setUndecorated(false); |
---|
| 646 | +// frame.addNotify(); |
---|
| 647 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 648 | + |
---|
| 649 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 650 | +// X framePanel.add(bigThree); |
---|
| 651 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 652 | + framePanel.setDividerLocation(1); |
---|
| 653 | + |
---|
| 654 | + //frame.setVisible(true); |
---|
| 655 | + radio.layout = keepButton; |
---|
| 656 | + //theFrame = null; |
---|
| 657 | + keepButton = null; |
---|
| 658 | + radio.layout.doClick(); |
---|
| 659 | + |
---|
612 | 660 | } else |
---|
613 | 661 | { |
---|
614 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
615 | | - framePanel.remove(bigThree); |
---|
616 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 662 | + keepButton = radio.layout; |
---|
| 663 | + //keeprect = frame.getBounds(); |
---|
| 664 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 665 | +// frame.getToolkit().getScreenSize().height); |
---|
| 666 | + //frame.setVisible(false); |
---|
| 667 | + device.setFullScreenWindow(frame); |
---|
| 668 | +// frame.removeNotify(); |
---|
| 669 | +// frame.setUndecorated(true); |
---|
| 670 | +// frame.addNotify(); |
---|
| 671 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 672 | +// X framePanel.remove(bigThree); |
---|
| 673 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 674 | + framePanel.setDividerLocation(0); |
---|
| 675 | + |
---|
| 676 | + radio.layout = twoButton; |
---|
| 677 | + radio.layout.doClick(); |
---|
| 678 | + //frame.setVisible(true); |
---|
617 | 679 | } |
---|
| 680 | + |
---|
618 | 681 | cameraView.ToggleFullScreen(); |
---|
619 | 682 | } |
---|
620 | 683 | |
---|
621 | | - private JTextArea createTextPane() |
---|
| 684 | + private JTextPane createTextPane() |
---|
622 | 685 | { |
---|
623 | | - String[] initString = |
---|
624 | | - { |
---|
625 | | - "This is an editable JTextPane, ", //regular |
---|
626 | | - "another ", //italic |
---|
627 | | - "styled ", //bold |
---|
628 | | - "text ", //small |
---|
629 | | - "component, ", //large |
---|
630 | | - "which supports embedded components..." + newline,//regular |
---|
631 | | - " " + newline, //button |
---|
632 | | - "...and embedded icons..." + newline, //regular |
---|
633 | | - " ", //icon |
---|
634 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
635 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
636 | | - + "cover methods for interacting with those objects." |
---|
637 | | - }; |
---|
| 686 | +// TEXTAREA String[] initString = |
---|
| 687 | +// { |
---|
| 688 | +// "This is an editable JTextPane, ", //regular |
---|
| 689 | +// "another ", //italic |
---|
| 690 | +// "styled ", //bold |
---|
| 691 | +// "text ", //small |
---|
| 692 | +// "component, ", //large |
---|
| 693 | +// "which supports embedded components..." + newline,//regular |
---|
| 694 | +// " " + newline, //button |
---|
| 695 | +// "...and embedded icons..." + newline, //regular |
---|
| 696 | +// " ", //icon |
---|
| 697 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 698 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 699 | +// + "cover methods for interacting with those objects." |
---|
| 700 | +// }; |
---|
| 701 | +// |
---|
| 702 | +// String[] initStyles = |
---|
| 703 | +// { |
---|
| 704 | +// "regular", "italic", "bold", "small", "large", |
---|
| 705 | +// "regular", "button", "regular", "icon", |
---|
| 706 | +// "regular" |
---|
| 707 | +// }; |
---|
| 708 | +// |
---|
| 709 | +// JTextPane textPane = new JTextPane(); |
---|
| 710 | +// textPane.setEditable(true); |
---|
| 711 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 712 | +// addStylesToDocument(doc); |
---|
| 713 | +// |
---|
| 714 | +// try |
---|
| 715 | +// { |
---|
| 716 | +// for (int j = 0; j < 2; j++) |
---|
| 717 | +// { |
---|
| 718 | +// for (int i = 0; i < initString.length; i++) |
---|
| 719 | +// { |
---|
| 720 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 721 | +// doc.getStyle(initStyles[i])); |
---|
| 722 | +// } |
---|
| 723 | +// } |
---|
| 724 | +// } catch (BadLocationException ble) |
---|
| 725 | +// { |
---|
| 726 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 727 | +// } |
---|
638 | 728 | |
---|
639 | | - String[] initStyles = |
---|
640 | | - { |
---|
641 | | - "regular", "italic", "bold", "small", "large", |
---|
642 | | - "regular", "button", "regular", "icon", |
---|
643 | | - "regular" |
---|
644 | | - }; |
---|
645 | | - |
---|
646 | | - JTextPane textPane = new JTextPane(); |
---|
647 | | - textPane.setEditable(true); |
---|
648 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
649 | | - addStylesToDocument(doc); |
---|
650 | | - |
---|
651 | | - try |
---|
652 | | - { |
---|
653 | | - for (int j = 0; j < 2; j++) |
---|
654 | | - { |
---|
655 | | - for (int i = 0; i < initString.length; i++) |
---|
656 | | - { |
---|
657 | | - doc.insertString(doc.getLength(), initString[i], |
---|
658 | | - doc.getStyle(initStyles[i])); |
---|
659 | | - } |
---|
660 | | - } |
---|
661 | | - } catch (BadLocationException ble) |
---|
662 | | - { |
---|
663 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
664 | | - } |
---|
665 | | - |
---|
666 | | - return new JTextArea(); // textPane; |
---|
| 729 | + return new JTextPane(); // textPane; |
---|
667 | 730 | } |
---|
668 | 731 | |
---|
669 | 732 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
716 | 779 | protected static ImageIcon createImageIcon(String path, |
---|
717 | 780 | String description) |
---|
718 | 781 | { |
---|
719 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 782 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
720 | 783 | if (imgURL != null) |
---|
721 | 784 | { |
---|
722 | 785 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
748 | 811 | // NumberSlider vDivsField; |
---|
749 | 812 | // JCheckBox endcaps; |
---|
750 | 813 | JCheckBox liveCB; |
---|
| 814 | + JCheckBox selectCB; |
---|
751 | 815 | JCheckBox hideCB; |
---|
752 | 816 | JCheckBox link2masterCB; |
---|
753 | 817 | JCheckBox markCB; |
---|
.. | .. |
---|
763 | 827 | JButton slowerButton; |
---|
764 | 828 | JButton fasterButton; |
---|
765 | 829 | JButton remarkButton; |
---|
| 830 | + |
---|
| 831 | + cGridBag editPanel; |
---|
| 832 | + cGridBag editCommandsPanel; |
---|
| 833 | + |
---|
| 834 | + cGridBag namePanel; |
---|
| 835 | + cGridBag setupPanel; |
---|
| 836 | + cGridBag setupPanel2; |
---|
| 837 | + cGridBag objectCommandsPanel; |
---|
| 838 | + cGridBag pushPanel; |
---|
| 839 | + cGridBag fillPanel; |
---|
766 | 840 | |
---|
767 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 841 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
768 | 842 | { |
---|
769 | 843 | JCheckBox cb; |
---|
770 | 844 | |
---|
771 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
772 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
773 | | -// oe.aConstraints.weightx = 1; |
---|
774 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
775 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 845 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
776 | 846 | cb.addItemListener(this); |
---|
777 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
778 | | - oe.aConstraints.gridwidth = 1; |
---|
779 | | - oe.aConstraints.gridx += 1; |
---|
780 | 847 | |
---|
781 | 848 | return cb; |
---|
782 | 849 | } |
---|
783 | 850 | |
---|
784 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 851 | + cButton AddButton(cGridBag panel, String label) |
---|
785 | 852 | { |
---|
786 | 853 | cButton cb; |
---|
787 | 854 | |
---|
788 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
789 | | - oe.aConstraints.gridwidth = 1; |
---|
790 | | -// oe.aConstraints.weightx = 1; |
---|
791 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
792 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 855 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
793 | 856 | cb.addActionListener(this); |
---|
794 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
795 | | - oe.aConstraints.gridwidth = 1; |
---|
796 | | - oe.aConstraints.gridx += 1; |
---|
797 | 857 | |
---|
798 | 858 | return cb; |
---|
799 | 859 | } |
---|
800 | 860 | |
---|
801 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 861 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
802 | 862 | { |
---|
803 | 863 | JComboBox combo; |
---|
804 | 864 | |
---|
805 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
806 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
807 | | - oe.aConstraints.gridx += 1; |
---|
| 865 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
808 | 866 | combo.addActionListener(this); |
---|
809 | 867 | |
---|
810 | 868 | return combo; |
---|
811 | 869 | } |
---|
812 | 870 | |
---|
813 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 871 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
814 | 872 | { |
---|
815 | | - NumberSlider combo; |
---|
| 873 | + cGridBag control = new cGridBag(); |
---|
| 874 | + |
---|
| 875 | + cNumberSlider combo; |
---|
816 | 876 | |
---|
817 | 877 | JLabel jlabel = new JLabel(label); |
---|
818 | | - |
---|
819 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
820 | 878 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
821 | | - aConstraints.gridwidth = 1; |
---|
822 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
823 | | - aConstraints.gridx += 1; |
---|
824 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
825 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
826 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
827 | | - aConstraints.gridx += 1; |
---|
828 | | - aConstraints.gridwidth = 1; |
---|
829 | | - |
---|
| 879 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 880 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
830 | 881 | combo.setFloat(current); |
---|
831 | | - |
---|
832 | | - combo.label = jlabel; |
---|
833 | | - |
---|
834 | | - combo.addChangeListener(this); |
---|
835 | | - |
---|
836 | | - return combo; |
---|
| 882 | + |
---|
| 883 | + panel.add(control); |
---|
| 884 | + |
---|
| 885 | + return control; |
---|
837 | 886 | } |
---|
838 | 887 | |
---|
839 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 888 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
840 | 889 | { |
---|
841 | | - NumberSlider combo; |
---|
| 890 | + cGridBag control = new cGridBag(); |
---|
| 891 | + |
---|
| 892 | + cNumberSlider combo; |
---|
842 | 893 | |
---|
843 | 894 | JLabel jlabel = new JLabel(label); |
---|
844 | | - |
---|
845 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
846 | 895 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
847 | | - aConstraints.gridwidth = 2; |
---|
848 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
849 | | - aConstraints.gridx += 1; |
---|
850 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
851 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
852 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
853 | | - aConstraints.gridx += 1; |
---|
854 | | - aConstraints.gridwidth = 1; |
---|
855 | | - |
---|
| 896 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 897 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
856 | 898 | combo.setInteger(current); |
---|
857 | 899 | |
---|
858 | | - combo.label = jlabel; |
---|
859 | | - |
---|
860 | | - combo.addChangeListener(this); |
---|
861 | | - |
---|
862 | | - return combo; |
---|
| 900 | + panel.add(control); |
---|
| 901 | + |
---|
| 902 | + return control; |
---|
863 | 903 | } |
---|
864 | 904 | |
---|
865 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 905 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
866 | 906 | { |
---|
867 | 907 | JTextArea text; |
---|
868 | 908 | |
---|
869 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
870 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
871 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 909 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
872 | 910 | text.addCaretListener(this); |
---|
873 | | - aConstraints.gridx += 1; |
---|
874 | | - aConstraints.gridwidth = 1; |
---|
875 | 911 | |
---|
876 | 912 | return text; |
---|
877 | 913 | } |
---|
.. | .. |
---|
901 | 937 | objEditor.ctrlPanel.remove(j); |
---|
902 | 938 | } |
---|
903 | 939 | |
---|
| 940 | + void Remove(cNumberSlider j) |
---|
| 941 | + { |
---|
| 942 | + j.removeChangeListener(this); |
---|
| 943 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 944 | + objEditor.ctrlPanel.remove(j); |
---|
| 945 | + } |
---|
| 946 | + |
---|
904 | 947 | /* |
---|
905 | 948 | */ |
---|
906 | | - void Return() // ObjEditor oe) |
---|
| 949 | + void Return0() // ObjEditor oe) |
---|
907 | 950 | { |
---|
908 | 951 | aConstraints.gridy += 1; |
---|
909 | 952 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
958 | 1001 | |
---|
959 | 1002 | void SetupUI2(ObjEditor oe) |
---|
960 | 1003 | { |
---|
961 | | -// oe.aConstraints.weightx = 0; |
---|
962 | | -// oe.aConstraints.weighty = 0; |
---|
963 | | -// oe.aConstraints.gridx = 0; |
---|
964 | | -// oe.aConstraints.gridy = 0; |
---|
965 | | - SetupName(oe); |
---|
| 1004 | + //SetupName(oe); |
---|
| 1005 | + |
---|
| 1006 | + namePanel = new cGridBag(); |
---|
| 1007 | + |
---|
| 1008 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 1009 | + namePanel.add(nameField); |
---|
| 1010 | + oe.ctrlPanel.add(namePanel); |
---|
| 1011 | + |
---|
| 1012 | + oe.ctrlPanel.Return(); |
---|
966 | 1013 | |
---|
967 | 1014 | if (!GroupEditor.allparams) |
---|
968 | 1015 | return; |
---|
969 | 1016 | |
---|
970 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
971 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
972 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1017 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1018 | + |
---|
| 1019 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1020 | + liveCB.setToolTipText("Animate object"); |
---|
| 1021 | + selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1022 | + selectCB.setToolTipText("Make object selectable"); |
---|
973 | 1023 | // Return(); |
---|
974 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
975 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
976 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
977 | | - Return(); |
---|
978 | | - resetButton = AddButton(oe, "Reset"); |
---|
979 | | - stepButton = AddButton(oe, "Step"); |
---|
| 1024 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1025 | + hideCB.setToolTipText("Hide object"); |
---|
| 1026 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 1027 | + markCB.setToolTipText("Set the animation target transform"); |
---|
| 1028 | + |
---|
| 1029 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1030 | + |
---|
| 1031 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1032 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1033 | + |
---|
| 1034 | + randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
| 1035 | + randomCB.setToolTipText("Randomly Rewind or Go back and forth"); |
---|
| 1036 | + |
---|
| 1037 | + if (Globals.ADVANCED) |
---|
| 1038 | + { |
---|
| 1039 | + link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
| 1040 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1041 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1042 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1043 | + } |
---|
| 1044 | + |
---|
| 1045 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1046 | + oe.ctrlPanel.Return(); |
---|
| 1047 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1048 | + oe.ctrlPanel.Return(); |
---|
| 1049 | + |
---|
| 1050 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
| 1051 | + |
---|
| 1052 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1053 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1054 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1055 | + stepButton.setToolTipText("Step one frame"); |
---|
980 | 1056 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
981 | 1057 | // stepAllButton = AddButton(oe, "Step All"); |
---|
982 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
983 | 1058 | // Return(); |
---|
984 | | - slowerButton = AddButton(oe, "Slow"); |
---|
985 | | - fasterButton = AddButton(oe, "Fast"); |
---|
986 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1059 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1060 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1061 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1062 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1063 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1064 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
987 | 1065 | |
---|
988 | | - Return(); |
---|
| 1066 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
| 1067 | + oe.ctrlPanel.Return(); |
---|
989 | 1068 | |
---|
990 | | - normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
991 | | - Return(); |
---|
| 1069 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1070 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1071 | + //Return(); |
---|
| 1072 | + |
---|
| 1073 | + oe.ctrlPanel.Return(); |
---|
992 | 1074 | |
---|
993 | 1075 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
994 | 1076 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1083 | 1165 | oe.aConstraints.gridwidth = 1; |
---|
1084 | 1166 | /**/ |
---|
1085 | 1167 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1086 | | - Return(); |
---|
| 1168 | + oe.ctrlPanel.Return(); |
---|
1087 | 1169 | |
---|
1088 | 1170 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1089 | 1171 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1185 | 1267 | //JPanel worldPanel = |
---|
1186 | 1268 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1187 | 1269 | //worldPanel.setName("World"); |
---|
1188 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
1189 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1190 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1270 | + centralPanel = new cGridBag(); |
---|
| 1271 | + centralPanel.preferredWidth = 20; |
---|
| 1272 | + |
---|
| 1273 | + if (Globals.ADVANCED) |
---|
| 1274 | + { |
---|
| 1275 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1276 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1191 | 1277 | |
---|
| 1278 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1279 | + cameraPanel.setContinuousLayout(true); |
---|
| 1280 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1281 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1282 | +// cameraPanel.setDividerSize(9); |
---|
| 1283 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1284 | + |
---|
| 1285 | + } |
---|
| 1286 | + |
---|
1192 | 1287 | centralPanel.add(cameraView); |
---|
| 1288 | + centralPanel.setFocusable(true); |
---|
1193 | 1289 | //frame.setJMenuBar(timelineMenubar); |
---|
1194 | 1290 | //centralPanel.add(timelinePanel); |
---|
1195 | 1291 | |
---|
.. | .. |
---|
1208 | 1304 | //frontView.object = copy; |
---|
1209 | 1305 | //sideView.object = copy; |
---|
1210 | 1306 | |
---|
1211 | | - XYZPanel = new JPanel(); |
---|
1212 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1307 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1308 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1213 | 1309 | |
---|
1214 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1215 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1216 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1310 | + XYZPanel.preferredWidth = 5; |
---|
| 1311 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1312 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1313 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1217 | 1314 | |
---|
1218 | 1315 | /* |
---|
1219 | 1316 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1251 | 1348 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1252 | 1349 | //tmp.setName("Edit"); |
---|
1253 | 1350 | objectPanel.add(materialPanel); |
---|
1254 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1255 | | - north.setName("Edit"); |
---|
1256 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1257 | | - objectPanel.add(north); |
---|
| 1351 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1352 | +// north.setName("Edit"); |
---|
| 1353 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1354 | +// objectPanel.add(north); |
---|
| 1355 | + objectPanel.add(editPanel); |
---|
1258 | 1356 | objectPanel.add(infoPanel); |
---|
1259 | 1357 | |
---|
1260 | 1358 | /* |
---|
.. | .. |
---|
1275 | 1373 | scrollpane.setWheelScrollingEnabled(true); |
---|
1276 | 1374 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1277 | 1375 | |
---|
1278 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1279 | | - scenePanel.add(scrollpane); |
---|
| 1376 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1377 | + scenePanel.preferredWidth = 6; |
---|
| 1378 | + |
---|
| 1379 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1380 | + tabbedPane.add(scrollpane); |
---|
1280 | 1381 | |
---|
1281 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
| 1382 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1282 | 1383 | |
---|
1283 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1384 | + optionsPanel = new cGridBag().setVertical(true); |
---|
1284 | 1385 | |
---|
1285 | 1386 | optionsPanel.setName("Options"); |
---|
1286 | | - scenePanel.add(optionsPanel); |
---|
1287 | | - |
---|
| 1387 | + |
---|
| 1388 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1389 | + |
---|
| 1390 | + tabbedPane.add(optionsPanel); |
---|
| 1391 | + |
---|
| 1392 | + scenePanel.add(tabbedPane); |
---|
1288 | 1393 | |
---|
1289 | 1394 | /* |
---|
1290 | 1395 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1318 | 1423 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1319 | 1424 | //bigPanel.add(ctrlPanel); |
---|
1320 | 1425 | //bigPanel.add(gridPanel); |
---|
| 1426 | + /** |
---|
1321 | 1427 | bigThree = new JPanel(); |
---|
1322 | 1428 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1323 | 1429 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1341 | 1447 | // aConstraints.gridheight = 3; |
---|
1342 | 1448 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1343 | 1449 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1450 | + /**/ |
---|
1344 | 1451 | |
---|
| 1452 | + bigThree = new cGridBag(); |
---|
| 1453 | + bigThree.addComponent(scenePanel); |
---|
| 1454 | + bigThree.addComponent(centralPanel); |
---|
| 1455 | + bigThree.addComponent(XYZPanel); |
---|
| 1456 | + |
---|
1345 | 1457 | // // SIDE EFFECT!!! |
---|
1346 | 1458 | // aConstraints.gridx = 0; |
---|
1347 | 1459 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1362 | 1474 | //worldPane.add(bigPanel); |
---|
1363 | 1475 | //worldPane.add(worldPanel); |
---|
1364 | 1476 | /**/ |
---|
1365 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1477 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1478 | + frame.add(/*"Center",*/framePanel); |
---|
1366 | 1479 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1367 | 1480 | |
---|
1368 | 1481 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1369 | 1482 | |
---|
1370 | | - frame.setSize(1024, 768); |
---|
1371 | | - frame.show(); |
---|
| 1483 | + frame.setSize(1280, 860); |
---|
| 1484 | + frame.setVisible(true); |
---|
1372 | 1485 | |
---|
| 1486 | + cameraView.requestFocusInWindow(); |
---|
| 1487 | + |
---|
1373 | 1488 | gridPanel.setDividerLocation(1.0); |
---|
1374 | 1489 | |
---|
1375 | 1490 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
.. | .. |
---|
1383 | 1498 | }); |
---|
1384 | 1499 | } |
---|
1385 | 1500 | |
---|
| 1501 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1502 | + { |
---|
| 1503 | + } |
---|
| 1504 | + |
---|
1386 | 1505 | JTree GetTree() |
---|
1387 | 1506 | { |
---|
1388 | 1507 | return objEditor.jTree; |
---|
.. | .. |
---|
1394 | 1513 | ctrlPanel.removeAll(); |
---|
1395 | 1514 | } |
---|
1396 | 1515 | |
---|
1397 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1516 | + void SetupMaterial(cGridBag panel) |
---|
1398 | 1517 | { |
---|
1399 | | - aConstraints.weighty = 0; |
---|
1400 | | - //aConstraints.weightx = 1; |
---|
1401 | | - /* |
---|
| 1518 | + /* |
---|
1402 | 1519 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1403 | 1520 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1404 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1405 | | - aConstraints.gridx += 1; |
---|
1406 | 1521 | */ |
---|
1407 | 1522 | |
---|
1408 | | - aConstraints.gridwidth = 1; |
---|
1409 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1410 | | - aConstraints.gridx += 1; |
---|
1411 | | - aConstraints.weighty = 0; |
---|
1412 | | - aConstraints.gridwidth = 1; |
---|
| 1523 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 1524 | + |
---|
| 1525 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1526 | + createMaterialButton.setToolTipText("Create material"); |
---|
1413 | 1527 | |
---|
1414 | 1528 | /* |
---|
1415 | 1529 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1416 | | - aConstraints.gridx += 1; |
---|
1417 | | - aConstraints.weighty = 0; |
---|
1418 | | - aConstraints.gridwidth = 1; |
---|
1419 | 1530 | */ |
---|
1420 | 1531 | |
---|
1421 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1422 | | - aConstraints.gridx += 1; |
---|
| 1532 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1533 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1534 | + |
---|
| 1535 | + if (Globals.ADVANCED) |
---|
| 1536 | + { |
---|
| 1537 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1538 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1539 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1540 | + } |
---|
1423 | 1541 | |
---|
1424 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1425 | | - |
---|
1426 | | - aConstraints.gridx += 1; |
---|
1427 | | - |
---|
1428 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1429 | | - |
---|
1430 | | - aConstraints.gridx += 1; |
---|
1431 | | - |
---|
1432 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1433 | | - |
---|
1434 | | - aConstraints.gridx = 0; |
---|
1435 | | - aConstraints.gridy += 1; |
---|
1436 | | - aConstraints.weighty = 0; |
---|
1437 | | - aConstraints.gridwidth = 1; |
---|
| 1542 | + editBar.preferredHeight = 15; |
---|
| 1543 | + |
---|
| 1544 | + panel.add(editBar); |
---|
| 1545 | + |
---|
1438 | 1546 | /**/ |
---|
1439 | 1547 | //aConstraints.weighty = 0; |
---|
1440 | 1548 | ////aConstraints.weightx = 1; |
---|
1441 | 1549 | //aConstraints.weighty = 1; |
---|
1442 | 1550 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1443 | 1551 | //aConstraints.gridx += 1; |
---|
1444 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1445 | | - aConstraints.weighty = 0; |
---|
1446 | | - aConstraints.gridx = 0; |
---|
1447 | | - aConstraints.gridy += 1; |
---|
1448 | | - aConstraints.gridwidth = 1; |
---|
| 1552 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1449 | 1553 | |
---|
1450 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1451 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1452 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1453 | | - aConstraints.gridx += 1; |
---|
1454 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1455 | | - //aConstraints.weightx = 0; |
---|
1456 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1457 | | - aConstraints.gridx = 0; |
---|
1458 | | - aConstraints.gridy += 1; |
---|
1459 | | - aConstraints.gridwidth = 1; |
---|
| 1554 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1555 | + |
---|
| 1556 | + cGridBag color = new cGridBag(); |
---|
| 1557 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1558 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1559 | + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1560 | + //colorField.preferredWidth = 200; |
---|
| 1561 | + colorSection.add(color); |
---|
1460 | 1562 | |
---|
1461 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1462 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1463 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1464 | | - aConstraints.gridx += 1; |
---|
1465 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1466 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1467 | | - aConstraints.gridx = 0; |
---|
1468 | | - aConstraints.gridy += 1; |
---|
1469 | | - aConstraints.gridwidth = 1; |
---|
| 1563 | + cGridBag modulation = new cGridBag(); |
---|
| 1564 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 1565 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1566 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1567 | + colorSection.add(modulation); |
---|
1470 | 1568 | |
---|
1471 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1472 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1473 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1474 | | - aConstraints.gridx += 1; |
---|
1475 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1476 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1477 | | - aConstraints.gridx = 0; |
---|
1478 | | - aConstraints.gridy += 1; |
---|
1479 | | - aConstraints.gridwidth = 1; |
---|
| 1569 | + cGridBag texture = new cGridBag(); |
---|
| 1570 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 1571 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1572 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1573 | + colorSection.add(texture); |
---|
1480 | 1574 | |
---|
1481 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1482 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1483 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1484 | | - aConstraints.gridx += 1; |
---|
1485 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1486 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1487 | | - aConstraints.gridx = 0; |
---|
1488 | | - aConstraints.gridy += 1; |
---|
1489 | | - aConstraints.gridwidth = 1; |
---|
| 1575 | + cGridBag anisoU = new cGridBag(); |
---|
| 1576 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1577 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1578 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1579 | + colorSection.add(anisoU); |
---|
1490 | 1580 | |
---|
1491 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1492 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1493 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1494 | | - aConstraints.gridx += 1; |
---|
1495 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1496 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1497 | | - aConstraints.gridx = 0; |
---|
1498 | | - aConstraints.gridy += 1; |
---|
1499 | | - aConstraints.gridwidth = 1; |
---|
| 1581 | + cGridBag anisoV = new cGridBag(); |
---|
| 1582 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1583 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1584 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1585 | + colorSection.add(anisoV); |
---|
1500 | 1586 | |
---|
1501 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1502 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1503 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1504 | | - aConstraints.gridx += 1; |
---|
1505 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1506 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1507 | | - aConstraints.gridx = 0; |
---|
1508 | | - aConstraints.gridy += 1; |
---|
1509 | | - aConstraints.gridwidth = 1; |
---|
| 1587 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1588 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1589 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1590 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1591 | + colorSection.add(shadowbias); |
---|
1510 | 1592 | |
---|
1511 | | - //aConstraints.weighty = 1; |
---|
1512 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1513 | | - //aConstraints.gridx += 1; |
---|
1514 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1515 | | - aConstraints.weighty = 0; |
---|
1516 | | - aConstraints.gridx = 0; |
---|
1517 | | - aConstraints.gridy += 1; |
---|
1518 | | - aConstraints.gridwidth = 1; |
---|
| 1593 | + panel.add(new JSeparator()); |
---|
| 1594 | + |
---|
| 1595 | + panel.add(colorSection); |
---|
| 1596 | + |
---|
| 1597 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1598 | + |
---|
| 1599 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 1600 | + |
---|
| 1601 | + cGridBag diffuse = new cGridBag(); |
---|
| 1602 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 1603 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1604 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1605 | + diffuseSection.add(diffuse); |
---|
1519 | 1606 | |
---|
1520 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1521 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1522 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1523 | | - aConstraints.gridx += 1; |
---|
1524 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1525 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1526 | | - aConstraints.gridx = 0; |
---|
1527 | | - aConstraints.gridy += 1; |
---|
1528 | | - aConstraints.gridwidth = 1; |
---|
| 1607 | + cGridBag diffuseness = new cGridBag(); |
---|
| 1608 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 1609 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1610 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1611 | + diffuseSection.add(diffuseness); |
---|
1529 | 1612 | |
---|
1530 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1531 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1532 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1533 | | - aConstraints.gridx += 1; |
---|
1534 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1535 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1536 | | - aConstraints.gridx = 0; |
---|
1537 | | - aConstraints.gridy += 1; |
---|
1538 | | - aConstraints.gridwidth = 1; |
---|
| 1613 | + cGridBag selfshadow = new cGridBag(); |
---|
| 1614 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 1615 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1616 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1617 | + diffuseSection.add(selfshadow); |
---|
1539 | 1618 | |
---|
1540 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1541 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1542 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1543 | | - aConstraints.gridx += 1; |
---|
1544 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1545 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1546 | | - aConstraints.gridx = 0; |
---|
1547 | | - aConstraints.gridy += 1; |
---|
1548 | | - aConstraints.gridwidth = 1; |
---|
| 1619 | + cGridBag sheen = new cGridBag(); |
---|
| 1620 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 1621 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1622 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1623 | + diffuseSection.add(sheen); |
---|
1549 | 1624 | |
---|
1550 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1551 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1552 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1553 | | - aConstraints.gridx += 1; |
---|
1554 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1555 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1556 | | - aConstraints.gridx = 0; |
---|
1557 | | - aConstraints.gridy += 1; |
---|
1558 | | - aConstraints.gridwidth = 1; |
---|
| 1625 | + cGridBag subsurface = new cGridBag(); |
---|
| 1626 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 1627 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1628 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1629 | + diffuseSection.add(subsurface); |
---|
1559 | 1630 | |
---|
1560 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1561 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1562 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1563 | | - aConstraints.gridx += 1; |
---|
1564 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1565 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1566 | | - aConstraints.gridx = 0; |
---|
1567 | | - aConstraints.gridy += 1; |
---|
1568 | | - aConstraints.gridwidth = 1; |
---|
| 1631 | + cGridBag shadow = new cGridBag(); |
---|
| 1632 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 1633 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1634 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1635 | + diffuseSection.add(shadow); |
---|
1569 | 1636 | |
---|
1570 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1571 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1572 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1573 | | - aConstraints.gridx += 1; |
---|
1574 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1575 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1576 | | - aConstraints.gridx = 0; |
---|
1577 | | - aConstraints.gridy += 1; |
---|
1578 | | - aConstraints.gridwidth = 1; |
---|
| 1637 | + cGridBag fakedepth = new cGridBag(); |
---|
| 1638 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 1639 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1640 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1641 | + diffuseSection.add(fakedepth); |
---|
1579 | 1642 | |
---|
1580 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1581 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1582 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1583 | | - aConstraints.gridx += 1; |
---|
1584 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1585 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1586 | | - aConstraints.gridx = 0; |
---|
1587 | | - aConstraints.gridy += 1; |
---|
1588 | | - aConstraints.gridwidth = 1; |
---|
| 1643 | + panel.add(new JSeparator()); |
---|
| 1644 | + |
---|
| 1645 | + panel.add(diffuseSection); |
---|
| 1646 | + |
---|
| 1647 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1648 | + |
---|
| 1649 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1589 | 1650 | |
---|
1590 | | - //aConstraints.weighty = 1; |
---|
1591 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1592 | | - //aConstraints.gridx += 1; |
---|
1593 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1594 | | - aConstraints.weighty = 0; |
---|
1595 | | - aConstraints.gridx = 0; |
---|
1596 | | - aConstraints.gridy += 1; |
---|
1597 | | - aConstraints.gridwidth = 1; |
---|
| 1651 | + cGridBag specular = new cGridBag(); |
---|
| 1652 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 1653 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1654 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1655 | + specularSection.add(specular); |
---|
1598 | 1656 | |
---|
1599 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1600 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1601 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1602 | | - aConstraints.gridx += 1; |
---|
1603 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1604 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1605 | | - aConstraints.gridx = 0; |
---|
1606 | | - aConstraints.gridy += 1; |
---|
1607 | | - aConstraints.gridwidth = 1; |
---|
| 1657 | + cGridBag lightarea = new cGridBag(); |
---|
| 1658 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 1659 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1660 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1661 | + specularSection.add(lightarea); |
---|
1608 | 1662 | |
---|
1609 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1610 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1611 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1612 | | - aConstraints.gridx += 1; |
---|
1613 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1614 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1615 | | - aConstraints.gridx = 0; |
---|
1616 | | - aConstraints.gridy += 1; |
---|
1617 | | - aConstraints.gridwidth = 1; |
---|
| 1663 | + cGridBag shininess = new cGridBag(); |
---|
| 1664 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 1665 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1666 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1667 | + specularSection.add(shininess); |
---|
1618 | 1668 | |
---|
1619 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1620 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1621 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1622 | | - aConstraints.gridx += 1; |
---|
1623 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1624 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1625 | | - aConstraints.gridx = 0; |
---|
1626 | | - aConstraints.gridy += 1; |
---|
1627 | | - aConstraints.gridwidth = 1; |
---|
| 1669 | + cGridBag metalness = new cGridBag(); |
---|
| 1670 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 1671 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1672 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1673 | + specularSection.add(metalness); |
---|
1628 | 1674 | |
---|
1629 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1630 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1631 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1632 | | - aConstraints.gridx += 1; |
---|
1633 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1634 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1635 | | - aConstraints.gridx = 0; |
---|
1636 | | - aConstraints.gridy += 1; |
---|
1637 | | - aConstraints.gridwidth = 1; |
---|
| 1675 | + cGridBag velvet = new cGridBag(); |
---|
| 1676 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 1677 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1678 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1679 | + specularSection.add(velvet); |
---|
1638 | 1680 | |
---|
1639 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1640 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1641 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1642 | | - aConstraints.gridx += 1; |
---|
1643 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1644 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1645 | | - aConstraints.gridx = 0; |
---|
1646 | | - aConstraints.gridy += 1; |
---|
1647 | | - aConstraints.gridwidth = 1; |
---|
1648 | | - |
---|
1649 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1650 | | - Return(); |
---|
| 1681 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1682 | + //Return(); |
---|
1651 | 1683 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1652 | 1684 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1653 | 1685 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1658 | 1690 | // aConstraints.gridy += 1; |
---|
1659 | 1691 | // aConstraints.gridwidth = 1; |
---|
1660 | 1692 | |
---|
1661 | | - //aConstraints.weighty = 1; |
---|
1662 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1663 | | - //aConstraints.gridx += 1; |
---|
1664 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1665 | | - aConstraints.weighty = 0; |
---|
1666 | | - aConstraints.gridx = 0; |
---|
1667 | | - aConstraints.gridy += 1; |
---|
1668 | | - aConstraints.gridwidth = 1; |
---|
1669 | 1693 | |
---|
1670 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1671 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1672 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1673 | | - aConstraints.gridx += 1; |
---|
1674 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1675 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1676 | | - aConstraints.gridx = 0; |
---|
1677 | | - aConstraints.gridy += 1; |
---|
1678 | | - aConstraints.gridwidth = 1; |
---|
| 1694 | + panel.add(new JSeparator()); |
---|
| 1695 | + |
---|
| 1696 | + panel.add(specularSection); |
---|
| 1697 | + |
---|
| 1698 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1699 | + |
---|
| 1700 | + cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1679 | 1701 | |
---|
1680 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1681 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1682 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1683 | | - aConstraints.gridx += 1; |
---|
1684 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1685 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1686 | | - aConstraints.gridx = 0; |
---|
1687 | | - aConstraints.gridy += 1; |
---|
1688 | | - aConstraints.gridwidth = 1; |
---|
| 1702 | + cGridBag camera = new cGridBag(); |
---|
| 1703 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 1704 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1705 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1706 | + globalSection.add(camera); |
---|
1689 | 1707 | |
---|
1690 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1691 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1692 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1693 | | - aConstraints.gridx += 1; |
---|
1694 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1695 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1696 | | - aConstraints.gridx = 0; |
---|
1697 | | - aConstraints.gridy += 1; |
---|
1698 | | - aConstraints.gridwidth = 1; |
---|
| 1708 | + cGridBag ambient = new cGridBag(); |
---|
| 1709 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 1710 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1711 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1712 | + globalSection.add(ambient); |
---|
1699 | 1713 | |
---|
1700 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1701 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1702 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1703 | | - aConstraints.gridx += 1; |
---|
1704 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1705 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1706 | | - aConstraints.gridx = 0; |
---|
1707 | | - aConstraints.gridy += 1; |
---|
1708 | | - aConstraints.gridwidth = 1; |
---|
1709 | | - aConstraints.weighty = 0; |
---|
| 1714 | + cGridBag backlit = new cGridBag(); |
---|
| 1715 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 1716 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1717 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1718 | + globalSection.add(backlit); |
---|
1710 | 1719 | |
---|
1711 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1712 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1713 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1714 | | - aConstraints.gridx += 1; |
---|
1715 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1716 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1717 | | - aConstraints.gridx = 0; |
---|
1718 | | - aConstraints.gridy += 1; |
---|
1719 | | - aConstraints.gridwidth = 1; |
---|
| 1720 | + cGridBag opacity = new cGridBag(); |
---|
| 1721 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1722 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1723 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1724 | + globalSection.add(opacity); |
---|
1720 | 1725 | |
---|
1721 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1722 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1723 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1724 | | - aConstraints.gridx += 1; |
---|
1725 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1726 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1727 | | - aConstraints.gridx = 0; |
---|
1728 | | - aConstraints.gridy += 1; |
---|
1729 | | - aConstraints.gridwidth = 1; |
---|
| 1726 | + panel.add(new JSeparator()); |
---|
| 1727 | + |
---|
| 1728 | + panel.add(globalSection); |
---|
| 1729 | + |
---|
| 1730 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1731 | + |
---|
| 1732 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1730 | 1733 | |
---|
1731 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1732 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1733 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1734 | | - aConstraints.gridx += 1; |
---|
1735 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1736 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1737 | | - aConstraints.gridx = 0; |
---|
1738 | | - aConstraints.gridy += 1; |
---|
1739 | | - aConstraints.gridwidth = 1; |
---|
| 1734 | + cGridBag bump = new cGridBag(); |
---|
| 1735 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 1736 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1737 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1738 | + textureSection.add(bump); |
---|
1740 | 1739 | |
---|
1741 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1742 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1743 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1744 | | - aConstraints.gridx += 1; |
---|
1745 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1746 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1747 | | - aConstraints.gridx = 0; |
---|
1748 | | - aConstraints.gridy += 1; |
---|
1749 | | - aConstraints.gridwidth = 1; |
---|
| 1740 | + cGridBag noise = new cGridBag(); |
---|
| 1741 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 1742 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1743 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 1744 | + textureSection.add(noise); |
---|
1750 | 1745 | |
---|
1751 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1752 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1753 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1754 | | - aConstraints.gridx += 1; |
---|
1755 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1756 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1757 | | - aConstraints.gridx = 0; |
---|
1758 | | - aConstraints.gridy += 1; |
---|
1759 | | - aConstraints.gridwidth = 1; |
---|
| 1746 | + cGridBag power = new cGridBag(); |
---|
| 1747 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 1748 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1749 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 1750 | + textureSection.add(power); |
---|
1760 | 1751 | |
---|
1761 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1762 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1763 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1764 | | - aConstraints.gridx += 1; |
---|
1765 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1766 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1767 | | - aConstraints.gridx = 0; |
---|
1768 | | - aConstraints.gridy += 1; |
---|
1769 | | - aConstraints.gridwidth = 1; |
---|
| 1752 | + cGridBag borderfade = new cGridBag(); |
---|
| 1753 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 1754 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1755 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1756 | + textureSection.add(borderfade); |
---|
1770 | 1757 | |
---|
1771 | | - //aConstraints.weighty = 1; |
---|
1772 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1773 | | - //aConstraints.gridx += 1; |
---|
1774 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1775 | | - aConstraints.weighty = 0; |
---|
| 1758 | + cGridBag fog = new cGridBag(); |
---|
| 1759 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 1760 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1761 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 1762 | + textureSection.add(fog); |
---|
1776 | 1763 | |
---|
1777 | | - aConstraints.gridx = 0; |
---|
1778 | | - aConstraints.gridy = 0; |
---|
1779 | | - aConstraints.gridwidth = 1; |
---|
| 1764 | + cGridBag opacityPower = new cGridBag(); |
---|
| 1765 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 1766 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1767 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 1768 | + textureSection.add(opacityPower); |
---|
| 1769 | + |
---|
| 1770 | + panel.add(new JSeparator()); |
---|
| 1771 | + |
---|
| 1772 | + panel.add(textureSection); |
---|
| 1773 | + |
---|
| 1774 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1780 | 1775 | |
---|
1781 | 1776 | SetMaterial(copy); // .GetMaterial()); |
---|
1782 | 1777 | |
---|
1783 | | - colorField.addChangeListener(this); |
---|
1784 | | - modulationField.addChangeListener(this); |
---|
| 1778 | + //colorField.addChangeListener(this); |
---|
| 1779 | +// modulationField.addChangeListener(this); |
---|
1785 | 1780 | metalnessField.addChangeListener(this); |
---|
1786 | 1781 | diffuseField.addChangeListener(this); |
---|
1787 | 1782 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1811 | 1806 | opacityPowerField.addChangeListener(this); |
---|
1812 | 1807 | /**/ |
---|
1813 | 1808 | |
---|
1814 | | - resetSlidersButton.addActionListener(this); |
---|
1815 | 1809 | clearMaterialButton.addActionListener(this); |
---|
1816 | 1810 | createMaterialButton.addActionListener(this); |
---|
1817 | | - |
---|
1818 | | - propagateToggle.addItemListener(this); |
---|
1819 | | - multiplyToggle.addItemListener(this); |
---|
| 1811 | + |
---|
| 1812 | + if (Globals.ADVANCED) |
---|
| 1813 | + { |
---|
| 1814 | + resetSlidersButton.addActionListener(this); |
---|
| 1815 | + propagateToggle.addItemListener(this); |
---|
| 1816 | + multiplyToggle.addItemListener(this); |
---|
| 1817 | + } |
---|
1820 | 1818 | } |
---|
1821 | 1819 | |
---|
1822 | 1820 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1987 | 1985 | |
---|
1988 | 1986 | //? flashIt = false; |
---|
1989 | 1987 | CameraPane pane = (CameraPane) cameraView; |
---|
1990 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 1988 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1991 | 1989 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1992 | 1990 | |
---|
1993 | 1991 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2036 | 2034 | e2.printStackTrace(); |
---|
2037 | 2035 | } |
---|
2038 | 2036 | } |
---|
| 2037 | + |
---|
2039 | 2038 | LoadJMEThread loadThread; |
---|
2040 | 2039 | |
---|
2041 | 2040 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2093 | 2092 | //LoadFile0(filename, converter); |
---|
2094 | 2093 | } |
---|
2095 | 2094 | } |
---|
| 2095 | + |
---|
2096 | 2096 | LoadOBJThread loadObjThread; |
---|
2097 | 2097 | |
---|
2098 | 2098 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2171 | 2171 | |
---|
2172 | 2172 | void LoadObjFile(String fullname) |
---|
2173 | 2173 | { |
---|
2174 | | - /* |
---|
| 2174 | + System.out.println("Loading " + fullname); |
---|
| 2175 | + /**/ |
---|
2175 | 2176 | //lastFilename = fullname; |
---|
2176 | 2177 | if(loadObjThread == null) |
---|
2177 | 2178 | { |
---|
2178 | | - loadObjThread = new LoadOBJThread(); |
---|
2179 | | - loadObjThread.start(); |
---|
| 2179 | + loadObjThread = new LoadOBJThread(); |
---|
| 2180 | + loadObjThread.start(); |
---|
2180 | 2181 | } |
---|
2181 | 2182 | |
---|
2182 | 2183 | loadObjThread.add(fullname); |
---|
2183 | | - */ |
---|
| 2184 | + /**/ |
---|
2184 | 2185 | |
---|
2185 | | - System.out.println("Loading " + fullname); |
---|
2186 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2186 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2187 | 2187 | } |
---|
2188 | 2188 | |
---|
2189 | 2189 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2444 | 2444 | |
---|
2445 | 2445 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2446 | 2446 | { |
---|
2447 | | - if (GrafreeD.standAlone) |
---|
| 2447 | + if (Grafreed.standAlone) |
---|
2448 | 2448 | { |
---|
2449 | 2449 | /**/ |
---|
2450 | 2450 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2451 | | - browser.show(); |
---|
| 2451 | + browser.setVisible(true); |
---|
2452 | 2452 | String filename = browser.getFile(); |
---|
2453 | 2453 | if (filename != null && filename.length() > 0) |
---|
2454 | 2454 | { |
---|
.. | .. |
---|
2593 | 2593 | } |
---|
2594 | 2594 | if (input == null) |
---|
2595 | 2595 | { |
---|
| 2596 | + new Exception().printStackTrace(); |
---|
2596 | 2597 | System.exit(0); |
---|
2597 | 2598 | } |
---|
2598 | 2599 | |
---|
.. | .. |
---|
2807 | 2808 | return; |
---|
2808 | 2809 | } |
---|
2809 | 2810 | |
---|
2810 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2811 | + if (multiplyToggle != null) |
---|
| 2812 | + multiplyToggle.setSelected(mat.multiply); |
---|
2811 | 2813 | |
---|
2812 | 2814 | assert (object.projectedVertices != null); |
---|
2813 | 2815 | |
---|
.. | .. |
---|
2996 | 2998 | if (timeline) |
---|
2997 | 2999 | { |
---|
2998 | 3000 | centralPanel.remove(cameraView); |
---|
2999 | | - centralPanel.add(timelinePanel); |
---|
| 3001 | + cameraPanel.add(cameraView); |
---|
| 3002 | + centralPanel.add(cameraPanel); |
---|
3000 | 3003 | frame.setJMenuBar(timelineMenubar); |
---|
3001 | 3004 | wasFullScreen = CameraPane.FULLSCREEN; |
---|
3002 | 3005 | if (!CameraPane.FULLSCREEN) |
---|
.. | .. |
---|
3005 | 3008 | } |
---|
3006 | 3009 | else |
---|
3007 | 3010 | { |
---|
3008 | | - centralPanel.remove(timelinePanel); |
---|
| 3011 | + centralPanel.remove(cameraPanel); |
---|
3009 | 3012 | centralPanel.add(cameraView); |
---|
3010 | 3013 | frame.setJMenuBar(null); |
---|
3011 | 3014 | if (!wasFullScreen) |
---|
.. | .. |
---|
3021 | 3024 | frame.validate(); |
---|
3022 | 3025 | |
---|
3023 | 3026 | return; |
---|
3024 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3027 | + } else if (event.getSource() == toggleSwitchItem) |
---|
3025 | 3028 | { |
---|
3026 | | - cameraView.ToggleRandom(); |
---|
| 3029 | + cameraView.ToggleSwitch(); |
---|
3027 | 3030 | cameraView.repaint(); |
---|
3028 | 3031 | return; |
---|
3029 | 3032 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3052 | 3055 | { |
---|
3053 | 3056 | copy.live ^= true; |
---|
3054 | 3057 | return; |
---|
| 3058 | + } else if (event.getSource() == selectCB) |
---|
| 3059 | + { |
---|
| 3060 | + copy.dontselect ^= true; |
---|
| 3061 | + return; |
---|
3055 | 3062 | } else if (event.getSource() == hideCB) |
---|
3056 | 3063 | { |
---|
3057 | 3064 | copy.hide ^= true; |
---|
.. | .. |
---|
3066 | 3073 | if (event.getSource() == randomCB) |
---|
3067 | 3074 | { |
---|
3068 | 3075 | copy.random ^= true; |
---|
| 3076 | + objEditor.refreshContents(); |
---|
3069 | 3077 | return; |
---|
3070 | 3078 | } |
---|
3071 | 3079 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3089 | 3097 | |
---|
3090 | 3098 | public void actionPerformed(ActionEvent event) |
---|
3091 | 3099 | { |
---|
| 3100 | + Object source = event.getSource(); |
---|
3092 | 3101 | // SCRIPT DIALOG |
---|
3093 | | - if (event.getSource() == okbutton) |
---|
| 3102 | + if (source == okbutton) |
---|
3094 | 3103 | { |
---|
3095 | 3104 | textpanel.setVisible(false); |
---|
3096 | 3105 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3102 | 3111 | textarea = null; |
---|
3103 | 3112 | textpanel = null; |
---|
3104 | 3113 | } |
---|
3105 | | - if (event.getSource() == cancelbutton) |
---|
| 3114 | + if (source == cancelbutton) |
---|
3106 | 3115 | { |
---|
3107 | 3116 | textpanel.setVisible(false); |
---|
3108 | 3117 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3114 | 3123 | //applySelf(); |
---|
3115 | 3124 | //client.refreshEditWindow(); |
---|
3116 | 3125 | //refreshContents(); |
---|
3117 | | - if (event.getSource() == nameField) |
---|
| 3126 | + if (source == nameField) |
---|
3118 | 3127 | { |
---|
3119 | 3128 | //System.out.println("ObjEditor " + event); |
---|
3120 | 3129 | applySelf0(true); |
---|
3121 | 3130 | //parent.applySelf(); |
---|
3122 | 3131 | objEditor.refreshContents(); |
---|
3123 | | - } else if (event.getSource() == resetButton) |
---|
| 3132 | + } else if (source == resetButton) |
---|
3124 | 3133 | { |
---|
3125 | 3134 | CameraPane.fullreset = true; |
---|
3126 | 3135 | copy.Reset(); // ResetMeshes(); |
---|
3127 | 3136 | copy.Touch(); |
---|
3128 | 3137 | objEditor.refreshContents(); |
---|
3129 | | - } else if (event.getSource() == stepItem) |
---|
| 3138 | + } else if (source == stepItem) |
---|
3130 | 3139 | { |
---|
3131 | | - cameraView.ONESTEP = true; |
---|
| 3140 | + //cameraView.ONESTEP = true; |
---|
| 3141 | + Globals.ONESTEP = true; |
---|
3132 | 3142 | cameraView.repaint(); |
---|
3133 | 3143 | return; |
---|
3134 | | - } else if (event.getSource() == stepButton) |
---|
| 3144 | + } else if (source == stepButton) |
---|
3135 | 3145 | { |
---|
3136 | 3146 | copy.Step(); |
---|
3137 | 3147 | copy.Touch(); |
---|
3138 | 3148 | objEditor.refreshContents(); |
---|
3139 | | - } else if (event.getSource() == slowerButton) |
---|
| 3149 | + } else if (source == slowerButton) |
---|
3140 | 3150 | { |
---|
3141 | 3151 | copy.Slower(); |
---|
3142 | 3152 | copy.Touch(); |
---|
3143 | 3153 | objEditor.refreshContents(); |
---|
3144 | | - } else if (event.getSource() == fasterButton) |
---|
| 3154 | + } else if (source == fasterButton) |
---|
3145 | 3155 | { |
---|
3146 | 3156 | copy.Faster(); |
---|
3147 | 3157 | copy.Touch(); |
---|
3148 | 3158 | objEditor.refreshContents(); |
---|
3149 | | - } else if (event.getSource() == remarkButton) |
---|
| 3159 | + } else if (source == remarkButton) |
---|
3150 | 3160 | { |
---|
3151 | 3161 | copy.Remark(); |
---|
3152 | 3162 | copy.Touch(); |
---|
3153 | 3163 | objEditor.refreshContents(); |
---|
3154 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3164 | + } else if (source == stepAllButton) |
---|
3155 | 3165 | { |
---|
3156 | 3166 | copy.StepAll(); |
---|
3157 | 3167 | copy.Touch(); |
---|
3158 | 3168 | objEditor.refreshContents(); |
---|
3159 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3169 | + } else if (source == resetAllButton) |
---|
3160 | 3170 | { |
---|
3161 | 3171 | //CameraPane.fullreset = true; |
---|
3162 | 3172 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3189 | 3199 | // Close(); |
---|
3190 | 3200 | // } |
---|
3191 | 3201 | // else |
---|
3192 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3202 | + if (source == resetSlidersButton) |
---|
3193 | 3203 | { |
---|
3194 | 3204 | ResetSliders(); |
---|
3195 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3205 | + } else if (source == clearMaterialButton) |
---|
3196 | 3206 | { |
---|
3197 | 3207 | ClearMaterial(); |
---|
3198 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3208 | + } else if (source == createMaterialButton) |
---|
3199 | 3209 | { |
---|
3200 | 3210 | CreateMaterial(); |
---|
3201 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3211 | + } else if (source == clearPanelButton) |
---|
3202 | 3212 | { |
---|
3203 | 3213 | copy.ClearUI(); |
---|
3204 | 3214 | refreshContents(true); |
---|
3205 | | - } /* |
---|
3206 | | - } |
---|
3207 | | - |
---|
3208 | | - public boolean action(Event event, Object arg) |
---|
3209 | | - { |
---|
3210 | | - */ else if (event.getSource() == closeItem) |
---|
| 3215 | + } else if (source == importGFDItem) |
---|
| 3216 | + { |
---|
| 3217 | + ImportGFD(); |
---|
| 3218 | + } else |
---|
| 3219 | + if (source == importVRMLX3DItem) |
---|
| 3220 | + { |
---|
| 3221 | + ImportVRMLX3D(); |
---|
| 3222 | + } else |
---|
| 3223 | + if (source == import3DSItem) |
---|
| 3224 | + { |
---|
| 3225 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3226 | + } else |
---|
| 3227 | + if (source == importOBJItem) |
---|
| 3228 | + { |
---|
| 3229 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3230 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3231 | + browser.setVisible(true); |
---|
| 3232 | + String filename = browser.getFile(); |
---|
| 3233 | + if (filename != null && filename.length() > 0) |
---|
| 3234 | + { |
---|
| 3235 | + String fullname = browser.getDirectory() + filename; |
---|
| 3236 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3237 | + } |
---|
| 3238 | + } else |
---|
| 3239 | + if (source == closeItem) |
---|
3211 | 3240 | { |
---|
3212 | 3241 | Close(); |
---|
3213 | 3242 | //return true; |
---|
3214 | | - } else if (event.getSource() == loadItem) |
---|
| 3243 | + } else if (source == loadItem) |
---|
3215 | 3244 | { |
---|
3216 | 3245 | load(); |
---|
3217 | 3246 | //return true; |
---|
3218 | | - } else if (event.getSource() == saveItem) |
---|
| 3247 | + } else if (source == newItem) |
---|
| 3248 | + { |
---|
| 3249 | + New(); |
---|
| 3250 | + } else if (source == saveItem) |
---|
3219 | 3251 | { |
---|
3220 | 3252 | save(); |
---|
3221 | 3253 | //return true; |
---|
3222 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3254 | + } else if (source == saveAsItem) |
---|
3223 | 3255 | { |
---|
3224 | 3256 | saveAs(); |
---|
3225 | 3257 | //return true; |
---|
3226 | | - } else if (event.getSource() == reexportItem) |
---|
| 3258 | + } else if (source == reexportItem) |
---|
3227 | 3259 | { |
---|
3228 | 3260 | reexport(); |
---|
3229 | 3261 | //return true; |
---|
3230 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3262 | + } else if (source == exportAsItem) |
---|
3231 | 3263 | { |
---|
3232 | 3264 | export(); |
---|
3233 | 3265 | //return true; |
---|
3234 | | - } else if (event.getSource() == povItem) |
---|
| 3266 | + } else if (source == povItem) |
---|
3235 | 3267 | { |
---|
3236 | 3268 | generatePOV(); |
---|
3237 | 3269 | //return true; |
---|
3238 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3270 | + } else if (source == zBufferItem) |
---|
3239 | 3271 | { |
---|
3240 | 3272 | try |
---|
3241 | 3273 | { |
---|
.. | .. |
---|
3257 | 3289 | cameraView.repaint(); |
---|
3258 | 3290 | //return true; |
---|
3259 | 3291 | } |
---|
3260 | | - */ else if (event.getSource() == editCameraItem) |
---|
3261 | | - { |
---|
3262 | | - cameraView.ProtectCamera(); |
---|
3263 | | - cameraView.repaint(); |
---|
3264 | | - return; |
---|
3265 | | - } else if (event.getSource() == revertCameraItem) |
---|
3266 | | - { |
---|
3267 | | - cameraView.RevertCamera(); |
---|
3268 | | - cameraView.repaint(); |
---|
3269 | | - return; |
---|
3270 | | -// } else if (event.getSource() == textureButton) |
---|
3271 | | -// { |
---|
3272 | | -// return; // true; |
---|
3273 | | - } else // combos... |
---|
3274 | | - if (event.getSource() == texresMenu) |
---|
| 3292 | + */ else // combos... |
---|
| 3293 | + if (source == texresMenu) |
---|
3275 | 3294 | { |
---|
3276 | 3295 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3277 | 3296 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3283 | 3302 | } |
---|
3284 | 3303 | } |
---|
3285 | 3304 | |
---|
3286 | | - void ToggleAnimation() |
---|
| 3305 | + void New() |
---|
3287 | 3306 | { |
---|
3288 | | - if (!CameraPane.ANIMATION) |
---|
| 3307 | + while (copy.Size() > 1) |
---|
3289 | 3308 | { |
---|
3290 | | - FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3309 | + copy.remove(1); |
---|
| 3310 | + } |
---|
| 3311 | + |
---|
| 3312 | + ResetModel(); |
---|
| 3313 | + objEditor.refreshContents(); |
---|
| 3314 | + } |
---|
| 3315 | + |
---|
| 3316 | + static public byte[] Compress(Object3D o) |
---|
| 3317 | + { |
---|
| 3318 | + try |
---|
| 3319 | + { |
---|
| 3320 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3321 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3322 | + ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 3323 | + |
---|
| 3324 | + Object3D parent = o.parent; |
---|
| 3325 | + o.parent = null; |
---|
| 3326 | + |
---|
| 3327 | + out.writeObject(o); |
---|
| 3328 | + |
---|
| 3329 | + o.parent = parent; |
---|
| 3330 | + |
---|
| 3331 | + out.flush(); |
---|
| 3332 | + |
---|
| 3333 | + zstream.close(); |
---|
| 3334 | + out.close(); |
---|
| 3335 | + |
---|
| 3336 | + return baos.toByteArray(); |
---|
| 3337 | + } catch (Exception e) |
---|
| 3338 | + { |
---|
| 3339 | + System.err.println(e); |
---|
| 3340 | + return null; |
---|
| 3341 | + } |
---|
| 3342 | + } |
---|
| 3343 | + |
---|
| 3344 | + static public Object Uncompress(byte[] bytes) |
---|
| 3345 | + { |
---|
| 3346 | + System.out.println("#bytes = " + bytes.length); |
---|
| 3347 | + try |
---|
| 3348 | + { |
---|
| 3349 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3350 | + java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3351 | + ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 3352 | + Object obj = in.readObject(); |
---|
| 3353 | + in.close(); |
---|
| 3354 | + |
---|
| 3355 | + return obj; |
---|
| 3356 | + } catch (Exception e) |
---|
| 3357 | + { |
---|
| 3358 | + System.err.println(e); |
---|
| 3359 | + return null; |
---|
| 3360 | + } |
---|
| 3361 | + } |
---|
| 3362 | + |
---|
| 3363 | + static public Object clone(Object o) |
---|
| 3364 | + { |
---|
| 3365 | + try |
---|
| 3366 | + { |
---|
| 3367 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3368 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3369 | + |
---|
| 3370 | + out.writeObject(o); |
---|
| 3371 | + |
---|
| 3372 | + out.flush(); |
---|
| 3373 | + out.close(); |
---|
| 3374 | + |
---|
| 3375 | + byte[] bytes = baos.toByteArray(); |
---|
| 3376 | + |
---|
| 3377 | + System.out.println("clone = " + bytes.length); |
---|
| 3378 | + |
---|
| 3379 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3380 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3381 | + Object obj = in.readObject(); |
---|
| 3382 | + in.close(); |
---|
| 3383 | + |
---|
| 3384 | + return obj; |
---|
| 3385 | + } catch (Exception e) |
---|
| 3386 | + { |
---|
| 3387 | + System.err.println(e); |
---|
| 3388 | + return null; |
---|
| 3389 | + } |
---|
| 3390 | + } |
---|
| 3391 | + |
---|
| 3392 | + cRadio GetCurrentTab() |
---|
| 3393 | + { |
---|
| 3394 | + cRadio ab; |
---|
| 3395 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3396 | + { |
---|
| 3397 | + ab = (cRadio)e.nextElement(); |
---|
| 3398 | + if(ab.GetObject() == copy) |
---|
| 3399 | + { |
---|
| 3400 | + return ab; |
---|
| 3401 | + } |
---|
| 3402 | + } |
---|
| 3403 | + |
---|
| 3404 | + return null; |
---|
| 3405 | + } |
---|
| 3406 | + |
---|
| 3407 | + java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3408 | + |
---|
| 3409 | + public void Save() |
---|
| 3410 | + { |
---|
| 3411 | + cRadio tab = GetCurrentTab(); |
---|
| 3412 | + |
---|
| 3413 | + boolean temp = CameraPane.SWITCH; |
---|
| 3414 | + CameraPane.SWITCH = false; |
---|
| 3415 | + |
---|
| 3416 | + copy.ExtractBigData(hashtable); |
---|
| 3417 | + |
---|
| 3418 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3419 | + tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3420 | + |
---|
| 3421 | + copy.RestoreBigData(hashtable); |
---|
| 3422 | + |
---|
| 3423 | + CameraPane.SWITCH = temp; |
---|
| 3424 | + |
---|
| 3425 | + //assert(hashtable.isEmpty()); |
---|
| 3426 | + |
---|
| 3427 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3428 | + { |
---|
| 3429 | + tab.graphs[i] = null; |
---|
| 3430 | + } |
---|
| 3431 | + |
---|
| 3432 | + // test save |
---|
| 3433 | + if (false) |
---|
| 3434 | + { |
---|
| 3435 | + try |
---|
| 3436 | + { |
---|
| 3437 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3438 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3439 | + |
---|
| 3440 | + p.writeObject(copy); |
---|
| 3441 | + |
---|
| 3442 | + p.flush(); |
---|
| 3443 | + |
---|
| 3444 | + ostream.close(); |
---|
| 3445 | + } catch (Exception e) |
---|
| 3446 | + { |
---|
| 3447 | + e.printStackTrace(); |
---|
| 3448 | + } |
---|
| 3449 | + } |
---|
| 3450 | + } |
---|
| 3451 | + |
---|
| 3452 | + void CopyChanged(Object3D obj) |
---|
| 3453 | + { |
---|
| 3454 | + boolean temp = CameraPane.SWITCH; |
---|
| 3455 | + CameraPane.SWITCH = false; |
---|
| 3456 | + |
---|
| 3457 | + copy.ExtractBigData(hashtable); |
---|
| 3458 | + |
---|
| 3459 | + copy.clear(); |
---|
| 3460 | + |
---|
| 3461 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3462 | + { |
---|
| 3463 | + copy.add(obj.get(i)); |
---|
| 3464 | + } |
---|
| 3465 | + |
---|
| 3466 | + copy.RestoreBigData(hashtable); |
---|
| 3467 | + |
---|
| 3468 | + CameraPane.SWITCH = temp; |
---|
| 3469 | + |
---|
| 3470 | + //assert(hashtable.isEmpty()); |
---|
| 3471 | + |
---|
| 3472 | + copy.Touch(); |
---|
| 3473 | + |
---|
| 3474 | + ResetModel(); |
---|
| 3475 | + copy.HardTouch(); // recompile? |
---|
| 3476 | + |
---|
| 3477 | + cRadio ab; |
---|
| 3478 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3479 | + { |
---|
| 3480 | + ab = (cRadio)e.nextElement(); |
---|
| 3481 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3482 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3483 | + if (test != null) |
---|
| 3484 | + { |
---|
| 3485 | + test.editWindow = ab.object.editWindow; |
---|
| 3486 | + ab.object = test; |
---|
| 3487 | + } |
---|
| 3488 | + } |
---|
| 3489 | + |
---|
| 3490 | + refreshContents(); |
---|
| 3491 | + } |
---|
| 3492 | + |
---|
| 3493 | + public void Undo() |
---|
| 3494 | + { |
---|
| 3495 | + cRadio tab = GetCurrentTab(); |
---|
| 3496 | + |
---|
| 3497 | + if (tab.undoindex == 0) |
---|
| 3498 | + { |
---|
| 3499 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3500 | + return; |
---|
| 3501 | + } |
---|
| 3502 | + |
---|
| 3503 | + if (tab.graphs[tab.undoindex] == null) |
---|
| 3504 | + { |
---|
| 3505 | + Save(); |
---|
| 3506 | + tab.undoindex -= 1; |
---|
| 3507 | + } |
---|
| 3508 | + |
---|
| 3509 | + tab.undoindex -= 1; |
---|
| 3510 | + |
---|
| 3511 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3512 | + } |
---|
| 3513 | + |
---|
| 3514 | + public void Redo() |
---|
| 3515 | + { |
---|
| 3516 | + cRadio tab = GetCurrentTab(); |
---|
| 3517 | + |
---|
| 3518 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3519 | + { |
---|
| 3520 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3521 | + return; |
---|
| 3522 | + } |
---|
| 3523 | + |
---|
| 3524 | + tab.undoindex += 1; |
---|
| 3525 | + |
---|
| 3526 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3527 | + } |
---|
| 3528 | + |
---|
| 3529 | + void ImportGFD() |
---|
| 3530 | + { |
---|
| 3531 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
3291 | 3532 | browser.show(); |
---|
3292 | 3533 | String filename = browser.getFile(); |
---|
3293 | 3534 | if (filename != null && filename.length() > 0) |
---|
3294 | 3535 | { |
---|
3295 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3536 | + String fullname = browser.getDirectory() + filename; |
---|
| 3537 | + |
---|
| 3538 | + //Object3D readobj = |
---|
| 3539 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3540 | + //makeSomething(readobj); |
---|
| 3541 | + } |
---|
| 3542 | + } |
---|
| 3543 | + |
---|
| 3544 | + void ImportVRMLX3D() |
---|
| 3545 | + { |
---|
| 3546 | + if (Grafreed.standAlone) |
---|
| 3547 | + { |
---|
| 3548 | + /**/ |
---|
| 3549 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3550 | + browser.show(); |
---|
| 3551 | + String filename = browser.getFile(); |
---|
| 3552 | + if (filename != null && filename.length() > 0) |
---|
| 3553 | + { |
---|
| 3554 | + String fullname = browser.getDirectory() + filename; |
---|
| 3555 | + LoadVRMLX3D(fullname); |
---|
| 3556 | + } |
---|
| 3557 | + /**/ |
---|
| 3558 | + } |
---|
| 3559 | + } |
---|
| 3560 | + |
---|
| 3561 | + void ToggleAnimation() |
---|
| 3562 | + { |
---|
| 3563 | + if (!Globals.ANIMATION) |
---|
| 3564 | + { |
---|
| 3565 | + FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3566 | + browser.setVisible(true); |
---|
| 3567 | + String filename = browser.getFile(); |
---|
| 3568 | + if (filename != null && filename.length() > 0) |
---|
| 3569 | + { |
---|
| 3570 | + Globals.filename = browser.getDirectory() + filename; |
---|
3296 | 3571 | //CameraPane.framecount = 0; |
---|
3297 | | - CameraPane.imagecount = 0; |
---|
| 3572 | + Globals.imagecount = 0; |
---|
3298 | 3573 | |
---|
3299 | | - CameraPane.ANIMATION ^= true; |
---|
| 3574 | + Globals.ANIMATION ^= true; |
---|
3300 | 3575 | |
---|
3301 | | - GrafreeD.wav.cursor = 0; |
---|
3302 | | - GrafreeD.wav.loop = 0; |
---|
| 3576 | + Grafreed.wav.cursor = 0; |
---|
| 3577 | + Grafreed.wav.loop = 0; |
---|
3303 | 3578 | } |
---|
3304 | 3579 | } else |
---|
3305 | 3580 | { |
---|
3306 | | - CameraPane.ANIMATION ^= true; |
---|
| 3581 | + Globals.ANIMATION ^= true; |
---|
3307 | 3582 | } |
---|
3308 | 3583 | } |
---|
3309 | 3584 | |
---|
.. | .. |
---|
3349 | 3624 | void CreateMaterial() |
---|
3350 | 3625 | { |
---|
3351 | 3626 | //copy.ClearMaterial(); // PATCH |
---|
3352 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3627 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3353 | 3628 | if (copy.selection.size() > 0) |
---|
3354 | 3629 | //SetMaterial(copy); |
---|
3355 | 3630 | { |
---|
.. | .. |
---|
3408 | 3683 | { |
---|
3409 | 3684 | copy.ResetBlockLoop(); // temporary problem |
---|
3410 | 3685 | |
---|
3411 | | - boolean random = CameraPane.RANDOM; |
---|
3412 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3686 | + boolean random = CameraPane.SWITCH; |
---|
| 3687 | + CameraPane.SWITCH = false; // parse everything |
---|
3413 | 3688 | copy.ResetDisplayList(); |
---|
3414 | 3689 | copy.HardTouch(); |
---|
3415 | | - CameraPane.RANDOM = random; |
---|
| 3690 | + CameraPane.SWITCH = random; |
---|
3416 | 3691 | } |
---|
3417 | 3692 | |
---|
3418 | 3693 | // public void applySelf() |
---|
.. | .. |
---|
3482 | 3757 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3483 | 3758 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3484 | 3759 | |
---|
3485 | | - if (!NumberSlider.frozen) |
---|
| 3760 | + if (!cNumberSlider.frozen) |
---|
3486 | 3761 | { |
---|
3487 | 3762 | //System.out.println("Propagate = " + propagate); |
---|
3488 | 3763 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 3764 | + |
---|
| 3765 | + if (copy.material != null) |
---|
| 3766 | + { |
---|
| 3767 | + cMaterial mat = copy.material; |
---|
| 3768 | + |
---|
| 3769 | + colorField.SetToolTipValue((mat.color)); |
---|
| 3770 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 3771 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 3772 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 3773 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 3774 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 3775 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 3776 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 3777 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 3778 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 3779 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 3780 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 3781 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 3782 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 3783 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 3784 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 3785 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 3786 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 3787 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 3788 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 3789 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 3790 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 3791 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 3792 | + } |
---|
| 3793 | + |
---|
3489 | 3794 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3490 | 3795 | { |
---|
3491 | 3796 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3530 | 3835 | || e.getSource() == apertureField |
---|
3531 | 3836 | || e.getSource() == shadowblurField) |
---|
3532 | 3837 | { |
---|
| 3838 | + new Exception().printStackTrace(); |
---|
3533 | 3839 | System.exit(0); |
---|
3534 | 3840 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3535 | 3841 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3600 | 3906 | } |
---|
3601 | 3907 | |
---|
3602 | 3908 | if (normalpushField != null) |
---|
3603 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 3909 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3604 | 3910 | } |
---|
3605 | 3911 | |
---|
3606 | 3912 | void SnapObject() |
---|
.. | .. |
---|
3855 | 4161 | |
---|
3856 | 4162 | radioPanel.revalidate(); |
---|
3857 | 4163 | radioPanel.repaint(); |
---|
3858 | | - ctrlPanel.revalidate(); // ? new |
---|
| 4164 | + ctrlPanel.validate(); // ? new |
---|
3859 | 4165 | ctrlPanel.repaint(); |
---|
3860 | 4166 | } |
---|
3861 | 4167 | } |
---|
.. | .. |
---|
3864 | 4170 | |
---|
3865 | 4171 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3866 | 4172 | { |
---|
| 4173 | + Save(); |
---|
3867 | 4174 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3868 | 4175 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3869 | 4176 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
4067 | 4374 | } |
---|
4068 | 4375 | } |
---|
4069 | 4376 | } |
---|
| 4377 | + |
---|
4070 | 4378 | LoadGFDThread loadGFDThread; |
---|
4071 | 4379 | |
---|
4072 | 4380 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4086 | 4394 | |
---|
4087 | 4395 | try |
---|
4088 | 4396 | { |
---|
| 4397 | + // Try compressed version first. |
---|
4089 | 4398 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4090 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4399 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4400 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4091 | 4401 | |
---|
4092 | 4402 | readobj = (Object3D) p.readObject(); |
---|
4093 | 4403 | istream.close(); |
---|
.. | .. |
---|
4095 | 4405 | readobj.ResetDisplayList(); |
---|
4096 | 4406 | } catch (Exception e) |
---|
4097 | 4407 | { |
---|
4098 | | - e.printStackTrace(); |
---|
| 4408 | + //e.printStackTrace(); |
---|
| 4409 | + try |
---|
| 4410 | + { |
---|
| 4411 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4412 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4413 | + |
---|
| 4414 | + readobj = (Object3D) p.readObject(); |
---|
| 4415 | + istream.close(); |
---|
| 4416 | + |
---|
| 4417 | + readobj.ResetDisplayList(); |
---|
| 4418 | + } catch (Exception e2) |
---|
| 4419 | + { |
---|
| 4420 | + e2.printStackTrace(); |
---|
| 4421 | + } |
---|
4099 | 4422 | } |
---|
4100 | 4423 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4101 | 4424 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4141 | 4464 | |
---|
4142 | 4465 | void LoadIt(Object obj) |
---|
4143 | 4466 | { |
---|
| 4467 | + if (obj == null) |
---|
| 4468 | + { |
---|
| 4469 | + // Invalid file |
---|
| 4470 | + return; |
---|
| 4471 | + } |
---|
| 4472 | + |
---|
4144 | 4473 | System.out.println("Loaded " + obj); |
---|
4145 | 4474 | //new Exception().printStackTrace(); |
---|
4146 | 4475 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4150 | 4479 | |
---|
4151 | 4480 | if (readobj != null) |
---|
4152 | 4481 | { |
---|
| 4482 | + Save(); |
---|
4153 | 4483 | try |
---|
4154 | 4484 | { |
---|
4155 | 4485 | //readobj.deepCopySelf(copy); |
---|
.. | .. |
---|
4212 | 4542 | |
---|
4213 | 4543 | void load() // throws ClassNotFoundException |
---|
4214 | 4544 | { |
---|
4215 | | - if (GrafreeD.standAlone) |
---|
| 4545 | + if (Grafreed.standAlone) |
---|
4216 | 4546 | { |
---|
4217 | 4547 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4218 | 4548 | browser.show(); |
---|
.. | .. |
---|
4299 | 4629 | try |
---|
4300 | 4630 | { |
---|
4301 | 4631 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4302 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4632 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4633 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4303 | 4634 | |
---|
4304 | 4635 | p.writeObject(copy); |
---|
4305 | 4636 | p.flush(); |
---|
4306 | 4637 | |
---|
| 4638 | + zstream.close(); |
---|
4307 | 4639 | ostream.close(); |
---|
4308 | 4640 | |
---|
4309 | 4641 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4313 | 4645 | { |
---|
4314 | 4646 | } |
---|
4315 | 4647 | } |
---|
| 4648 | + |
---|
4316 | 4649 | String lastname; |
---|
4317 | 4650 | |
---|
4318 | 4651 | void saveAs() |
---|
4319 | 4652 | { |
---|
4320 | | - if (GrafreeD.standAlone) |
---|
| 4653 | + if (Grafreed.standAlone) |
---|
4321 | 4654 | { |
---|
4322 | 4655 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4323 | 4656 | browser.setVisible(true); |
---|
.. | .. |
---|
4422 | 4755 | try |
---|
4423 | 4756 | { |
---|
4424 | 4757 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4425 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4426 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 4758 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4759 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4427 | 4760 | |
---|
4428 | 4761 | Object3D objectparent = obj.parent; |
---|
4429 | 4762 | obj.parent = null; |
---|
4430 | 4763 | |
---|
4431 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 4764 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4432 | 4765 | |
---|
4433 | 4766 | obj.parent = objectparent; |
---|
4434 | 4767 | |
---|
.. | .. |
---|
4440 | 4773 | p.writeObject(object); |
---|
4441 | 4774 | p.flush(); |
---|
4442 | 4775 | |
---|
| 4776 | + zstream.close(); |
---|
4443 | 4777 | ostream.close(); |
---|
4444 | | - // zstream.close(); |
---|
4445 | 4778 | |
---|
4446 | 4779 | // group.selection.get(0).parent = parent; |
---|
4447 | 4780 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4462 | 4795 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4463 | 4796 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4464 | 4797 | copy.generatePOV(buffer); |
---|
4465 | | - if (GrafreeD.standAlone) |
---|
| 4798 | + if (Grafreed.standAlone) |
---|
4466 | 4799 | { |
---|
4467 | 4800 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4468 | 4801 | browser.show(); |
---|
.. | .. |
---|
4488 | 4821 | Object3D client; |
---|
4489 | 4822 | Object3D copy; |
---|
4490 | 4823 | MenuBar menuBar; |
---|
4491 | | - Menu windowMenu; |
---|
| 4824 | + Menu fileMenu; |
---|
| 4825 | + MenuItem newItem; |
---|
4492 | 4826 | MenuItem loadItem; |
---|
4493 | 4827 | MenuItem saveItem; |
---|
4494 | 4828 | MenuItem saveAsItem; |
---|
.. | .. |
---|
4496 | 4830 | MenuItem reexportItem; |
---|
4497 | 4831 | MenuItem povItem; |
---|
4498 | 4832 | MenuItem closeItem; |
---|
4499 | | - Menu cameraMenu; |
---|
| 4833 | + |
---|
4500 | 4834 | CheckboxMenuItem zBufferItem; |
---|
4501 | 4835 | //MenuItem normalLensItem; |
---|
4502 | | - MenuItem editCameraItem; |
---|
4503 | | - MenuItem revertCameraItem; |
---|
4504 | | - CheckboxMenuItem toggleLiveItem; |
---|
4505 | 4836 | MenuItem stepItem; |
---|
| 4837 | + CheckboxMenuItem toggleLiveItem; |
---|
4506 | 4838 | CheckboxMenuItem toggleFullScreenItem; |
---|
4507 | 4839 | CheckboxMenuItem toggleTimelineItem; |
---|
4508 | 4840 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4511 | 4843 | CheckboxMenuItem toggleFootContactItem; |
---|
4512 | 4844 | CheckboxMenuItem toggleDLItem; |
---|
4513 | 4845 | CheckboxMenuItem toggleTextureItem; |
---|
4514 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 4846 | + CheckboxMenuItem toggleSwitchItem; |
---|
4515 | 4847 | CheckboxMenuItem toggleRootItem; |
---|
4516 | 4848 | CheckboxMenuItem animationItem; |
---|
4517 | 4849 | CheckboxMenuItem toggleHandleItem; |
---|
.. | .. |
---|
4519 | 4851 | JSplitPane mainPanel; |
---|
4520 | 4852 | JScrollPane scrollpane; |
---|
4521 | 4853 | JPanel toolbarPanel; |
---|
4522 | | - JPanel treePanel; |
---|
| 4854 | + cGridBag treePanel; |
---|
4523 | 4855 | JPanel radioPanel; |
---|
4524 | 4856 | ButtonGroup buttonGroup; |
---|
4525 | | - JPanel ctrlPanel; |
---|
4526 | | - JPanel materialPanel; |
---|
| 4857 | + cGridBag ctrlPanel; |
---|
| 4858 | + cGridBag materialPanel; |
---|
4527 | 4859 | JScrollPane infoPanel; |
---|
4528 | | - JPanel optionsPanel; |
---|
| 4860 | + cGridBag optionsPanel; |
---|
4529 | 4861 | JTabbedPane objectPanel; |
---|
4530 | | - JPanel XYZPanel; |
---|
| 4862 | + cGridBag XYZPanel; |
---|
4531 | 4863 | JSplitPane gridPanel; |
---|
4532 | 4864 | JSplitPane bigPanel; |
---|
4533 | | - JPanel bigThree; |
---|
4534 | | - JTabbedPane scenePanel; |
---|
4535 | | - JPanel centralPanel; |
---|
| 4865 | + cGridBag bigThree; |
---|
| 4866 | + cGridBag scenePanel; |
---|
| 4867 | + cGridBag centralPanel; |
---|
| 4868 | + JSplitPane cameraPanel; |
---|
4536 | 4869 | JPanel timelinePanel; |
---|
4537 | 4870 | JMenuBar timelineMenubar; |
---|
4538 | 4871 | JSplitPane framePanel; |
---|
.. | .. |
---|
4584 | 4917 | // MATERIAL |
---|
4585 | 4918 | JLabel materialLabel; |
---|
4586 | 4919 | JLabel colorLabel; |
---|
4587 | | - NumberSlider colorField; |
---|
| 4920 | + cNumberSlider colorField; |
---|
4588 | 4921 | JLabel modulationLabel; |
---|
4589 | | - NumberSlider modulationField; |
---|
| 4922 | + cNumberSlider modulationField; |
---|
4590 | 4923 | JLabel metalnessLabel; |
---|
4591 | | - NumberSlider metalnessField; |
---|
| 4924 | + cNumberSlider metalnessField; |
---|
4592 | 4925 | JLabel diffuseLabel; |
---|
4593 | | - NumberSlider diffuseField; |
---|
| 4926 | + cNumberSlider diffuseField; |
---|
4594 | 4927 | JLabel specularLabel; |
---|
4595 | | - NumberSlider specularField; |
---|
| 4928 | + cNumberSlider specularField; |
---|
4596 | 4929 | JLabel shininessLabel; |
---|
4597 | | - NumberSlider shininessField; |
---|
| 4930 | + cNumberSlider shininessField; |
---|
4598 | 4931 | JLabel shiftLabel; |
---|
4599 | | - NumberSlider shiftField; |
---|
| 4932 | + cNumberSlider shiftField; |
---|
4600 | 4933 | JLabel ambientLabel; |
---|
4601 | | - NumberSlider ambientField; |
---|
| 4934 | + cNumberSlider ambientField; |
---|
4602 | 4935 | JLabel lightareaLabel; |
---|
4603 | | - NumberSlider lightareaField; |
---|
| 4936 | + cNumberSlider lightareaField; |
---|
4604 | 4937 | JLabel diffusenessLabel; |
---|
4605 | | - NumberSlider diffusenessField; |
---|
| 4938 | + cNumberSlider diffusenessField; |
---|
4606 | 4939 | JLabel velvetLabel; |
---|
4607 | | - NumberSlider velvetField; |
---|
| 4940 | + cNumberSlider velvetField; |
---|
4608 | 4941 | JLabel sheenLabel; |
---|
4609 | | - NumberSlider sheenField; |
---|
| 4942 | + cNumberSlider sheenField; |
---|
4610 | 4943 | JLabel subsurfaceLabel; |
---|
4611 | | - NumberSlider subsurfaceField; |
---|
| 4944 | + cNumberSlider subsurfaceField; |
---|
4612 | 4945 | //JLabel bumpLabel; |
---|
4613 | 4946 | //NumberSlider bumpField; |
---|
4614 | 4947 | JLabel backlitLabel; |
---|
4615 | | - NumberSlider backlitField; |
---|
| 4948 | + cNumberSlider backlitField; |
---|
4616 | 4949 | JLabel anisoLabel; |
---|
4617 | | - NumberSlider anisoField; |
---|
| 4950 | + cNumberSlider anisoField; |
---|
4618 | 4951 | JLabel anisoVLabel; |
---|
4619 | | - NumberSlider anisoVField; |
---|
| 4952 | + cNumberSlider anisoVField; |
---|
4620 | 4953 | JLabel cameraLabel; |
---|
4621 | | - NumberSlider cameraField; |
---|
| 4954 | + cNumberSlider cameraField; |
---|
4622 | 4955 | JLabel selfshadowLabel; |
---|
4623 | | - NumberSlider selfshadowField; |
---|
| 4956 | + cNumberSlider selfshadowField; |
---|
4624 | 4957 | JLabel shadowLabel; |
---|
4625 | | - NumberSlider shadowField; |
---|
| 4958 | + cNumberSlider shadowField; |
---|
4626 | 4959 | JLabel textureLabel; |
---|
4627 | | - NumberSlider textureField; |
---|
| 4960 | + cNumberSlider textureField; |
---|
4628 | 4961 | JLabel opacityLabel; |
---|
4629 | | - NumberSlider opacityField; |
---|
| 4962 | + cNumberSlider opacityField; |
---|
4630 | 4963 | JLabel fakedepthLabel; |
---|
4631 | | - NumberSlider fakedepthField; |
---|
| 4964 | + cNumberSlider fakedepthField; |
---|
4632 | 4965 | JLabel shadowbiasLabel; |
---|
4633 | | - NumberSlider shadowbiasField; |
---|
| 4966 | + cNumberSlider shadowbiasField; |
---|
4634 | 4967 | JLabel bumpLabel; |
---|
4635 | | - NumberSlider bumpField; |
---|
| 4968 | + cNumberSlider bumpField; |
---|
4636 | 4969 | JLabel noiseLabel; |
---|
4637 | | - NumberSlider noiseField; |
---|
| 4970 | + cNumberSlider noiseField; |
---|
4638 | 4971 | JLabel powerLabel; |
---|
4639 | | - NumberSlider powerField; |
---|
| 4972 | + cNumberSlider powerField; |
---|
4640 | 4973 | JLabel borderfadeLabel; |
---|
4641 | | - NumberSlider borderfadeField; |
---|
| 4974 | + cNumberSlider borderfadeField; |
---|
4642 | 4975 | JLabel fogLabel; |
---|
4643 | | - NumberSlider fogField; |
---|
| 4976 | + cNumberSlider fogField; |
---|
4644 | 4977 | JLabel opacityPowerLabel; |
---|
4645 | | - NumberSlider opacityPowerField; |
---|
| 4978 | + cNumberSlider opacityPowerField; |
---|
4646 | 4979 | JTree jTree; |
---|
4647 | 4980 | //ObjectUI parent; |
---|
4648 | 4981 | |
---|
4649 | | - NumberSlider normalpushField; |
---|
| 4982 | + cNumberSlider normalpushField; |
---|
| 4983 | + |
---|
| 4984 | + private MenuItem importGFDItem; |
---|
| 4985 | + private MenuItem importVRMLX3DItem; |
---|
| 4986 | + private MenuItem import3DSItem; |
---|
| 4987 | + private MenuItem importOBJItem; |
---|
4650 | 4988 | } |
---|