.. | .. |
---|
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 |
---|
.. | .. |
---|
370 | 383 | closeItem.addActionListener(this); |
---|
371 | 384 | |
---|
372 | 385 | objectPanel = new JTabbedPane(); |
---|
| 386 | + |
---|
| 387 | + ChangeListener changeListener = new ChangeListener() |
---|
| 388 | + { |
---|
| 389 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 390 | + { |
---|
| 391 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 392 | +// { |
---|
| 393 | +// if (latestObject != null) |
---|
| 394 | +// { |
---|
| 395 | +// refreshContents(true); |
---|
| 396 | +// SetMaterial(latestObject); |
---|
| 397 | +// } |
---|
| 398 | +// |
---|
| 399 | +// materialFlushed = true; |
---|
| 400 | +// } |
---|
| 401 | + |
---|
| 402 | + refreshContents(false); // To refresh Info tab |
---|
| 403 | + } |
---|
| 404 | + }; |
---|
| 405 | + objectPanel.addChangeListener(changeListener); |
---|
| 406 | + |
---|
373 | 407 | toolbarPanel = new JPanel(); |
---|
374 | 408 | toolbarPanel.setName("Toolbar"); |
---|
375 | 409 | treePanel = new cGridBag(); |
---|
.. | .. |
---|
384 | 418 | editPanel.add(editCommandsPanel); |
---|
385 | 419 | editPanel.add(ctrlPanel); |
---|
386 | 420 | |
---|
387 | | - materialPanel = new cGridBag().setVertical(true); |
---|
| 421 | + toolboxPanel = new cGridBag().setVertical(false); |
---|
| 422 | + toolboxPanel.setName("Toolbox"); |
---|
388 | 423 | |
---|
| 424 | + materialPanel = new cGridBag().setVertical(true); |
---|
389 | 425 | materialPanel.setName("Material"); |
---|
| 426 | + |
---|
390 | 427 | /*JTextPane*/ |
---|
391 | 428 | infoarea = createTextPane(); |
---|
392 | 429 | doc = infoarea.getStyledDocument(); |
---|
.. | .. |
---|
659 | 696 | |
---|
660 | 697 | boolean maximized; |
---|
661 | 698 | |
---|
| 699 | + cButton fullscreenLayout; |
---|
| 700 | + |
---|
662 | 701 | void Minimize() |
---|
663 | 702 | { |
---|
664 | 703 | frame.setState(Frame.ICONIFIED); |
---|
.. | .. |
---|
720 | 759 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
721 | 760 | framePanel.setDividerLocation(0); |
---|
722 | 761 | |
---|
723 | | - radio.layout = twoButton; |
---|
| 762 | + radio.layout = fullscreenLayout; |
---|
724 | 763 | radio.layout.doClick(); |
---|
725 | 764 | //frame.setVisible(true); |
---|
726 | 765 | } |
---|
.. | .. |
---|
866 | 905 | JCheckBox speedupCB; |
---|
867 | 906 | JCheckBox rewindCB; |
---|
868 | 907 | JCheckBox flipVCB; |
---|
| 908 | + |
---|
| 909 | + cCheckBox toggleTextureCB; |
---|
| 910 | + cCheckBox toggleSwitchCB; |
---|
| 911 | + |
---|
869 | 912 | JComboBox texresMenu; |
---|
| 913 | + |
---|
870 | 914 | JButton resetButton; |
---|
871 | 915 | JButton stepButton; |
---|
872 | 916 | JButton stepAllButton; |
---|
.. | .. |
---|
1395 | 1439 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1396 | 1440 | //tmp.setName("Edit"); |
---|
1397 | 1441 | objectPanel.add(materialPanel); |
---|
| 1442 | + objectPanel.add(toolboxPanel); |
---|
1398 | 1443 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1399 | 1444 | // north.setName("Edit"); |
---|
1400 | 1445 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
.. | .. |
---|
1426 | 1471 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1427 | 1472 | tabbedPane.add(scrollpane); |
---|
1428 | 1473 | |
---|
1429 | | - tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1430 | | - |
---|
1431 | | - optionsPanel = new cGridBag().setVertical(true); |
---|
| 1474 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1432 | 1475 | |
---|
1433 | 1476 | optionsPanel.setName("Options"); |
---|
1434 | 1477 | |
---|
.. | .. |
---|
1436 | 1479 | |
---|
1437 | 1480 | tabbedPane.add(optionsPanel); |
---|
1438 | 1481 | |
---|
| 1482 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
| 1483 | + |
---|
1439 | 1484 | scenePanel.add(tabbedPane); |
---|
1440 | 1485 | |
---|
1441 | 1486 | /* |
---|
.. | .. |
---|
1528 | 1573 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1529 | 1574 | |
---|
1530 | 1575 | frame.setSize(1280, 860); |
---|
| 1576 | + |
---|
| 1577 | + frame.validate(); |
---|
1531 | 1578 | frame.setVisible(true); |
---|
1532 | 1579 | |
---|
1533 | 1580 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
2847 | 2894 | |
---|
2848 | 2895 | void SetMaterial(Object3D object) |
---|
2849 | 2896 | { |
---|
| 2897 | + latestObject = object; |
---|
| 2898 | + |
---|
2850 | 2899 | cMaterial mat = object.material; |
---|
2851 | 2900 | |
---|
2852 | 2901 | if (mat == null) |
---|
.. | .. |
---|
3032 | 3081 | cameraView.ToggleDL(); |
---|
3033 | 3082 | cameraView.repaint(); |
---|
3034 | 3083 | return; |
---|
3035 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3084 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
3036 | 3085 | { |
---|
3037 | 3086 | cameraView.ToggleTexture(); |
---|
3038 | 3087 | // june 2013 copy.HardTouch(); |
---|
.. | .. |
---|
3071 | 3120 | frame.validate(); |
---|
3072 | 3121 | |
---|
3073 | 3122 | return; |
---|
3074 | | - } else if (event.getSource() == toggleSwitchItem) |
---|
| 3123 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
3075 | 3124 | { |
---|
3076 | 3125 | cameraView.ToggleSwitch(); |
---|
3077 | 3126 | cameraView.repaint(); |
---|
.. | .. |
---|
3726 | 3775 | assert false; |
---|
3727 | 3776 | } |
---|
3728 | 3777 | |
---|
3729 | | - void EditSelection() |
---|
| 3778 | + void EditSelection(boolean newWindow) |
---|
3730 | 3779 | { |
---|
3731 | 3780 | } |
---|
3732 | 3781 | |
---|
.. | .. |
---|
4221 | 4270 | |
---|
4222 | 4271 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4223 | 4272 | { |
---|
4224 | | - if (Globals.SAVEONMAKE) |
---|
| 4273 | + if (Globals.SAVEONMAKE) // && resetmodel) |
---|
4225 | 4274 | Save(); |
---|
4226 | 4275 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4227 | 4276 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
.. | .. |
---|
4309 | 4358 | { |
---|
4310 | 4359 | ResetModel(); |
---|
4311 | 4360 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4361 | + |
---|
| 4362 | + if (thing.Size() == 0) |
---|
| 4363 | + { |
---|
| 4364 | + //EditSelection(false); |
---|
| 4365 | + } |
---|
| 4366 | + |
---|
4312 | 4367 | refreshContents(); |
---|
4313 | 4368 | } |
---|
4314 | 4369 | |
---|
.. | .. |
---|
4903 | 4958 | CheckboxMenuItem togglePaintItem; |
---|
4904 | 4959 | JSplitPane mainPanel; |
---|
4905 | 4960 | JScrollPane scrollpane; |
---|
| 4961 | + |
---|
4906 | 4962 | JPanel toolbarPanel; |
---|
| 4963 | + |
---|
4907 | 4964 | cGridBag treePanel; |
---|
| 4965 | + |
---|
4908 | 4966 | JPanel radioPanel; |
---|
4909 | 4967 | ButtonGroup buttonGroup; |
---|
4910 | | - cGridBag ctrlPanel; |
---|
| 4968 | + |
---|
| 4969 | + cGridBag toolboxPanel; |
---|
4911 | 4970 | cGridBag materialPanel; |
---|
| 4971 | + cGridBag ctrlPanel; |
---|
| 4972 | + |
---|
4912 | 4973 | JScrollPane infoPanel; |
---|
| 4974 | + |
---|
4913 | 4975 | cGridBag optionsPanel; |
---|
| 4976 | + |
---|
4914 | 4977 | JTabbedPane objectPanel; |
---|
| 4978 | + boolean materialFlushed; |
---|
| 4979 | + Object3D latestObject; |
---|
| 4980 | + |
---|
4915 | 4981 | cGridBag XYZPanel; |
---|
| 4982 | + |
---|
4916 | 4983 | JSplitPane gridPanel; |
---|
4917 | 4984 | JSplitPane bigPanel; |
---|
| 4985 | + |
---|
4918 | 4986 | cGridBag bigThree; |
---|
4919 | 4987 | cGridBag scenePanel; |
---|
4920 | 4988 | cGridBag centralPanel; |
---|
.. | .. |
---|
5029 | 5097 | cNumberSlider fogField; |
---|
5030 | 5098 | JLabel opacityPowerLabel; |
---|
5031 | 5099 | cNumberSlider opacityPowerField; |
---|
5032 | | - JTree jTree; |
---|
| 5100 | + cTree jTree; |
---|
5033 | 5101 | //ObjectUI parent; |
---|
5034 | 5102 | |
---|
5035 | 5103 | cNumberSlider normalpushField; |
---|