.. | .. |
---|
138 | 138 | public void closeUI() |
---|
139 | 139 | { |
---|
140 | 140 | //new Exception().printStackTrace(); |
---|
141 | | - System.out.println("this = " + this); |
---|
142 | | - System.out.println("objEditor = " + objEditor); |
---|
| 141 | +// System.out.println("this = " + this); |
---|
| 142 | +// System.out.println("objEditor = " + objEditor); |
---|
143 | 143 | //nameField.removeActionListener(this); |
---|
144 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 144 | +// objEditor.ctrlPanel.remove(nameField); |
---|
| 145 | + |
---|
| 146 | + objEditor.ctrlPanel.remove(namePanel); |
---|
145 | 147 | |
---|
146 | 148 | if (!GroupEditor.allparams) |
---|
147 | 149 | return; |
---|
148 | 150 | |
---|
149 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
150 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
151 | | - objEditor.ctrlPanel.remove(markCB); |
---|
152 | | - |
---|
153 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
154 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
155 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
156 | | - |
---|
157 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
158 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
159 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
160 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
161 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
162 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
163 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
164 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
165 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
166 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 151 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 152 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 153 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 154 | +// |
---|
| 155 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 156 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 157 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 158 | +// |
---|
| 159 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 160 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 161 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 162 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 163 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 164 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 165 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 166 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 167 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 168 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
167 | 169 | |
---|
168 | | - Remove(normalpushField); |
---|
| 170 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 171 | + objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 172 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 173 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 174 | + |
---|
| 175 | + //Remove(normalpushField); |
---|
169 | 176 | } |
---|
170 | 177 | |
---|
171 | 178 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
269 | 276 | void SetupMenu() |
---|
270 | 277 | { |
---|
271 | 278 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
272 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
273 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
274 | | - windowMenu.add("-"); |
---|
275 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
276 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 279 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 280 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 281 | + fileMenu.add(loadItem = new MenuItem("Load...")); |
---|
| 282 | + |
---|
| 283 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 284 | + Menu menu = new Menu("Import"); |
---|
| 285 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 286 | + importOBJItem.addActionListener(this); |
---|
| 287 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 288 | + import3DSItem.addActionListener(this); |
---|
| 289 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 290 | + importVRMLX3DItem.addActionListener(this); |
---|
| 291 | + menu.add("-"); |
---|
| 292 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 293 | + importGFDItem.addActionListener(this); |
---|
| 294 | + fileMenu.add(menu); |
---|
| 295 | + fileMenu.add("-"); |
---|
| 296 | + |
---|
| 297 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 298 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
277 | 299 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
278 | | - windowMenu.add("-"); |
---|
279 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
280 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
281 | | - windowMenu.add("-"); |
---|
| 300 | + fileMenu.add("-"); |
---|
| 301 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 302 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 303 | + fileMenu.add("-"); |
---|
282 | 304 | if (client.parent != null) |
---|
283 | 305 | { |
---|
284 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 306 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
285 | 307 | } else |
---|
286 | 308 | { |
---|
287 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 309 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
288 | 310 | } |
---|
289 | 311 | |
---|
| 312 | + newItem.addActionListener(this); |
---|
290 | 313 | loadItem.addActionListener(this); |
---|
291 | 314 | saveItem.addActionListener(this); |
---|
292 | 315 | saveAsItem.addActionListener(this); |
---|
.. | .. |
---|
295 | 318 | //povItem.addActionListener(this); |
---|
296 | 319 | closeItem.addActionListener(this); |
---|
297 | 320 | |
---|
298 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
299 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
300 | | - //zBufferItem.addActionListener(this); |
---|
301 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
302 | | - //normalLensItem.addActionListener(this); |
---|
303 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
304 | | - revertCameraItem.addActionListener(this); |
---|
305 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
306 | | - toggleTimelineItem.addItemListener(this); |
---|
307 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
308 | | - toggleFullScreenItem.addItemListener(this); |
---|
309 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
310 | | - cameraMenu.add("-"); |
---|
311 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
312 | | - toggleTextureItem.addItemListener(this); |
---|
313 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
314 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
315 | | - toggleLiveItem.addItemListener(this); |
---|
316 | | - toggleLiveItem.setState(Globals.isLIVE()); |
---|
317 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
318 | | - stepItem.addActionListener(this); |
---|
319 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
320 | | -// toggleDLItem.addItemListener(this); |
---|
321 | | -// toggleDLItem.setState(false); |
---|
322 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
323 | | - toggleRenderItem.addItemListener(this); |
---|
324 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
325 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
326 | | - toggleDebugItem.addItemListener(this); |
---|
327 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
328 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
329 | | - toggleFrustumItem.addItemListener(this); |
---|
330 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
331 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
332 | | - toggleFootContactItem.addItemListener(this); |
---|
333 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
334 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
335 | | - toggleRandomItem.addItemListener(this); |
---|
336 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
337 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
338 | | - toggleHandleItem.addItemListener(this); |
---|
339 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
340 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
341 | | - togglePaintItem.addItemListener(this); |
---|
342 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
343 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
344 | | -// toggleRootItem.addItemListener(this); |
---|
345 | | -// toggleRootItem.setState(false); |
---|
346 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
347 | | -// animationItem.addItemListener(this); |
---|
348 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
349 | | - cameraMenu.add("-"); |
---|
350 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
351 | | - editCameraItem.addActionListener(this); |
---|
352 | | - |
---|
353 | 321 | objectPanel = new JTabbedPane(); |
---|
354 | 322 | toolbarPanel = new JPanel(); |
---|
355 | 323 | toolbarPanel.setName("Toolbar"); |
---|
356 | | - treePanel = new JPanel(); |
---|
| 324 | + treePanel = new cGridBag(); |
---|
357 | 325 | treePanel.setName("Tree"); |
---|
358 | | - ctrlPanel = new cGridBag(); // new GridBagLayout()); |
---|
| 326 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
359 | 327 | ctrlPanel.setName("Edit"); |
---|
360 | 328 | materialPanel = new cGridBag().setVertical(true); |
---|
361 | 329 | materialPanel.setName("Material"); |
---|
362 | 330 | /*JTextPane*/ |
---|
363 | 331 | infoarea = createTextPane(); |
---|
| 332 | + doc = infoarea.getStyledDocument(); |
---|
| 333 | + |
---|
364 | 334 | infoarea.setEditable(true); |
---|
365 | 335 | SetText(); |
---|
366 | 336 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
367 | 337 | // infoarea.setOpaque(false); |
---|
368 | 338 | // //infoarea.setForeground(textcolor); |
---|
369 | | - infoarea.setLineWrap(true); |
---|
370 | | - infoarea.setWrapStyleWord(true); |
---|
| 339 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 340 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
371 | 341 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
372 | 342 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
373 | 343 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
378 | 348 | mainPanel.setName("Main"); |
---|
379 | 349 | mainPanel.setContinuousLayout(true); |
---|
380 | 350 | mainPanel.setOneTouchExpandable(true); |
---|
381 | | - mainPanel.setDividerLocation(1.0); |
---|
382 | 351 | mainPanel.setDividerSize(9); |
---|
383 | | - mainPanel.setResizeWeight(0); |
---|
| 352 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 353 | + mainPanel.setResizeWeight(0.5); |
---|
384 | 354 | |
---|
385 | 355 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
386 | 356 | //mainPanel.setLayout(new GridBagLayout()); |
---|
387 | 357 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
388 | | - treePanel.setLayout(new GridBagLayout()); |
---|
389 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 358 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 359 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
390 | 360 | //materialPanel.setLayout(new GridBagLayout()); |
---|
391 | 361 | |
---|
392 | 362 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
.. | .. |
---|
426 | 396 | static String newline = "\n"; |
---|
427 | 397 | protected static final String buttonString = "JButton"; |
---|
428 | 398 | StyledDocument doc; |
---|
429 | | - JTextArea infoarea; |
---|
| 399 | + JTextPane infoarea; |
---|
430 | 400 | |
---|
431 | 401 | void ClearInfo() |
---|
432 | 402 | { |
---|
.. | .. |
---|
475 | 445 | //SendInfo("Name:", "bold"); |
---|
476 | 446 | if (sel.GetTextures() != null || debug) |
---|
477 | 447 | { |
---|
478 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 448 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
479 | 449 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
480 | 450 | if (sel.Size() > 0) |
---|
481 | 451 | { |
---|
482 | 452 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
483 | 453 | } |
---|
484 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 454 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
485 | 455 | if (debug) |
---|
486 | 456 | { |
---|
487 | 457 | try |
---|
.. | .. |
---|
493 | 463 | } |
---|
494 | 464 | |
---|
495 | 465 | if (full) |
---|
496 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 466 | + { |
---|
| 467 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 468 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 469 | + } |
---|
497 | 470 | |
---|
498 | 471 | if (sel.bRep != null) |
---|
499 | 472 | { |
---|
.. | .. |
---|
520 | 493 | } |
---|
521 | 494 | if (sel.support != null) |
---|
522 | 495 | { |
---|
523 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 496 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
524 | 497 | } |
---|
525 | 498 | if (sel.scriptnode != null) |
---|
526 | 499 | { |
---|
.. | .. |
---|
591 | 564 | { |
---|
592 | 565 | CameraPane.pointflow = (PointFlow) sel; |
---|
593 | 566 | } |
---|
| 567 | + |
---|
| 568 | + si.SendInfo("_____________________", "regular"); |
---|
| 569 | + si.SendInfo("", "regular"); |
---|
594 | 570 | } |
---|
595 | 571 | } |
---|
596 | 572 | |
---|
.. | .. |
---|
622 | 598 | cameraView.ToggleFullScreen(); |
---|
623 | 599 | } |
---|
624 | 600 | |
---|
625 | | - private JTextArea createTextPane() |
---|
| 601 | + private JTextPane createTextPane() |
---|
626 | 602 | { |
---|
627 | | - String[] initString = |
---|
628 | | - { |
---|
629 | | - "This is an editable JTextPane, ", //regular |
---|
630 | | - "another ", //italic |
---|
631 | | - "styled ", //bold |
---|
632 | | - "text ", //small |
---|
633 | | - "component, ", //large |
---|
634 | | - "which supports embedded components..." + newline,//regular |
---|
635 | | - " " + newline, //button |
---|
636 | | - "...and embedded icons..." + newline, //regular |
---|
637 | | - " ", //icon |
---|
638 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
639 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
640 | | - + "cover methods for interacting with those objects." |
---|
641 | | - }; |
---|
| 603 | +// TEXTAREA String[] initString = |
---|
| 604 | +// { |
---|
| 605 | +// "This is an editable JTextPane, ", //regular |
---|
| 606 | +// "another ", //italic |
---|
| 607 | +// "styled ", //bold |
---|
| 608 | +// "text ", //small |
---|
| 609 | +// "component, ", //large |
---|
| 610 | +// "which supports embedded components..." + newline,//regular |
---|
| 611 | +// " " + newline, //button |
---|
| 612 | +// "...and embedded icons..." + newline, //regular |
---|
| 613 | +// " ", //icon |
---|
| 614 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 615 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 616 | +// + "cover methods for interacting with those objects." |
---|
| 617 | +// }; |
---|
| 618 | +// |
---|
| 619 | +// String[] initStyles = |
---|
| 620 | +// { |
---|
| 621 | +// "regular", "italic", "bold", "small", "large", |
---|
| 622 | +// "regular", "button", "regular", "icon", |
---|
| 623 | +// "regular" |
---|
| 624 | +// }; |
---|
| 625 | +// |
---|
| 626 | +// JTextPane textPane = new JTextPane(); |
---|
| 627 | +// textPane.setEditable(true); |
---|
| 628 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 629 | +// addStylesToDocument(doc); |
---|
| 630 | +// |
---|
| 631 | +// try |
---|
| 632 | +// { |
---|
| 633 | +// for (int j = 0; j < 2; j++) |
---|
| 634 | +// { |
---|
| 635 | +// for (int i = 0; i < initString.length; i++) |
---|
| 636 | +// { |
---|
| 637 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 638 | +// doc.getStyle(initStyles[i])); |
---|
| 639 | +// } |
---|
| 640 | +// } |
---|
| 641 | +// } catch (BadLocationException ble) |
---|
| 642 | +// { |
---|
| 643 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 644 | +// } |
---|
642 | 645 | |
---|
643 | | - String[] initStyles = |
---|
644 | | - { |
---|
645 | | - "regular", "italic", "bold", "small", "large", |
---|
646 | | - "regular", "button", "regular", "icon", |
---|
647 | | - "regular" |
---|
648 | | - }; |
---|
649 | | - |
---|
650 | | - JTextPane textPane = new JTextPane(); |
---|
651 | | - textPane.setEditable(true); |
---|
652 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
653 | | - addStylesToDocument(doc); |
---|
654 | | - |
---|
655 | | - try |
---|
656 | | - { |
---|
657 | | - for (int j = 0; j < 2; j++) |
---|
658 | | - { |
---|
659 | | - for (int i = 0; i < initString.length; i++) |
---|
660 | | - { |
---|
661 | | - doc.insertString(doc.getLength(), initString[i], |
---|
662 | | - doc.getStyle(initStyles[i])); |
---|
663 | | - } |
---|
664 | | - } |
---|
665 | | - } catch (BadLocationException ble) |
---|
666 | | - { |
---|
667 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
668 | | - } |
---|
669 | | - |
---|
670 | | - return new JTextArea(); // textPane; |
---|
| 646 | + return new JTextPane(); // textPane; |
---|
671 | 647 | } |
---|
672 | 648 | |
---|
673 | 649 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
720 | 696 | protected static ImageIcon createImageIcon(String path, |
---|
721 | 697 | String description) |
---|
722 | 698 | { |
---|
723 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 699 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
724 | 700 | if (imgURL != null) |
---|
725 | 701 | { |
---|
726 | 702 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
752 | 728 | // NumberSlider vDivsField; |
---|
753 | 729 | // JCheckBox endcaps; |
---|
754 | 730 | JCheckBox liveCB; |
---|
| 731 | + JCheckBox selectCB; |
---|
755 | 732 | JCheckBox hideCB; |
---|
756 | 733 | JCheckBox link2masterCB; |
---|
757 | 734 | JCheckBox markCB; |
---|
.. | .. |
---|
767 | 744 | JButton slowerButton; |
---|
768 | 745 | JButton fasterButton; |
---|
769 | 746 | JButton remarkButton; |
---|
| 747 | + |
---|
| 748 | + cGridBag namePanel; |
---|
| 749 | + cGridBag setupPanel; |
---|
| 750 | + cGridBag commandsPanel; |
---|
| 751 | + cGridBag pushPanel; |
---|
| 752 | + cGridBag fillPanel; |
---|
770 | 753 | |
---|
771 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 754 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
772 | 755 | { |
---|
773 | 756 | JCheckBox cb; |
---|
774 | 757 | |
---|
775 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
776 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
777 | | -// oe.aConstraints.weightx = 1; |
---|
778 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
779 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 758 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
780 | 759 | cb.addItemListener(this); |
---|
781 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
782 | | - oe.aConstraints.gridwidth = 1; |
---|
783 | | - oe.aConstraints.gridx += 1; |
---|
784 | 760 | |
---|
785 | 761 | return cb; |
---|
786 | 762 | } |
---|
787 | 763 | |
---|
788 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 764 | + cButton AddButton(cGridBag panel, String label) |
---|
789 | 765 | { |
---|
790 | 766 | cButton cb; |
---|
791 | 767 | |
---|
792 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
793 | | - oe.aConstraints.gridwidth = 1; |
---|
794 | | -// oe.aConstraints.weightx = 1; |
---|
795 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
796 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 768 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
797 | 769 | cb.addActionListener(this); |
---|
798 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
799 | | - oe.aConstraints.gridwidth = 1; |
---|
800 | | - oe.aConstraints.gridx += 1; |
---|
801 | 770 | |
---|
802 | 771 | return cb; |
---|
803 | 772 | } |
---|
804 | 773 | |
---|
805 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 774 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
806 | 775 | { |
---|
807 | 776 | JComboBox combo; |
---|
808 | 777 | |
---|
809 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
810 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
811 | | - oe.aConstraints.gridx += 1; |
---|
| 778 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
812 | 779 | combo.addActionListener(this); |
---|
813 | 780 | |
---|
814 | 781 | return combo; |
---|
815 | 782 | } |
---|
816 | 783 | |
---|
817 | | - cNumberSlider AddSlider(cGridBag ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 784 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
818 | 785 | { |
---|
819 | 786 | cGridBag control = new cGridBag(); |
---|
820 | 787 | |
---|
.. | .. |
---|
826 | 793 | control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
827 | 794 | combo.setFloat(current); |
---|
828 | 795 | |
---|
829 | | - ctrlPanel.add(control); |
---|
| 796 | + panel.add(control); |
---|
830 | 797 | |
---|
831 | | - return combo; |
---|
| 798 | + return control; |
---|
832 | 799 | } |
---|
833 | 800 | |
---|
834 | | - cNumberSlider AddSlider(cGridBag ctrlPanel, String label, int min, int max, int current) |
---|
| 801 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
835 | 802 | { |
---|
836 | 803 | cGridBag control = new cGridBag(); |
---|
837 | 804 | |
---|
.. | .. |
---|
839 | 806 | |
---|
840 | 807 | JLabel jlabel = new JLabel(label); |
---|
841 | 808 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
842 | | - ctrlPanel.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
843 | | - ctrlPanel.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 809 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 810 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
844 | 811 | combo.setInteger(current); |
---|
845 | 812 | |
---|
846 | | - ctrlPanel.add(control); |
---|
| 813 | + panel.add(control); |
---|
847 | 814 | |
---|
848 | | - return combo; |
---|
| 815 | + return control; |
---|
849 | 816 | } |
---|
850 | 817 | |
---|
851 | 818 | JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
852 | 819 | { |
---|
853 | 820 | JTextArea text; |
---|
854 | 821 | |
---|
855 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
856 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
857 | 822 | ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
858 | 823 | text.addCaretListener(this); |
---|
859 | | - aConstraints.gridx += 1; |
---|
860 | | - aConstraints.gridwidth = 1; |
---|
861 | 824 | |
---|
862 | 825 | return text; |
---|
863 | 826 | } |
---|
.. | .. |
---|
896 | 859 | |
---|
897 | 860 | /* |
---|
898 | 861 | */ |
---|
899 | | - void Return() // ObjEditor oe) |
---|
| 862 | + void Return0() // ObjEditor oe) |
---|
900 | 863 | { |
---|
901 | 864 | aConstraints.gridy += 1; |
---|
902 | 865 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
951 | 914 | |
---|
952 | 915 | void SetupUI2(ObjEditor oe) |
---|
953 | 916 | { |
---|
954 | | -// oe.aConstraints.weightx = 0; |
---|
955 | | -// oe.aConstraints.weighty = 0; |
---|
956 | | -// oe.aConstraints.gridx = 0; |
---|
957 | | -// oe.aConstraints.gridy = 0; |
---|
958 | | - SetupName(oe); |
---|
| 917 | + //SetupName(oe); |
---|
| 918 | + |
---|
| 919 | + namePanel = new cGridBag(); |
---|
| 920 | + |
---|
| 921 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 922 | + namePanel.add(nameField); |
---|
| 923 | + oe.ctrlPanel.add(namePanel); |
---|
| 924 | + |
---|
| 925 | + oe.ctrlPanel.Return(); |
---|
959 | 926 | |
---|
960 | 927 | if (!GroupEditor.allparams) |
---|
961 | 928 | return; |
---|
962 | 929 | |
---|
963 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
964 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
965 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 930 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 931 | + |
---|
| 932 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 933 | + liveCB.setToolTipText("Animate object"); |
---|
| 934 | + selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 935 | + selectCB.setToolTipText("Make object selectable"); |
---|
966 | 936 | // Return(); |
---|
967 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
968 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
969 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
970 | | - Return(); |
---|
971 | | - resetButton = AddButton(oe, "Reset"); |
---|
972 | | - stepButton = AddButton(oe, "Step"); |
---|
| 937 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 938 | + hideCB.setToolTipText("Hide object"); |
---|
| 939 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 940 | + markCB.setToolTipText("Set the animation target transform"); |
---|
| 941 | + |
---|
| 942 | + rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 943 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 944 | + |
---|
| 945 | + randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
| 946 | + randomCB.setToolTipText("Option for switch node"); |
---|
| 947 | + |
---|
| 948 | + if (Globals.ADVANCED) |
---|
| 949 | + { |
---|
| 950 | + link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
| 951 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 952 | + speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 953 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 954 | + } |
---|
| 955 | + |
---|
| 956 | + oe.ctrlPanel.add(setupPanel); |
---|
| 957 | + oe.ctrlPanel.Return(); |
---|
| 958 | + |
---|
| 959 | + commandsPanel = new cGridBag().setVertical(false); |
---|
| 960 | + |
---|
| 961 | + resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 962 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 963 | + stepButton = AddButton(commandsPanel, "Step"); |
---|
| 964 | + stepButton.setToolTipText("Step one frame"); |
---|
973 | 965 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
974 | 966 | // stepAllButton = AddButton(oe, "Step All"); |
---|
975 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
976 | 967 | // Return(); |
---|
977 | | - slowerButton = AddButton(oe, "Slow"); |
---|
978 | | - fasterButton = AddButton(oe, "Fast"); |
---|
979 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 968 | + slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 969 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 970 | + fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 971 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 972 | + remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 973 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
980 | 974 | |
---|
981 | | - //Return(); |
---|
| 975 | + oe.ctrlPanel.add(commandsPanel); |
---|
| 976 | + oe.ctrlPanel.Return(); |
---|
982 | 977 | |
---|
983 | | - //normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
| 978 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 979 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
984 | 980 | //Return(); |
---|
| 981 | + |
---|
| 982 | + oe.ctrlPanel.Return(); |
---|
985 | 983 | |
---|
986 | 984 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
987 | 985 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1076 | 1074 | oe.aConstraints.gridwidth = 1; |
---|
1077 | 1075 | /**/ |
---|
1078 | 1076 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1079 | | - Return(); |
---|
| 1077 | + oe.ctrlPanel.Return(); |
---|
1080 | 1078 | |
---|
1081 | 1079 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1082 | 1080 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1253 | 1251 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1254 | 1252 | //tmp.setName("Edit"); |
---|
1255 | 1253 | objectPanel.add(materialPanel); |
---|
1256 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1257 | | - north.setName("Edit"); |
---|
1258 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1259 | | - objectPanel.add(north); |
---|
| 1254 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1255 | +// north.setName("Edit"); |
---|
| 1256 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1257 | +// objectPanel.add(north); |
---|
| 1258 | + objectPanel.add(ctrlPanel); |
---|
1260 | 1259 | objectPanel.add(infoPanel); |
---|
1261 | 1260 | |
---|
1262 | 1261 | /* |
---|
.. | .. |
---|
1278 | 1277 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1279 | 1278 | |
---|
1280 | 1279 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1281 | | - scenePanel.preferredWidth = 7; |
---|
| 1280 | + scenePanel.preferredWidth = 6; |
---|
1282 | 1281 | |
---|
1283 | 1282 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1284 | 1283 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1384 | 1383 | |
---|
1385 | 1384 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1386 | 1385 | |
---|
1387 | | - frame.setSize(1024, 768); |
---|
1388 | | - frame.show(); |
---|
| 1386 | + frame.setSize(1280, 860); |
---|
| 1387 | + frame.setVisible(true); |
---|
1389 | 1388 | |
---|
1390 | 1389 | gridPanel.setDividerLocation(1.0); |
---|
1391 | 1390 | |
---|
.. | .. |
---|
1415 | 1414 | ctrlPanel.removeAll(); |
---|
1416 | 1415 | } |
---|
1417 | 1416 | |
---|
1418 | | - void SetupMaterial(cGridBag ctrlPanel) |
---|
| 1417 | + void SetupMaterial(cGridBag panel) |
---|
1419 | 1418 | { |
---|
1420 | 1419 | /* |
---|
1421 | 1420 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
.. | .. |
---|
1424 | 1423 | |
---|
1425 | 1424 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1426 | 1425 | |
---|
1427 | | - editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints); |
---|
| 1426 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1427 | + createMaterialButton.setToolTipText("Create material"); |
---|
1428 | 1428 | |
---|
1429 | 1429 | /* |
---|
1430 | 1430 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1431 | 1431 | */ |
---|
1432 | 1432 | |
---|
1433 | | - editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints); |
---|
1434 | | - editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints); |
---|
1435 | | - editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
1436 | | - editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1433 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1434 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1435 | + |
---|
| 1436 | + if (Globals.ADVANCED) |
---|
| 1437 | + { |
---|
| 1438 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1439 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1440 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1441 | + } |
---|
1437 | 1442 | |
---|
1438 | | - ctrlPanel.add(editBar); |
---|
| 1443 | + editBar.preferredHeight = 15; |
---|
| 1444 | + |
---|
| 1445 | + panel.add(editBar); |
---|
1439 | 1446 | |
---|
1440 | 1447 | /**/ |
---|
1441 | 1448 | //aConstraints.weighty = 0; |
---|
.. | .. |
---|
1484 | 1491 | shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1485 | 1492 | colorSection.add(shadowbias); |
---|
1486 | 1493 | |
---|
1487 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1494 | + panel.add(new JSeparator()); |
---|
1488 | 1495 | |
---|
1489 | | - ctrlPanel.add(colorSection); |
---|
| 1496 | + panel.add(colorSection); |
---|
1490 | 1497 | |
---|
1491 | 1498 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1492 | 1499 | |
---|
.. | .. |
---|
1534 | 1541 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1535 | 1542 | diffuseSection.add(fakedepth); |
---|
1536 | 1543 | |
---|
1537 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1544 | + panel.add(new JSeparator()); |
---|
1538 | 1545 | |
---|
1539 | | - ctrlPanel.add(diffuseSection); |
---|
| 1546 | + panel.add(diffuseSection); |
---|
1540 | 1547 | |
---|
1541 | 1548 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1542 | 1549 | |
---|
.. | .. |
---|
1572 | 1579 | velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1573 | 1580 | specularSection.add(velvet); |
---|
1574 | 1581 | |
---|
1575 | | - shiftField = AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
| 1582 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
1576 | 1583 | //Return(); |
---|
1577 | 1584 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1578 | 1585 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
1585 | 1592 | // aConstraints.gridwidth = 1; |
---|
1586 | 1593 | |
---|
1587 | 1594 | |
---|
1588 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1595 | + panel.add(new JSeparator()); |
---|
1589 | 1596 | |
---|
1590 | | - ctrlPanel.add(specularSection); |
---|
| 1597 | + panel.add(specularSection); |
---|
1591 | 1598 | |
---|
1592 | 1599 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1593 | 1600 | |
---|
.. | .. |
---|
1617 | 1624 | opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1618 | 1625 | globalSection.add(opacity); |
---|
1619 | 1626 | |
---|
1620 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1627 | + panel.add(new JSeparator()); |
---|
1621 | 1628 | |
---|
1622 | | - ctrlPanel.add(globalSection); |
---|
| 1629 | + panel.add(globalSection); |
---|
1623 | 1630 | |
---|
1624 | 1631 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1625 | 1632 | |
---|
.. | .. |
---|
1661 | 1668 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1662 | 1669 | textureSection.add(opacityPower); |
---|
1663 | 1670 | |
---|
1664 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1671 | + panel.add(new JSeparator()); |
---|
1665 | 1672 | |
---|
1666 | | - ctrlPanel.add(textureSection); |
---|
| 1673 | + panel.add(textureSection); |
---|
1667 | 1674 | |
---|
1668 | 1675 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1669 | 1676 | |
---|
.. | .. |
---|
1700 | 1707 | opacityPowerField.addChangeListener(this); |
---|
1701 | 1708 | /**/ |
---|
1702 | 1709 | |
---|
1703 | | - resetSlidersButton.addActionListener(this); |
---|
1704 | 1710 | clearMaterialButton.addActionListener(this); |
---|
1705 | 1711 | createMaterialButton.addActionListener(this); |
---|
1706 | | - |
---|
1707 | | - propagateToggle.addItemListener(this); |
---|
1708 | | - multiplyToggle.addItemListener(this); |
---|
| 1712 | + |
---|
| 1713 | + if (Globals.ADVANCED) |
---|
| 1714 | + { |
---|
| 1715 | + resetSlidersButton.addActionListener(this); |
---|
| 1716 | + propagateToggle.addItemListener(this); |
---|
| 1717 | + multiplyToggle.addItemListener(this); |
---|
| 1718 | + } |
---|
1709 | 1719 | } |
---|
1710 | 1720 | |
---|
1711 | 1721 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1876 | 1886 | |
---|
1877 | 1887 | //? flashIt = false; |
---|
1878 | 1888 | CameraPane pane = (CameraPane) cameraView; |
---|
1879 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 1889 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1880 | 1890 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1881 | 1891 | |
---|
1882 | 1892 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
1925 | 1935 | e2.printStackTrace(); |
---|
1926 | 1936 | } |
---|
1927 | 1937 | } |
---|
| 1938 | + |
---|
1928 | 1939 | LoadJMEThread loadThread; |
---|
1929 | 1940 | |
---|
1930 | 1941 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
1982 | 1993 | //LoadFile0(filename, converter); |
---|
1983 | 1994 | } |
---|
1984 | 1995 | } |
---|
| 1996 | + |
---|
1985 | 1997 | LoadOBJThread loadObjThread; |
---|
1986 | 1998 | |
---|
1987 | 1999 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2333 | 2345 | |
---|
2334 | 2346 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2335 | 2347 | { |
---|
2336 | | - if (GrafreeD.standAlone) |
---|
| 2348 | + if (Grafreed.standAlone) |
---|
2337 | 2349 | { |
---|
2338 | 2350 | /**/ |
---|
2339 | 2351 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2340 | | - browser.show(); |
---|
| 2352 | + browser.setVisible(true); |
---|
2341 | 2353 | String filename = browser.getFile(); |
---|
2342 | 2354 | if (filename != null && filename.length() > 0) |
---|
2343 | 2355 | { |
---|
.. | .. |
---|
2482 | 2494 | } |
---|
2483 | 2495 | if (input == null) |
---|
2484 | 2496 | { |
---|
| 2497 | + new Exception().printStackTrace(); |
---|
2485 | 2498 | System.exit(0); |
---|
2486 | 2499 | } |
---|
2487 | 2500 | |
---|
.. | .. |
---|
2696 | 2709 | return; |
---|
2697 | 2710 | } |
---|
2698 | 2711 | |
---|
2699 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2712 | + if (multiplyToggle != null) |
---|
| 2713 | + multiplyToggle.setSelected(mat.multiply); |
---|
2700 | 2714 | |
---|
2701 | 2715 | assert (object.projectedVertices != null); |
---|
2702 | 2716 | |
---|
.. | .. |
---|
2911 | 2925 | frame.validate(); |
---|
2912 | 2926 | |
---|
2913 | 2927 | return; |
---|
2914 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 2928 | + } else if (event.getSource() == toggleSwitchItem) |
---|
2915 | 2929 | { |
---|
2916 | 2930 | cameraView.ToggleRandom(); |
---|
2917 | 2931 | cameraView.repaint(); |
---|
.. | .. |
---|
2942 | 2956 | { |
---|
2943 | 2957 | copy.live ^= true; |
---|
2944 | 2958 | return; |
---|
| 2959 | + } else if (event.getSource() == selectCB) |
---|
| 2960 | + { |
---|
| 2961 | + copy.dontselect ^= true; |
---|
| 2962 | + return; |
---|
2945 | 2963 | } else if (event.getSource() == hideCB) |
---|
2946 | 2964 | { |
---|
2947 | 2965 | copy.hide ^= true; |
---|
.. | .. |
---|
2956 | 2974 | if (event.getSource() == randomCB) |
---|
2957 | 2975 | { |
---|
2958 | 2976 | copy.random ^= true; |
---|
| 2977 | + objEditor.refreshContents(); |
---|
2959 | 2978 | return; |
---|
2960 | 2979 | } |
---|
2961 | 2980 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
2979 | 2998 | |
---|
2980 | 2999 | public void actionPerformed(ActionEvent event) |
---|
2981 | 3000 | { |
---|
| 3001 | + Object source = event.getSource(); |
---|
2982 | 3002 | // SCRIPT DIALOG |
---|
2983 | | - if (event.getSource() == okbutton) |
---|
| 3003 | + if (source == okbutton) |
---|
2984 | 3004 | { |
---|
2985 | 3005 | textpanel.setVisible(false); |
---|
2986 | 3006 | textpanel.remove(textarea); |
---|
.. | .. |
---|
2992 | 3012 | textarea = null; |
---|
2993 | 3013 | textpanel = null; |
---|
2994 | 3014 | } |
---|
2995 | | - if (event.getSource() == cancelbutton) |
---|
| 3015 | + if (source == cancelbutton) |
---|
2996 | 3016 | { |
---|
2997 | 3017 | textpanel.setVisible(false); |
---|
2998 | 3018 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3004 | 3024 | //applySelf(); |
---|
3005 | 3025 | //client.refreshEditWindow(); |
---|
3006 | 3026 | //refreshContents(); |
---|
3007 | | - if (event.getSource() == nameField) |
---|
| 3027 | + if (source == nameField) |
---|
3008 | 3028 | { |
---|
3009 | 3029 | //System.out.println("ObjEditor " + event); |
---|
3010 | 3030 | applySelf0(true); |
---|
3011 | 3031 | //parent.applySelf(); |
---|
3012 | 3032 | objEditor.refreshContents(); |
---|
3013 | | - } else if (event.getSource() == resetButton) |
---|
| 3033 | + } else if (source == resetButton) |
---|
3014 | 3034 | { |
---|
3015 | 3035 | CameraPane.fullreset = true; |
---|
3016 | 3036 | copy.Reset(); // ResetMeshes(); |
---|
3017 | 3037 | copy.Touch(); |
---|
3018 | 3038 | objEditor.refreshContents(); |
---|
3019 | | - } else if (event.getSource() == stepItem) |
---|
| 3039 | + } else if (source == stepItem) |
---|
3020 | 3040 | { |
---|
3021 | 3041 | //cameraView.ONESTEP = true; |
---|
3022 | 3042 | Globals.ONESTEP = true; |
---|
3023 | 3043 | cameraView.repaint(); |
---|
3024 | 3044 | return; |
---|
3025 | | - } else if (event.getSource() == stepButton) |
---|
| 3045 | + } else if (source == stepButton) |
---|
3026 | 3046 | { |
---|
3027 | 3047 | copy.Step(); |
---|
3028 | 3048 | copy.Touch(); |
---|
3029 | 3049 | objEditor.refreshContents(); |
---|
3030 | | - } else if (event.getSource() == slowerButton) |
---|
| 3050 | + } else if (source == slowerButton) |
---|
3031 | 3051 | { |
---|
3032 | 3052 | copy.Slower(); |
---|
3033 | 3053 | copy.Touch(); |
---|
3034 | 3054 | objEditor.refreshContents(); |
---|
3035 | | - } else if (event.getSource() == fasterButton) |
---|
| 3055 | + } else if (source == fasterButton) |
---|
3036 | 3056 | { |
---|
3037 | 3057 | copy.Faster(); |
---|
3038 | 3058 | copy.Touch(); |
---|
3039 | 3059 | objEditor.refreshContents(); |
---|
3040 | | - } else if (event.getSource() == remarkButton) |
---|
| 3060 | + } else if (source == remarkButton) |
---|
3041 | 3061 | { |
---|
3042 | 3062 | copy.Remark(); |
---|
3043 | 3063 | copy.Touch(); |
---|
3044 | 3064 | objEditor.refreshContents(); |
---|
3045 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3065 | + } else if (source == stepAllButton) |
---|
3046 | 3066 | { |
---|
3047 | 3067 | copy.StepAll(); |
---|
3048 | 3068 | copy.Touch(); |
---|
3049 | 3069 | objEditor.refreshContents(); |
---|
3050 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3070 | + } else if (source == resetAllButton) |
---|
3051 | 3071 | { |
---|
3052 | 3072 | //CameraPane.fullreset = true; |
---|
3053 | 3073 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3080 | 3100 | // Close(); |
---|
3081 | 3101 | // } |
---|
3082 | 3102 | // else |
---|
3083 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3103 | + if (source == resetSlidersButton) |
---|
3084 | 3104 | { |
---|
3085 | 3105 | ResetSliders(); |
---|
3086 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3106 | + } else if (source == clearMaterialButton) |
---|
3087 | 3107 | { |
---|
3088 | 3108 | ClearMaterial(); |
---|
3089 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3109 | + } else if (source == createMaterialButton) |
---|
3090 | 3110 | { |
---|
3091 | 3111 | CreateMaterial(); |
---|
3092 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3112 | + } else if (source == clearPanelButton) |
---|
3093 | 3113 | { |
---|
3094 | 3114 | copy.ClearUI(); |
---|
3095 | 3115 | refreshContents(true); |
---|
3096 | | - } /* |
---|
3097 | | - } |
---|
3098 | | - |
---|
3099 | | - public boolean action(Event event, Object arg) |
---|
3100 | | - { |
---|
3101 | | - */ else if (event.getSource() == closeItem) |
---|
| 3116 | + } else if (source == importGFDItem) |
---|
| 3117 | + { |
---|
| 3118 | + ImportGFD(); |
---|
| 3119 | + } else |
---|
| 3120 | + if (source == importVRMLX3DItem) |
---|
| 3121 | + { |
---|
| 3122 | + ImportVRMLX3D(); |
---|
| 3123 | + } else |
---|
| 3124 | + if (source == import3DSItem) |
---|
| 3125 | + { |
---|
| 3126 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3127 | + } else |
---|
| 3128 | + if (source == importOBJItem) |
---|
| 3129 | + { |
---|
| 3130 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3131 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3132 | + browser.setVisible(true); |
---|
| 3133 | + String filename = browser.getFile(); |
---|
| 3134 | + if (filename != null && filename.length() > 0) |
---|
| 3135 | + { |
---|
| 3136 | + String fullname = browser.getDirectory() + filename; |
---|
| 3137 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3138 | + } |
---|
| 3139 | + } else |
---|
| 3140 | + if (source == closeItem) |
---|
3102 | 3141 | { |
---|
3103 | 3142 | Close(); |
---|
3104 | 3143 | //return true; |
---|
3105 | | - } else if (event.getSource() == loadItem) |
---|
| 3144 | + } else if (source == loadItem) |
---|
3106 | 3145 | { |
---|
3107 | 3146 | load(); |
---|
3108 | 3147 | //return true; |
---|
3109 | | - } else if (event.getSource() == saveItem) |
---|
| 3148 | + } else if (source == newItem) |
---|
| 3149 | + { |
---|
| 3150 | + New(); |
---|
| 3151 | + } else if (source == saveItem) |
---|
3110 | 3152 | { |
---|
3111 | 3153 | save(); |
---|
3112 | 3154 | //return true; |
---|
3113 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3155 | + } else if (source == saveAsItem) |
---|
3114 | 3156 | { |
---|
3115 | 3157 | saveAs(); |
---|
3116 | 3158 | //return true; |
---|
3117 | | - } else if (event.getSource() == reexportItem) |
---|
| 3159 | + } else if (source == reexportItem) |
---|
3118 | 3160 | { |
---|
3119 | 3161 | reexport(); |
---|
3120 | 3162 | //return true; |
---|
3121 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3163 | + } else if (source == exportAsItem) |
---|
3122 | 3164 | { |
---|
3123 | 3165 | export(); |
---|
3124 | 3166 | //return true; |
---|
3125 | | - } else if (event.getSource() == povItem) |
---|
| 3167 | + } else if (source == povItem) |
---|
3126 | 3168 | { |
---|
3127 | 3169 | generatePOV(); |
---|
3128 | 3170 | //return true; |
---|
3129 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3171 | + } else if (source == zBufferItem) |
---|
3130 | 3172 | { |
---|
3131 | 3173 | try |
---|
3132 | 3174 | { |
---|
.. | .. |
---|
3148 | 3190 | cameraView.repaint(); |
---|
3149 | 3191 | //return true; |
---|
3150 | 3192 | } |
---|
3151 | | - */ else if (event.getSource() == editCameraItem) |
---|
3152 | | - { |
---|
3153 | | - cameraView.ProtectCamera(); |
---|
3154 | | - cameraView.repaint(); |
---|
3155 | | - return; |
---|
3156 | | - } else if (event.getSource() == revertCameraItem) |
---|
3157 | | - { |
---|
3158 | | - cameraView.RevertCamera(); |
---|
3159 | | - cameraView.repaint(); |
---|
3160 | | - return; |
---|
3161 | | -// } else if (event.getSource() == textureButton) |
---|
3162 | | -// { |
---|
3163 | | -// return; // true; |
---|
3164 | | - } else // combos... |
---|
3165 | | - if (event.getSource() == texresMenu) |
---|
| 3193 | + */ else // combos... |
---|
| 3194 | + if (source == texresMenu) |
---|
3166 | 3195 | { |
---|
3167 | 3196 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3168 | 3197 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3174 | 3203 | } |
---|
3175 | 3204 | } |
---|
3176 | 3205 | |
---|
| 3206 | + void New() |
---|
| 3207 | + { |
---|
| 3208 | + while (copy.Size() > 1) |
---|
| 3209 | + { |
---|
| 3210 | + copy.remove(1); |
---|
| 3211 | + } |
---|
| 3212 | + |
---|
| 3213 | + ResetModel(); |
---|
| 3214 | + objEditor.refreshContents(); |
---|
| 3215 | + } |
---|
| 3216 | + |
---|
| 3217 | + static public Object clone(Object o) |
---|
| 3218 | + { |
---|
| 3219 | + try |
---|
| 3220 | + { |
---|
| 3221 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3222 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3223 | + |
---|
| 3224 | + out.writeObject(o); |
---|
| 3225 | + |
---|
| 3226 | + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); |
---|
| 3227 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3228 | + Object obj = in.readObject(); |
---|
| 3229 | + in.close(); |
---|
| 3230 | + out.close(); |
---|
| 3231 | + return obj; |
---|
| 3232 | + } catch (Exception e) |
---|
| 3233 | + { |
---|
| 3234 | + System.err.println(e); |
---|
| 3235 | + return null; |
---|
| 3236 | + } |
---|
| 3237 | + } |
---|
| 3238 | + |
---|
| 3239 | + cRadio GetCurrentTab() |
---|
| 3240 | + { |
---|
| 3241 | + cRadio ab; |
---|
| 3242 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3243 | + { |
---|
| 3244 | + ab = (cRadio)e.nextElement(); |
---|
| 3245 | + if(ab.GetObject() == copy) |
---|
| 3246 | + { |
---|
| 3247 | + return ab; |
---|
| 3248 | + } |
---|
| 3249 | + } |
---|
| 3250 | + |
---|
| 3251 | + return null; |
---|
| 3252 | + } |
---|
| 3253 | + |
---|
| 3254 | + public void Save() |
---|
| 3255 | + { |
---|
| 3256 | + cRadio tab = GetCurrentTab(); |
---|
| 3257 | + |
---|
| 3258 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3259 | + tab.graphs[tab.undoindex++] = (Object3D)clone(copy); |
---|
| 3260 | + |
---|
| 3261 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3262 | + { |
---|
| 3263 | + tab.graphs[i] = null; |
---|
| 3264 | + } |
---|
| 3265 | + |
---|
| 3266 | + // test save |
---|
| 3267 | + if (false) |
---|
| 3268 | + { |
---|
| 3269 | + try |
---|
| 3270 | + { |
---|
| 3271 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3272 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3273 | + |
---|
| 3274 | + p.writeObject(copy); |
---|
| 3275 | + |
---|
| 3276 | + p.flush(); |
---|
| 3277 | + |
---|
| 3278 | + ostream.close(); |
---|
| 3279 | + } catch (Exception e) |
---|
| 3280 | + { |
---|
| 3281 | + e.printStackTrace(); |
---|
| 3282 | + } |
---|
| 3283 | + } |
---|
| 3284 | + } |
---|
| 3285 | + |
---|
| 3286 | + void CopyChanged(Object3D obj) |
---|
| 3287 | + { |
---|
| 3288 | + copy.clear(); |
---|
| 3289 | + |
---|
| 3290 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3291 | + { |
---|
| 3292 | + copy.add(obj.get(i)); |
---|
| 3293 | + } |
---|
| 3294 | + |
---|
| 3295 | + copy.Touch(); |
---|
| 3296 | + |
---|
| 3297 | + ResetModel(); |
---|
| 3298 | + copy.HardTouch(); // recompile? |
---|
| 3299 | + |
---|
| 3300 | + cRadio ab; |
---|
| 3301 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3302 | + { |
---|
| 3303 | + ab = (cRadio)e.nextElement(); |
---|
| 3304 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3305 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3306 | + if (test != null) |
---|
| 3307 | + { |
---|
| 3308 | + test.editWindow = ab.object.editWindow; |
---|
| 3309 | + ab.object = test; |
---|
| 3310 | + } |
---|
| 3311 | + } |
---|
| 3312 | + |
---|
| 3313 | + refreshContents(); |
---|
| 3314 | + } |
---|
| 3315 | + |
---|
| 3316 | + public void Undo() |
---|
| 3317 | + { |
---|
| 3318 | + cRadio tab = GetCurrentTab(); |
---|
| 3319 | + |
---|
| 3320 | + if (tab.undoindex == 0) |
---|
| 3321 | + { |
---|
| 3322 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3323 | + return; |
---|
| 3324 | + } |
---|
| 3325 | + |
---|
| 3326 | + if (tab.graphs[tab.undoindex] == null) |
---|
| 3327 | + { |
---|
| 3328 | + Save(); |
---|
| 3329 | + tab.undoindex -= 1; |
---|
| 3330 | + } |
---|
| 3331 | + |
---|
| 3332 | + tab.undoindex -= 1; |
---|
| 3333 | + |
---|
| 3334 | + CopyChanged(tab.graphs[tab.undoindex]); |
---|
| 3335 | + } |
---|
| 3336 | + |
---|
| 3337 | + public void Redo() |
---|
| 3338 | + { |
---|
| 3339 | + cRadio tab = GetCurrentTab(); |
---|
| 3340 | + |
---|
| 3341 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3342 | + { |
---|
| 3343 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3344 | + return; |
---|
| 3345 | + } |
---|
| 3346 | + |
---|
| 3347 | + tab.undoindex += 1; |
---|
| 3348 | + |
---|
| 3349 | + CopyChanged(tab.graphs[tab.undoindex]); |
---|
| 3350 | + } |
---|
| 3351 | + |
---|
| 3352 | + void ImportGFD() |
---|
| 3353 | + { |
---|
| 3354 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
| 3355 | + browser.show(); |
---|
| 3356 | + String filename = browser.getFile(); |
---|
| 3357 | + if (filename != null && filename.length() > 0) |
---|
| 3358 | + { |
---|
| 3359 | + String fullname = browser.getDirectory() + filename; |
---|
| 3360 | + |
---|
| 3361 | + //Object3D readobj = |
---|
| 3362 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3363 | + //makeSomething(readobj); |
---|
| 3364 | + } |
---|
| 3365 | + } |
---|
| 3366 | + |
---|
| 3367 | + void ImportVRMLX3D() |
---|
| 3368 | + { |
---|
| 3369 | + if (Grafreed.standAlone) |
---|
| 3370 | + { |
---|
| 3371 | + /**/ |
---|
| 3372 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3373 | + browser.show(); |
---|
| 3374 | + String filename = browser.getFile(); |
---|
| 3375 | + if (filename != null && filename.length() > 0) |
---|
| 3376 | + { |
---|
| 3377 | + String fullname = browser.getDirectory() + filename; |
---|
| 3378 | + LoadVRMLX3D(fullname); |
---|
| 3379 | + } |
---|
| 3380 | + /**/ |
---|
| 3381 | + } |
---|
| 3382 | + } |
---|
| 3383 | + |
---|
3177 | 3384 | void ToggleAnimation() |
---|
3178 | 3385 | { |
---|
3179 | 3386 | if (!Globals.ANIMATION) |
---|
3180 | 3387 | { |
---|
3181 | 3388 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3182 | | - browser.show(); |
---|
| 3389 | + browser.setVisible(true); |
---|
3183 | 3390 | String filename = browser.getFile(); |
---|
3184 | 3391 | if (filename != null && filename.length() > 0) |
---|
3185 | 3392 | { |
---|
.. | .. |
---|
3189 | 3396 | |
---|
3190 | 3397 | Globals.ANIMATION ^= true; |
---|
3191 | 3398 | |
---|
3192 | | - GrafreeD.wav.cursor = 0; |
---|
3193 | | - GrafreeD.wav.loop = 0; |
---|
| 3399 | + Grafreed.wav.cursor = 0; |
---|
| 3400 | + Grafreed.wav.loop = 0; |
---|
3194 | 3401 | } |
---|
3195 | 3402 | } else |
---|
3196 | 3403 | { |
---|
.. | .. |
---|
3240 | 3447 | void CreateMaterial() |
---|
3241 | 3448 | { |
---|
3242 | 3449 | //copy.ClearMaterial(); // PATCH |
---|
3243 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3450 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3244 | 3451 | if (copy.selection.size() > 0) |
---|
3245 | 3452 | //SetMaterial(copy); |
---|
3246 | 3453 | { |
---|
.. | .. |
---|
3299 | 3506 | { |
---|
3300 | 3507 | copy.ResetBlockLoop(); // temporary problem |
---|
3301 | 3508 | |
---|
3302 | | - boolean random = CameraPane.RANDOM; |
---|
3303 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3509 | + boolean random = CameraPane.SWITCH; |
---|
| 3510 | + CameraPane.SWITCH = false; // parse everything |
---|
3304 | 3511 | copy.ResetDisplayList(); |
---|
3305 | 3512 | copy.HardTouch(); |
---|
3306 | | - CameraPane.RANDOM = random; |
---|
| 3513 | + CameraPane.SWITCH = random; |
---|
3307 | 3514 | } |
---|
3308 | 3515 | |
---|
3309 | 3516 | // public void applySelf() |
---|
.. | .. |
---|
3377 | 3584 | { |
---|
3378 | 3585 | //System.out.println("Propagate = " + propagate); |
---|
3379 | 3586 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 3587 | + |
---|
| 3588 | + if (copy.material != null) |
---|
| 3589 | + { |
---|
| 3590 | + cMaterial mat = copy.material; |
---|
| 3591 | + |
---|
| 3592 | + colorField.SetToolTipValue((mat.color)); |
---|
| 3593 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 3594 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 3595 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 3596 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 3597 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 3598 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 3599 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 3600 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 3601 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 3602 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 3603 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 3604 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 3605 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 3606 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 3607 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 3608 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 3609 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 3610 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 3611 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 3612 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 3613 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 3614 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 3615 | + } |
---|
| 3616 | + |
---|
3380 | 3617 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3381 | 3618 | { |
---|
3382 | 3619 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3421 | 3658 | || e.getSource() == apertureField |
---|
3422 | 3659 | || e.getSource() == shadowblurField) |
---|
3423 | 3660 | { |
---|
| 3661 | + new Exception().printStackTrace(); |
---|
3424 | 3662 | System.exit(0); |
---|
3425 | 3663 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3426 | 3664 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3491 | 3729 | } |
---|
3492 | 3730 | |
---|
3493 | 3731 | if (normalpushField != null) |
---|
3494 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 3732 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3495 | 3733 | } |
---|
3496 | 3734 | |
---|
3497 | 3735 | void SnapObject() |
---|
.. | .. |
---|
3755 | 3993 | |
---|
3756 | 3994 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3757 | 3995 | { |
---|
| 3996 | + Save(); |
---|
3758 | 3997 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3759 | 3998 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3760 | 3999 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3958 | 4197 | } |
---|
3959 | 4198 | } |
---|
3960 | 4199 | } |
---|
| 4200 | + |
---|
3961 | 4201 | LoadGFDThread loadGFDThread; |
---|
3962 | 4202 | |
---|
3963 | 4203 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
3978 | 4218 | try |
---|
3979 | 4219 | { |
---|
3980 | 4220 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
3981 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4221 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4222 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
3982 | 4223 | |
---|
3983 | 4224 | readobj = (Object3D) p.readObject(); |
---|
3984 | 4225 | istream.close(); |
---|
.. | .. |
---|
3986 | 4227 | readobj.ResetDisplayList(); |
---|
3987 | 4228 | } catch (Exception e) |
---|
3988 | 4229 | { |
---|
3989 | | - e.printStackTrace(); |
---|
| 4230 | + //e.printStackTrace(); |
---|
| 4231 | + try |
---|
| 4232 | + { |
---|
| 4233 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4234 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4235 | + |
---|
| 4236 | + readobj = (Object3D) p.readObject(); |
---|
| 4237 | + istream.close(); |
---|
| 4238 | + |
---|
| 4239 | + readobj.ResetDisplayList(); |
---|
| 4240 | + } catch (Exception e2) |
---|
| 4241 | + { |
---|
| 4242 | + e2.printStackTrace(); |
---|
| 4243 | + } |
---|
3990 | 4244 | } |
---|
3991 | 4245 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
3992 | 4246 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4103 | 4357 | |
---|
4104 | 4358 | void load() // throws ClassNotFoundException |
---|
4105 | 4359 | { |
---|
4106 | | - if (GrafreeD.standAlone) |
---|
| 4360 | + if (Grafreed.standAlone) |
---|
4107 | 4361 | { |
---|
4108 | 4362 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4109 | 4363 | browser.show(); |
---|
.. | .. |
---|
4190 | 4444 | try |
---|
4191 | 4445 | { |
---|
4192 | 4446 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4193 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4447 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4448 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4194 | 4449 | |
---|
4195 | 4450 | p.writeObject(copy); |
---|
4196 | 4451 | p.flush(); |
---|
4197 | 4452 | |
---|
| 4453 | + zstream.close(); |
---|
4198 | 4454 | ostream.close(); |
---|
4199 | 4455 | |
---|
4200 | 4456 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4204 | 4460 | { |
---|
4205 | 4461 | } |
---|
4206 | 4462 | } |
---|
| 4463 | + |
---|
4207 | 4464 | String lastname; |
---|
4208 | 4465 | |
---|
4209 | 4466 | void saveAs() |
---|
4210 | 4467 | { |
---|
4211 | | - if (GrafreeD.standAlone) |
---|
| 4468 | + if (Grafreed.standAlone) |
---|
4212 | 4469 | { |
---|
4213 | 4470 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4214 | 4471 | browser.setVisible(true); |
---|
.. | .. |
---|
4313 | 4570 | try |
---|
4314 | 4571 | { |
---|
4315 | 4572 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4316 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4317 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 4573 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4574 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4318 | 4575 | |
---|
4319 | 4576 | Object3D objectparent = obj.parent; |
---|
4320 | 4577 | obj.parent = null; |
---|
4321 | 4578 | |
---|
4322 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 4579 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4323 | 4580 | |
---|
4324 | 4581 | obj.parent = objectparent; |
---|
4325 | 4582 | |
---|
.. | .. |
---|
4331 | 4588 | p.writeObject(object); |
---|
4332 | 4589 | p.flush(); |
---|
4333 | 4590 | |
---|
| 4591 | + zstream.close(); |
---|
4334 | 4592 | ostream.close(); |
---|
4335 | | - // zstream.close(); |
---|
4336 | 4593 | |
---|
4337 | 4594 | // group.selection.get(0).parent = parent; |
---|
4338 | 4595 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4353 | 4610 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4354 | 4611 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4355 | 4612 | copy.generatePOV(buffer); |
---|
4356 | | - if (GrafreeD.standAlone) |
---|
| 4613 | + if (Grafreed.standAlone) |
---|
4357 | 4614 | { |
---|
4358 | 4615 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4359 | 4616 | browser.show(); |
---|
.. | .. |
---|
4379 | 4636 | Object3D client; |
---|
4380 | 4637 | Object3D copy; |
---|
4381 | 4638 | MenuBar menuBar; |
---|
4382 | | - Menu windowMenu; |
---|
| 4639 | + Menu fileMenu; |
---|
| 4640 | + MenuItem newItem; |
---|
4383 | 4641 | MenuItem loadItem; |
---|
4384 | 4642 | MenuItem saveItem; |
---|
4385 | 4643 | MenuItem saveAsItem; |
---|
.. | .. |
---|
4387 | 4645 | MenuItem reexportItem; |
---|
4388 | 4646 | MenuItem povItem; |
---|
4389 | 4647 | MenuItem closeItem; |
---|
4390 | | - Menu cameraMenu; |
---|
| 4648 | + |
---|
4391 | 4649 | CheckboxMenuItem zBufferItem; |
---|
4392 | 4650 | //MenuItem normalLensItem; |
---|
4393 | | - MenuItem editCameraItem; |
---|
4394 | | - MenuItem revertCameraItem; |
---|
4395 | | - CheckboxMenuItem toggleLiveItem; |
---|
4396 | 4651 | MenuItem stepItem; |
---|
| 4652 | + CheckboxMenuItem toggleLiveItem; |
---|
4397 | 4653 | CheckboxMenuItem toggleFullScreenItem; |
---|
4398 | 4654 | CheckboxMenuItem toggleTimelineItem; |
---|
4399 | 4655 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4402 | 4658 | CheckboxMenuItem toggleFootContactItem; |
---|
4403 | 4659 | CheckboxMenuItem toggleDLItem; |
---|
4404 | 4660 | CheckboxMenuItem toggleTextureItem; |
---|
4405 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 4661 | + CheckboxMenuItem toggleSwitchItem; |
---|
4406 | 4662 | CheckboxMenuItem toggleRootItem; |
---|
4407 | 4663 | CheckboxMenuItem animationItem; |
---|
4408 | 4664 | CheckboxMenuItem toggleHandleItem; |
---|
.. | .. |
---|
4410 | 4666 | JSplitPane mainPanel; |
---|
4411 | 4667 | JScrollPane scrollpane; |
---|
4412 | 4668 | JPanel toolbarPanel; |
---|
4413 | | - JPanel treePanel; |
---|
| 4669 | + cGridBag treePanel; |
---|
4414 | 4670 | JPanel radioPanel; |
---|
4415 | 4671 | ButtonGroup buttonGroup; |
---|
4416 | 4672 | cGridBag ctrlPanel; |
---|
.. | .. |
---|
4539 | 4795 | //ObjectUI parent; |
---|
4540 | 4796 | |
---|
4541 | 4797 | cNumberSlider normalpushField; |
---|
| 4798 | + |
---|
| 4799 | + private MenuItem importGFDItem; |
---|
| 4800 | + private MenuItem importVRMLX3DItem; |
---|
| 4801 | + private MenuItem import3DSItem; |
---|
| 4802 | + private MenuItem importOBJItem; |
---|
4542 | 4803 | } |
---|