.. | .. |
---|
52 | 52 | } |
---|
53 | 53 | } |
---|
54 | 54 | |
---|
| 55 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 56 | + { |
---|
| 57 | + try |
---|
| 58 | + { |
---|
| 59 | + ImageIcon icon = GetIcon(name); |
---|
| 60 | + return new cToggleButton(icon, border); |
---|
| 61 | + } |
---|
| 62 | + catch (Exception e) |
---|
| 63 | + { |
---|
| 64 | + return new cToggleButton(name, border); |
---|
| 65 | + } |
---|
| 66 | + } |
---|
| 67 | + |
---|
55 | 68 | cCheckBox GetCheckBox(String name, boolean border) |
---|
56 | 69 | { |
---|
57 | 70 | try |
---|
.. | .. |
---|
194 | 207 | |
---|
195 | 208 | objEditor.ctrlPanel.remove(namePanel); |
---|
196 | 209 | |
---|
197 | | - if (!GroupEditor.allparams) |
---|
| 210 | + if (!allparams) |
---|
198 | 211 | return; |
---|
199 | 212 | |
---|
200 | 213 | // objEditor.ctrlPanel.remove(liveCB); |
---|
.. | .. |
---|
324 | 337 | return frame.action(event, obj); |
---|
325 | 338 | } |
---|
326 | 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 | + |
---|
327 | 345 | void SetupMenu() |
---|
328 | 346 | { |
---|
329 | 347 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
.. | .. |
---|
370 | 388 | closeItem.addActionListener(this); |
---|
371 | 389 | |
---|
372 | 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 | + |
---|
373 | 417 | toolbarPanel = new JPanel(); |
---|
374 | 418 | toolbarPanel.setName("Toolbar"); |
---|
375 | 419 | treePanel = new cGridBag(); |
---|
.. | .. |
---|
384 | 428 | editPanel.add(editCommandsPanel); |
---|
385 | 429 | editPanel.add(ctrlPanel); |
---|
386 | 430 | |
---|
387 | | - materialPanel = new cGridBag().setVertical(true); |
---|
| 431 | + toolboxPanel = new cGridBag().setVertical(false); |
---|
| 432 | + toolboxPanel.setName("Toolbox"); |
---|
388 | 433 | |
---|
| 434 | + materialPanel = new cGridBag().setVertical(true); |
---|
389 | 435 | materialPanel.setName("Material"); |
---|
| 436 | + |
---|
390 | 437 | /*JTextPane*/ |
---|
391 | 438 | infoarea = createTextPane(); |
---|
392 | 439 | doc = infoarea.getStyledDocument(); |
---|
.. | .. |
---|
659 | 706 | |
---|
660 | 707 | boolean maximized; |
---|
661 | 708 | |
---|
| 709 | + cButton fullscreenLayout; |
---|
| 710 | + |
---|
662 | 711 | void Minimize() |
---|
663 | 712 | { |
---|
664 | 713 | frame.setState(Frame.ICONIFIED); |
---|
.. | .. |
---|
684 | 733 | |
---|
685 | 734 | void ToggleFullScreen() |
---|
686 | 735 | { |
---|
687 | | - if (CameraPane.FULLSCREEN) |
---|
| 736 | + cameraView.ToggleFullScreen(); |
---|
| 737 | + |
---|
| 738 | + if (!CameraPane.FULLSCREEN) |
---|
688 | 739 | { |
---|
689 | 740 | device.setFullScreenWindow(null); |
---|
690 | 741 | //frame.setVisible(false); |
---|
.. | .. |
---|
720 | 771 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
721 | 772 | framePanel.setDividerLocation(0); |
---|
722 | 773 | |
---|
723 | | - radio.layout = twoButton; |
---|
| 774 | + radio.layout = fullscreenLayout; |
---|
724 | 775 | radio.layout.doClick(); |
---|
725 | 776 | //frame.setVisible(true); |
---|
726 | 777 | } |
---|
727 | | - |
---|
728 | | - cameraView.ToggleFullScreen(); |
---|
729 | 778 | } |
---|
730 | 779 | |
---|
731 | 780 | private JTextPane createTextPane() |
---|
.. | .. |
---|
866 | 915 | JCheckBox speedupCB; |
---|
867 | 916 | JCheckBox rewindCB; |
---|
868 | 917 | JCheckBox flipVCB; |
---|
| 918 | + |
---|
| 919 | + cCheckBox toggleTextureCB; |
---|
| 920 | + cCheckBox toggleSwitchCB; |
---|
| 921 | + |
---|
869 | 922 | JComboBox texresMenu; |
---|
| 923 | + |
---|
870 | 924 | JButton resetButton; |
---|
871 | 925 | JButton stepButton; |
---|
872 | 926 | JButton stepAllButton; |
---|
.. | .. |
---|
1058 | 1112 | |
---|
1059 | 1113 | oe.ctrlPanel.Return(); |
---|
1060 | 1114 | |
---|
1061 | | - if (!GroupEditor.allparams) |
---|
| 1115 | + if (!allparams) |
---|
1062 | 1116 | return; |
---|
1063 | 1117 | |
---|
1064 | 1118 | setupPanel = new cGridBag().setVertical(false); |
---|
.. | .. |
---|
1401 | 1455 | // objectPanel.add(north); |
---|
1402 | 1456 | objectPanel.add(editPanel); |
---|
1403 | 1457 | objectPanel.add(infoPanel); |
---|
| 1458 | + objectPanel.add(toolboxPanel); |
---|
1404 | 1459 | |
---|
1405 | 1460 | /* |
---|
1406 | 1461 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1409 | 1464 | aConstraints.gridy += 1; |
---|
1410 | 1465 | aConstraints.gridwidth = 1; |
---|
1411 | 1466 | mainPanel.add(objectPanel, aConstraints); |
---|
1412 | | - */ |
---|
| 1467 | + */ |
---|
1413 | 1468 | |
---|
1414 | 1469 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1415 | 1470 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1426 | 1481 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1427 | 1482 | tabbedPane.add(scrollpane); |
---|
1428 | 1483 | |
---|
1429 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1430 | | - |
---|
1431 | | - optionsPanel = new cGridBag().setVertical(true); |
---|
| 1484 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1432 | 1485 | |
---|
1433 | 1486 | optionsPanel.setName("Options"); |
---|
1434 | 1487 | |
---|
.. | .. |
---|
1436 | 1489 | |
---|
1437 | 1490 | tabbedPane.add(optionsPanel); |
---|
1438 | 1491 | |
---|
| 1492 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1493 | + |
---|
1439 | 1494 | scenePanel.add(tabbedPane); |
---|
1440 | 1495 | |
---|
1441 | 1496 | /* |
---|
.. | .. |
---|
1528 | 1583 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1529 | 1584 | |
---|
1530 | 1585 | frame.setSize(1280, 860); |
---|
| 1586 | + |
---|
| 1587 | + frame.validate(); |
---|
1531 | 1588 | frame.setVisible(true); |
---|
1532 | 1589 | |
---|
1533 | 1590 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
2847 | 2904 | |
---|
2848 | 2905 | void SetMaterial(Object3D object) |
---|
2849 | 2906 | { |
---|
| 2907 | + latestObject = object; |
---|
| 2908 | + |
---|
2850 | 2909 | cMaterial mat = object.material; |
---|
2851 | 2910 | |
---|
2852 | 2911 | if (mat == null) |
---|
.. | .. |
---|
3032 | 3091 | cameraView.ToggleDL(); |
---|
3033 | 3092 | cameraView.repaint(); |
---|
3034 | 3093 | return; |
---|
3035 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3094 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
3036 | 3095 | { |
---|
3037 | 3096 | cameraView.ToggleTexture(); |
---|
3038 | 3097 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
3071 | 3130 | frame.validate(); |
---|
3072 | 3131 | |
---|
3073 | 3132 | return; |
---|
3074 | | - } else if (event.getSource() == toggleSwitchItem) |
---|
| 3133 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
3075 | 3134 | { |
---|
3076 | 3135 | cameraView.ToggleSwitch(); |
---|
3077 | 3136 | cameraView.repaint(); |
---|
.. | .. |
---|
3478 | 3537 | tab.graphs[i] = null; |
---|
3479 | 3538 | } |
---|
3480 | 3539 | |
---|
| 3540 | + SetUndoStates(); |
---|
| 3541 | + |
---|
3481 | 3542 | // test save |
---|
3482 | 3543 | if (false) |
---|
3483 | 3544 | { |
---|
.. | .. |
---|
3500 | 3561 | |
---|
3501 | 3562 | void CopyChanged(Object3D obj) |
---|
3502 | 3563 | { |
---|
| 3564 | + SetUndoStates(); |
---|
| 3565 | + |
---|
3503 | 3566 | boolean temp = CameraPane.SWITCH; |
---|
3504 | 3567 | CameraPane.SWITCH = false; |
---|
3505 | 3568 | |
---|
.. | .. |
---|
3537 | 3600 | } |
---|
3538 | 3601 | |
---|
3539 | 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); |
---|
3540 | 3614 | } |
---|
3541 | 3615 | |
---|
3542 | 3616 | public void Undo() |
---|
.. | .. |
---|
3726 | 3800 | assert false; |
---|
3727 | 3801 | } |
---|
3728 | 3802 | |
---|
3729 | | - void EditSelection() |
---|
| 3803 | + void EditSelection(boolean newWindow) |
---|
3730 | 3804 | { |
---|
3731 | 3805 | } |
---|
3732 | 3806 | |
---|
.. | .. |
---|
4221 | 4295 | |
---|
4222 | 4296 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4223 | 4297 | { |
---|
4224 | | - if (Globals.SAVEONMAKE) |
---|
| 4298 | + if (Globals.SAVEONMAKE) // && resetmodel) |
---|
4225 | 4299 | Save(); |
---|
4226 | 4300 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4227 | 4301 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
.. | .. |
---|
4309 | 4383 | { |
---|
4310 | 4384 | ResetModel(); |
---|
4311 | 4385 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4386 | + |
---|
| 4387 | + if (thing.Size() == 0) |
---|
| 4388 | + { |
---|
| 4389 | + //EditSelection(false); |
---|
| 4390 | + } |
---|
| 4391 | + |
---|
4312 | 4392 | refreshContents(); |
---|
4313 | 4393 | } |
---|
4314 | 4394 | |
---|
.. | .. |
---|
4710 | 4790 | String filename = browser.getFile(); |
---|
4711 | 4791 | if (filename != null && filename.length() > 0) |
---|
4712 | 4792 | { |
---|
| 4793 | + if (!filename.endsWith(".gfd")) |
---|
| 4794 | + filename += ".gfd"; |
---|
4713 | 4795 | lastname = browser.getDirectory() + filename; |
---|
4714 | 4796 | save(); |
---|
4715 | 4797 | } |
---|
.. | .. |
---|
4903 | 4985 | CheckboxMenuItem togglePaintItem; |
---|
4904 | 4986 | JSplitPane mainPanel; |
---|
4905 | 4987 | JScrollPane scrollpane; |
---|
| 4988 | + |
---|
4906 | 4989 | JPanel toolbarPanel; |
---|
| 4990 | + |
---|
4907 | 4991 | cGridBag treePanel; |
---|
| 4992 | + |
---|
4908 | 4993 | JPanel radioPanel; |
---|
4909 | 4994 | ButtonGroup buttonGroup; |
---|
4910 | | - cGridBag ctrlPanel; |
---|
| 4995 | + |
---|
| 4996 | + cGridBag toolboxPanel; |
---|
4911 | 4997 | cGridBag materialPanel; |
---|
| 4998 | + cGridBag ctrlPanel; |
---|
| 4999 | + |
---|
4912 | 5000 | JScrollPane infoPanel; |
---|
| 5001 | + |
---|
4913 | 5002 | cGridBag optionsPanel; |
---|
| 5003 | + |
---|
4914 | 5004 | JTabbedPane objectPanel; |
---|
| 5005 | + boolean materialFlushed; |
---|
| 5006 | + Object3D latestObject; |
---|
| 5007 | + |
---|
4915 | 5008 | cGridBag XYZPanel; |
---|
| 5009 | + |
---|
4916 | 5010 | JSplitPane gridPanel; |
---|
4917 | 5011 | JSplitPane bigPanel; |
---|
| 5012 | + |
---|
4918 | 5013 | cGridBag bigThree; |
---|
4919 | 5014 | cGridBag scenePanel; |
---|
4920 | 5015 | cGridBag centralPanel; |
---|
.. | .. |
---|
5029 | 5124 | cNumberSlider fogField; |
---|
5030 | 5125 | JLabel opacityPowerLabel; |
---|
5031 | 5126 | cNumberSlider opacityPowerField; |
---|
5032 | | - JTree jTree; |
---|
| 5127 | + cTree jTree; |
---|
5033 | 5128 | //ObjectUI parent; |
---|
5034 | 5129 | |
---|
5035 | 5130 | cNumberSlider normalpushField; |
---|