.. | .. |
---|
207 | 207 | |
---|
208 | 208 | objEditor.ctrlPanel.remove(namePanel); |
---|
209 | 209 | |
---|
210 | | - if (!GroupEditor.allparams) |
---|
| 210 | + if (!allparams) |
---|
211 | 211 | return; |
---|
212 | 212 | |
---|
213 | 213 | // objEditor.ctrlPanel.remove(liveCB); |
---|
.. | .. |
---|
337 | 337 | return frame.action(event, obj); |
---|
338 | 338 | } |
---|
339 | 339 | |
---|
| 340 | + // Cannot work without static |
---|
| 341 | + static boolean allparams = true; |
---|
| 342 | + |
---|
| 343 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 344 | + |
---|
340 | 345 | void SetupMenu() |
---|
341 | 346 | { |
---|
342 | 347 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
.. | .. |
---|
383 | 388 | closeItem.addActionListener(this); |
---|
384 | 389 | |
---|
385 | 390 | objectPanel = new JTabbedPane(); |
---|
| 391 | + |
---|
| 392 | + ChangeListener changeListener = new ChangeListener() |
---|
| 393 | + { |
---|
| 394 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 395 | + { |
---|
| 396 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 397 | +// { |
---|
| 398 | +// if (latestObject != null) |
---|
| 399 | +// { |
---|
| 400 | +// refreshContents(true); |
---|
| 401 | +// SetMaterial(latestObject); |
---|
| 402 | +// } |
---|
| 403 | +// |
---|
| 404 | +// materialFlushed = true; |
---|
| 405 | +// } |
---|
| 406 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 407 | +// { |
---|
| 408 | +// if (listUI.size() == 0) |
---|
| 409 | +// EditSelection(false); |
---|
| 410 | +// } |
---|
| 411 | + |
---|
| 412 | + refreshContents(false); // To refresh Info tab |
---|
| 413 | + } |
---|
| 414 | + }; |
---|
| 415 | + objectPanel.addChangeListener(changeListener); |
---|
| 416 | + |
---|
386 | 417 | toolbarPanel = new JPanel(); |
---|
387 | 418 | toolbarPanel.setName("Toolbar"); |
---|
388 | 419 | treePanel = new cGridBag(); |
---|
.. | .. |
---|
702 | 733 | |
---|
703 | 734 | void ToggleFullScreen() |
---|
704 | 735 | { |
---|
705 | | - if (CameraPane.FULLSCREEN) |
---|
| 736 | + cameraView.ToggleFullScreen(); |
---|
| 737 | + |
---|
| 738 | + if (!CameraPane.FULLSCREEN) |
---|
706 | 739 | { |
---|
707 | 740 | device.setFullScreenWindow(null); |
---|
708 | 741 | //frame.setVisible(false); |
---|
.. | .. |
---|
742 | 775 | radio.layout.doClick(); |
---|
743 | 776 | //frame.setVisible(true); |
---|
744 | 777 | } |
---|
745 | | - |
---|
746 | | - cameraView.ToggleFullScreen(); |
---|
747 | 778 | } |
---|
748 | 779 | |
---|
749 | 780 | private JTextPane createTextPane() |
---|
.. | .. |
---|
884 | 915 | JCheckBox speedupCB; |
---|
885 | 916 | JCheckBox rewindCB; |
---|
886 | 917 | JCheckBox flipVCB; |
---|
| 918 | + |
---|
| 919 | + cCheckBox toggleTextureCB; |
---|
| 920 | + cCheckBox toggleSwitchCB; |
---|
| 921 | + |
---|
887 | 922 | JComboBox texresMenu; |
---|
| 923 | + |
---|
888 | 924 | JButton resetButton; |
---|
889 | 925 | JButton stepButton; |
---|
890 | 926 | JButton stepAllButton; |
---|
.. | .. |
---|
1076 | 1112 | |
---|
1077 | 1113 | oe.ctrlPanel.Return(); |
---|
1078 | 1114 | |
---|
1079 | | - if (!GroupEditor.allparams) |
---|
| 1115 | + if (!allparams) |
---|
1080 | 1116 | return; |
---|
1081 | 1117 | |
---|
1082 | 1118 | setupPanel = new cGridBag().setVertical(false); |
---|
.. | .. |
---|
1412 | 1448 | |
---|
1413 | 1449 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1414 | 1450 | //tmp.setName("Edit"); |
---|
1415 | | - objectPanel.add(toolboxPanel); |
---|
1416 | 1451 | objectPanel.add(materialPanel); |
---|
1417 | 1452 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1418 | 1453 | // north.setName("Edit"); |
---|
.. | .. |
---|
1420 | 1455 | // objectPanel.add(north); |
---|
1421 | 1456 | objectPanel.add(editPanel); |
---|
1422 | 1457 | objectPanel.add(infoPanel); |
---|
| 1458 | + objectPanel.add(toolboxPanel); |
---|
1423 | 1459 | |
---|
1424 | 1460 | /* |
---|
1425 | 1461 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1428 | 1464 | aConstraints.gridy += 1; |
---|
1429 | 1465 | aConstraints.gridwidth = 1; |
---|
1430 | 1466 | mainPanel.add(objectPanel, aConstraints); |
---|
1431 | | - */ |
---|
| 1467 | + */ |
---|
1432 | 1468 | |
---|
1433 | 1469 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1434 | 1470 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1445 | 1481 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1446 | 1482 | tabbedPane.add(scrollpane); |
---|
1447 | 1483 | |
---|
1448 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1449 | | - |
---|
1450 | | - optionsPanel = new cGridBag().setVertical(true); |
---|
| 1484 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1451 | 1485 | |
---|
1452 | 1486 | optionsPanel.setName("Options"); |
---|
1453 | 1487 | |
---|
.. | .. |
---|
1455 | 1489 | |
---|
1456 | 1490 | tabbedPane.add(optionsPanel); |
---|
1457 | 1491 | |
---|
| 1492 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1493 | + |
---|
1458 | 1494 | scenePanel.add(tabbedPane); |
---|
1459 | 1495 | |
---|
1460 | 1496 | /* |
---|
.. | .. |
---|
1547 | 1583 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1548 | 1584 | |
---|
1549 | 1585 | frame.setSize(1280, 860); |
---|
| 1586 | + |
---|
| 1587 | + frame.validate(); |
---|
1550 | 1588 | frame.setVisible(true); |
---|
1551 | 1589 | |
---|
1552 | 1590 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
2866 | 2904 | |
---|
2867 | 2905 | void SetMaterial(Object3D object) |
---|
2868 | 2906 | { |
---|
| 2907 | + latestObject = object; |
---|
| 2908 | + |
---|
2869 | 2909 | cMaterial mat = object.material; |
---|
2870 | 2910 | |
---|
2871 | 2911 | if (mat == null) |
---|
.. | .. |
---|
3051 | 3091 | cameraView.ToggleDL(); |
---|
3052 | 3092 | cameraView.repaint(); |
---|
3053 | 3093 | return; |
---|
3054 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3094 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
3055 | 3095 | { |
---|
3056 | 3096 | cameraView.ToggleTexture(); |
---|
3057 | 3097 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
3090 | 3130 | frame.validate(); |
---|
3091 | 3131 | |
---|
3092 | 3132 | return; |
---|
3093 | | - } else if (event.getSource() == toggleSwitchItem) |
---|
| 3133 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
3094 | 3134 | { |
---|
3095 | 3135 | cameraView.ToggleSwitch(); |
---|
3096 | 3136 | cameraView.repaint(); |
---|
.. | .. |
---|
3497 | 3537 | tab.graphs[i] = null; |
---|
3498 | 3538 | } |
---|
3499 | 3539 | |
---|
| 3540 | + SetUndoStates(); |
---|
| 3541 | + |
---|
3500 | 3542 | // test save |
---|
3501 | 3543 | if (false) |
---|
3502 | 3544 | { |
---|
.. | .. |
---|
3519 | 3561 | |
---|
3520 | 3562 | void CopyChanged(Object3D obj) |
---|
3521 | 3563 | { |
---|
| 3564 | + SetUndoStates(); |
---|
| 3565 | + |
---|
3522 | 3566 | boolean temp = CameraPane.SWITCH; |
---|
3523 | 3567 | CameraPane.SWITCH = false; |
---|
3524 | 3568 | |
---|
.. | .. |
---|
3556 | 3600 | } |
---|
3557 | 3601 | |
---|
3558 | 3602 | refreshContents(); |
---|
| 3603 | + } |
---|
| 3604 | + |
---|
| 3605 | + cButton undoButton; |
---|
| 3606 | + cButton redoButton; |
---|
| 3607 | + |
---|
| 3608 | + void SetUndoStates() |
---|
| 3609 | + { |
---|
| 3610 | + cRadio tab = GetCurrentTab(); |
---|
| 3611 | + |
---|
| 3612 | + undoButton.setEnabled(tab.undoindex > 0); |
---|
| 3613 | + redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null); |
---|
3559 | 3614 | } |
---|
3560 | 3615 | |
---|
3561 | 3616 | public void Undo() |
---|
.. | .. |
---|
4735 | 4790 | String filename = browser.getFile(); |
---|
4736 | 4791 | if (filename != null && filename.length() > 0) |
---|
4737 | 4792 | { |
---|
| 4793 | + if (!filename.endsWith(".gfd")) |
---|
| 4794 | + filename += ".gfd"; |
---|
4738 | 4795 | lastname = browser.getDirectory() + filename; |
---|
4739 | 4796 | save(); |
---|
4740 | 4797 | } |
---|
.. | .. |
---|
4945 | 5002 | cGridBag optionsPanel; |
---|
4946 | 5003 | |
---|
4947 | 5004 | JTabbedPane objectPanel; |
---|
| 5005 | + boolean materialFlushed; |
---|
| 5006 | + Object3D latestObject; |
---|
4948 | 5007 | |
---|
4949 | 5008 | cGridBag XYZPanel; |
---|
4950 | 5009 | |
---|