.. | .. |
---|
19 | 19 | import //weka.core. |
---|
20 | 20 | matrix.Matrix; |
---|
21 | 21 | |
---|
| 22 | +import grafeme.ui.*; |
---|
| 23 | + |
---|
22 | 24 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 25 | ActionListener, ChangeListener, |
---|
24 | 26 | InputMethodListener, |
---|
.. | .. |
---|
28 | 30 | iSendInfo |
---|
29 | 31 | //KeyListener |
---|
30 | 32 | { |
---|
| 33 | + boolean timeline; |
---|
| 34 | + boolean wasFullScreen; |
---|
31 | 35 | |
---|
| 36 | + GroupEditor callee; |
---|
| 37 | + JFrame frame; |
---|
| 38 | + |
---|
32 | 39 | // SCRIPT |
---|
33 | 40 | |
---|
34 | 41 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
119 | 126 | void keyPressed(int key, int modifiers) |
---|
120 | 127 | { |
---|
121 | 128 | System.out.println("KEY PRESSED"); |
---|
122 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 129 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
123 | 130 | } |
---|
124 | 131 | */ |
---|
125 | 132 | |
---|
126 | 133 | static GridBagConstraints aConstraints; |
---|
127 | 134 | static GridBagConstraints aWindowConstraints; |
---|
128 | | - GroupEditor callee; |
---|
129 | | - JFrame frame; |
---|
| 135 | + |
---|
130 | 136 | static int GRIDWIDTH = 100; // 4; |
---|
131 | 137 | |
---|
132 | 138 | public void closeUI() |
---|
133 | 139 | { |
---|
134 | 140 | //new Exception().printStackTrace(); |
---|
135 | | - System.out.println("this = " + this); |
---|
136 | | - System.out.println("objEditor = " + objEditor); |
---|
| 141 | +// System.out.println("this = " + this); |
---|
| 142 | +// System.out.println("objEditor = " + objEditor); |
---|
137 | 143 | //nameField.removeActionListener(this); |
---|
138 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 144 | +// objEditor.ctrlPanel.remove(nameField); |
---|
139 | 145 | |
---|
140 | 146 | if (!GroupEditor.allparams) |
---|
141 | 147 | return; |
---|
142 | 148 | |
---|
143 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
144 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
145 | | - objEditor.ctrlPanel.remove(markCB); |
---|
146 | | - |
---|
147 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
148 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
149 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
150 | | - |
---|
151 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
152 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
153 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
154 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
155 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
156 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
157 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
158 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
159 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
160 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 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); |
---|
| 167 | + |
---|
| 168 | + objEditor.ctrlPanel.remove(namePanel); |
---|
| 169 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 170 | + objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 171 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 172 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 173 | + |
---|
| 174 | + //Remove(normalpushField); |
---|
161 | 175 | } |
---|
162 | 176 | |
---|
163 | 177 | public ObjEditor GetEditor() |
---|
164 | 178 | { |
---|
165 | 179 | return objEditor; //.GetEditor(); |
---|
166 | 180 | } |
---|
| 181 | + |
---|
| 182 | + // Sometimes myself, sometimes my callee's. |
---|
167 | 183 | ObjEditor objEditor; |
---|
168 | 184 | |
---|
169 | 185 | /* |
---|
.. | .. |
---|
238 | 254 | //if (!isDisplayable()) |
---|
239 | 255 | //setUndecorated(true); |
---|
240 | 256 | |
---|
241 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 257 | + //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
242 | 258 | client = inClient; |
---|
243 | 259 | copy = localCopy; |
---|
244 | 260 | copy.editWindow = this; |
---|
.. | .. |
---|
292 | 308 | //normalLensItem.addActionListener(this); |
---|
293 | 309 | cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
294 | 310 | revertCameraItem.addActionListener(this); |
---|
295 | | - cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen")); |
---|
296 | | - toggleFullItem.addItemListener(this); |
---|
297 | | - toggleFullItem.setState(CameraPane.FULLSCREEN); |
---|
| 311 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 312 | + toggleTimelineItem.addItemListener(this); |
---|
| 313 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 314 | + toggleFullScreenItem.addItemListener(this); |
---|
| 315 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
298 | 316 | cameraMenu.add("-"); |
---|
299 | 317 | cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
300 | 318 | toggleTextureItem.addItemListener(this); |
---|
301 | 319 | toggleTextureItem.setState(CameraPane.textureon); |
---|
302 | 320 | cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
303 | 321 | toggleLiveItem.addItemListener(this); |
---|
304 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
| 322 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
305 | 323 | cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
306 | 324 | stepItem.addActionListener(this); |
---|
307 | 325 | // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
.. | .. |
---|
343 | 361 | toolbarPanel.setName("Toolbar"); |
---|
344 | 362 | treePanel = new JPanel(); |
---|
345 | 363 | treePanel.setName("Tree"); |
---|
346 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
| 364 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
347 | 365 | ctrlPanel.setName("Edit"); |
---|
348 | | - materialPanel = new JPanel(); |
---|
| 366 | + materialPanel = new cGridBag().setVertical(true); |
---|
349 | 367 | materialPanel.setName("Material"); |
---|
350 | 368 | /*JTextPane*/ |
---|
351 | 369 | infoarea = createTextPane(); |
---|
.. | .. |
---|
374 | 392 | //mainPanel.setLayout(new GridBagLayout()); |
---|
375 | 393 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
376 | 394 | treePanel.setLayout(new GridBagLayout()); |
---|
377 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
378 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 395 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 396 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
379 | 397 | |
---|
380 | 398 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
381 | 399 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
522 | 540 | maxima.y = sel.toParent[3][1]; |
---|
523 | 541 | maxima.z = sel.toParent[3][2]; |
---|
524 | 542 | si.SendInfo(" Orig: " + maxima, "regular"); |
---|
525 | | - maxima.x = sel.globalTransform[3][0]; |
---|
526 | | - maxima.y = sel.globalTransform[3][1]; |
---|
527 | | - maxima.z = sel.globalTransform[3][2]; |
---|
528 | | - if (full) |
---|
529 | | - si.SendInfo(" Global Orig: " + maxima, "regular"); |
---|
530 | 543 | maxima.x = sel.toParent[0][0]; |
---|
531 | 544 | maxima.y = sel.toParent[1][1]; |
---|
532 | 545 | maxima.z = sel.toParent[2][2]; |
---|
533 | 546 | si.SendInfo(" Scale: " + maxima, "regular"); |
---|
534 | | - maxima.x = sel.globalTransform[0][0]; |
---|
535 | | - maxima.y = sel.globalTransform[1][1]; |
---|
536 | | - maxima.z = sel.globalTransform[2][2]; |
---|
| 547 | + maxima.x = sel.globalTransform[3][0]; |
---|
| 548 | + maxima.y = sel.globalTransform[3][1]; |
---|
| 549 | + maxima.z = sel.globalTransform[3][2]; |
---|
| 550 | + if (full) |
---|
| 551 | + si.SendInfo(" Global Orig: " + maxima, "regular"); |
---|
| 552 | + maxima.x = sel.globalTransform[0][0]; |
---|
| 553 | + maxima.y = sel.globalTransform[1][1]; |
---|
| 554 | + maxima.z = sel.globalTransform[2][2]; |
---|
537 | 555 | if (full) |
---|
538 | 556 | si.SendInfo(" Global Scale: " + maxima, "regular"); |
---|
539 | 557 | } |
---|
.. | .. |
---|
593 | 611 | System.err.println("Couldn't insert initial text into text pane."); |
---|
594 | 612 | } |
---|
595 | 613 | } |
---|
| 614 | + |
---|
| 615 | + void ToggleFullScreen() |
---|
| 616 | + { |
---|
| 617 | + if (CameraPane.FULLSCREEN) |
---|
| 618 | + { |
---|
| 619 | + frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 620 | + framePanel.add(bigThree); |
---|
| 621 | + frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 622 | + } else |
---|
| 623 | + { |
---|
| 624 | + frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 625 | + framePanel.remove(bigThree); |
---|
| 626 | + frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 627 | + } |
---|
| 628 | + cameraView.ToggleFullScreen(); |
---|
| 629 | + } |
---|
596 | 630 | |
---|
597 | 631 | private JTextArea createTextPane() |
---|
598 | 632 | { |
---|
.. | .. |
---|
739 | 773 | JButton slowerButton; |
---|
740 | 774 | JButton fasterButton; |
---|
741 | 775 | JButton remarkButton; |
---|
| 776 | + |
---|
| 777 | + cGridBag namePanel; |
---|
| 778 | + cGridBag setupPanel; |
---|
| 779 | + cGridBag commandsPanel; |
---|
| 780 | + cGridBag pushPanel; |
---|
| 781 | + cGridBag fillPanel; |
---|
742 | 782 | |
---|
743 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 783 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
744 | 784 | { |
---|
745 | 785 | JCheckBox cb; |
---|
746 | 786 | |
---|
747 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
748 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
749 | | -// oe.aConstraints.weightx = 1; |
---|
750 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
751 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 787 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
752 | 788 | cb.addItemListener(this); |
---|
753 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
754 | | - oe.aConstraints.gridwidth = 1; |
---|
755 | | - oe.aConstraints.gridx += 1; |
---|
756 | 789 | |
---|
757 | 790 | return cb; |
---|
758 | 791 | } |
---|
759 | 792 | |
---|
760 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 793 | + cButton AddButton(cGridBag panel, String label) |
---|
761 | 794 | { |
---|
762 | 795 | cButton cb; |
---|
763 | 796 | |
---|
764 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
765 | | - oe.aConstraints.gridwidth = 1; |
---|
766 | | -// oe.aConstraints.weightx = 1; |
---|
767 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
768 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 797 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
769 | 798 | cb.addActionListener(this); |
---|
770 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
771 | | - oe.aConstraints.gridwidth = 1; |
---|
772 | | - oe.aConstraints.gridx += 1; |
---|
773 | 799 | |
---|
774 | 800 | return cb; |
---|
775 | 801 | } |
---|
776 | 802 | |
---|
777 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 803 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
778 | 804 | { |
---|
779 | 805 | JComboBox combo; |
---|
780 | 806 | |
---|
781 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
782 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
783 | | - oe.aConstraints.gridx += 1; |
---|
| 807 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
784 | 808 | combo.addActionListener(this); |
---|
785 | 809 | |
---|
786 | 810 | return combo; |
---|
787 | 811 | } |
---|
788 | 812 | |
---|
789 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 813 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
790 | 814 | { |
---|
791 | | - NumberSlider combo; |
---|
| 815 | + cGridBag control = new cGridBag(); |
---|
| 816 | + |
---|
| 817 | + cNumberSlider combo; |
---|
792 | 818 | |
---|
793 | 819 | JLabel jlabel = new JLabel(label); |
---|
794 | | - |
---|
795 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
796 | 820 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
797 | | - aConstraints.gridwidth = 2; |
---|
798 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
799 | | - aConstraints.gridx += 1; |
---|
800 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
801 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
802 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
803 | | - aConstraints.gridx += 1; |
---|
804 | | - aConstraints.gridwidth = 1; |
---|
805 | | - |
---|
| 821 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 822 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
806 | 823 | combo.setFloat(current); |
---|
807 | | - |
---|
808 | | - combo.label = jlabel; |
---|
809 | | - |
---|
810 | | - combo.addChangeListener(this); |
---|
811 | | - |
---|
812 | | - return combo; |
---|
| 824 | + |
---|
| 825 | + panel.add(control); |
---|
| 826 | + |
---|
| 827 | + return control; |
---|
813 | 828 | } |
---|
814 | 829 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 830 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
816 | 831 | { |
---|
817 | | - NumberSlider combo; |
---|
| 832 | + cGridBag control = new cGridBag(); |
---|
| 833 | + |
---|
| 834 | + cNumberSlider combo; |
---|
818 | 835 | |
---|
819 | 836 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 837 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
823 | | - aConstraints.gridwidth = 2; |
---|
824 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
825 | | - aConstraints.gridx += 1; |
---|
826 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
827 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
828 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
829 | | - aConstraints.gridx += 1; |
---|
830 | | - aConstraints.gridwidth = 1; |
---|
831 | | - |
---|
| 838 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 839 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 840 | combo.setInteger(current); |
---|
833 | 841 | |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 842 | + panel.add(control); |
---|
| 843 | + |
---|
| 844 | + return control; |
---|
839 | 845 | } |
---|
840 | 846 | |
---|
841 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 847 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
842 | 848 | { |
---|
843 | 849 | JTextArea text; |
---|
844 | 850 | |
---|
845 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
846 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
847 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 851 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
848 | 852 | text.addCaretListener(this); |
---|
849 | | - aConstraints.gridx += 1; |
---|
850 | | - aConstraints.gridwidth = 1; |
---|
851 | 853 | |
---|
852 | 854 | return text; |
---|
853 | 855 | } |
---|
.. | .. |
---|
877 | 879 | objEditor.ctrlPanel.remove(j); |
---|
878 | 880 | } |
---|
879 | 881 | |
---|
| 882 | + void Remove(cNumberSlider j) |
---|
| 883 | + { |
---|
| 884 | + j.removeChangeListener(this); |
---|
| 885 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 886 | + objEditor.ctrlPanel.remove(j); |
---|
| 887 | + } |
---|
| 888 | + |
---|
880 | 889 | /* |
---|
881 | 890 | */ |
---|
882 | | - void Return() // ObjEditor oe) |
---|
| 891 | + void Return0() // ObjEditor oe) |
---|
883 | 892 | { |
---|
884 | 893 | aConstraints.gridy += 1; |
---|
885 | 894 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
938 | 947 | // oe.aConstraints.weighty = 0; |
---|
939 | 948 | // oe.aConstraints.gridx = 0; |
---|
940 | 949 | // oe.aConstraints.gridy = 0; |
---|
941 | | - SetupName(oe); |
---|
| 950 | + //SetupName(oe); |
---|
| 951 | + |
---|
| 952 | + namePanel = new cGridBag(); |
---|
| 953 | + |
---|
| 954 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 955 | + namePanel.add(nameField); |
---|
| 956 | + oe.ctrlPanel.add(namePanel); |
---|
| 957 | + |
---|
| 958 | + oe.ctrlPanel.Return(); |
---|
942 | 959 | |
---|
943 | 960 | if (!GroupEditor.allparams) |
---|
944 | 961 | return; |
---|
945 | 962 | |
---|
946 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
947 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
948 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 963 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 964 | + |
---|
| 965 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 966 | + link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master); |
---|
| 967 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
949 | 968 | // Return(); |
---|
950 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
951 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
952 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
953 | | - Return(); |
---|
954 | | - resetButton = AddButton(oe, "Reset"); |
---|
955 | | - stepButton = AddButton(oe, "Step"); |
---|
| 969 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 970 | + rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind); |
---|
| 971 | + randomCB = AddCheckBox(setupPanel, "Rand", copy.random); |
---|
| 972 | + |
---|
| 973 | + oe.ctrlPanel.add(setupPanel); |
---|
| 974 | + oe.ctrlPanel.Return(); |
---|
| 975 | + |
---|
| 976 | + commandsPanel = new cGridBag().setVertical(false); |
---|
| 977 | + |
---|
| 978 | + resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 979 | + stepButton = AddButton(commandsPanel, "Step"); |
---|
956 | 980 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
957 | 981 | // stepAllButton = AddButton(oe, "Step All"); |
---|
958 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
| 982 | + speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup); |
---|
959 | 983 | // Return(); |
---|
960 | | - slowerButton = AddButton(oe, "Slow"); |
---|
961 | | - fasterButton = AddButton(oe, "Fast"); |
---|
962 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 984 | + slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 985 | + fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 986 | + remarkButton = AddButton(commandsPanel, "Remark"); |
---|
963 | 987 | |
---|
964 | | - Return(); |
---|
| 988 | + oe.ctrlPanel.add(commandsPanel); |
---|
| 989 | + oe.ctrlPanel.Return(); |
---|
965 | 990 | |
---|
| 991 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1); |
---|
| 992 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 993 | + //Return(); |
---|
| 994 | + |
---|
| 995 | + oe.ctrlPanel.Return(); |
---|
| 996 | + |
---|
966 | 997 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
967 | 998 | // ObjEditor.aConstraints.gridx += 1; |
---|
968 | 999 | |
---|
.. | .. |
---|
1056 | 1087 | oe.aConstraints.gridwidth = 1; |
---|
1057 | 1088 | /**/ |
---|
1058 | 1089 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1059 | | - Return(); |
---|
| 1090 | + oe.ctrlPanel.Return(); |
---|
1060 | 1091 | |
---|
1061 | 1092 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1062 | 1093 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1158 | 1189 | //JPanel worldPanel = |
---|
1159 | 1190 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1160 | 1191 | //worldPanel.setName("World"); |
---|
1161 | | - /*JPanel*/ cameraPanel = |
---|
1162 | | - new JPanel(new BorderLayout()); |
---|
1163 | | - cameraPanel.add(cameraView); |
---|
| 1192 | + centralPanel = new cGridBag(); |
---|
| 1193 | + centralPanel.preferredWidth = 20; |
---|
| 1194 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1195 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1164 | 1196 | |
---|
| 1197 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1198 | + cameraPanel.setContinuousLayout(true); |
---|
| 1199 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1200 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1201 | +// cameraPanel.setDividerSize(9); |
---|
| 1202 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1203 | + |
---|
| 1204 | + centralPanel.add(cameraView); |
---|
| 1205 | + //frame.setJMenuBar(timelineMenubar); |
---|
| 1206 | + //centralPanel.add(timelinePanel); |
---|
| 1207 | + |
---|
1165 | 1208 | //topView.camera = ; |
---|
1166 | 1209 | //frontView.camera = new Camera(2); |
---|
1167 | 1210 | //sideView.camera = new Camera(3); |
---|
.. | .. |
---|
1177 | 1220 | //frontView.object = copy; |
---|
1178 | 1221 | //sideView.object = copy; |
---|
1179 | 1222 | |
---|
1180 | | - XYZPanel = new JPanel(); |
---|
1181 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1223 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1224 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1182 | 1225 | |
---|
1183 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1184 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1185 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1226 | + XYZPanel.preferredWidth = 5; |
---|
| 1227 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1228 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1229 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1186 | 1230 | |
---|
1187 | 1231 | /* |
---|
1188 | 1232 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1191 | 1235 | gridPanel.add(cameraView); |
---|
1192 | 1236 | gridPanel.add(XYZPanel); |
---|
1193 | 1237 | */ |
---|
1194 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout()); |
---|
| 1238 | + gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1195 | 1239 | gridPanel.setContinuousLayout(true); |
---|
1196 | 1240 | gridPanel.setOneTouchExpandable(true); |
---|
1197 | 1241 | gridPanel.setDividerLocation(1.0); |
---|
.. | .. |
---|
1220 | 1264 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1221 | 1265 | //tmp.setName("Edit"); |
---|
1222 | 1266 | objectPanel.add(materialPanel); |
---|
1223 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1224 | | - north.setName("Edit"); |
---|
1225 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1226 | | - objectPanel.add(north); |
---|
| 1267 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1268 | +// north.setName("Edit"); |
---|
| 1269 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1270 | +// objectPanel.add(north); |
---|
| 1271 | + objectPanel.add(ctrlPanel); |
---|
1227 | 1272 | objectPanel.add(infoPanel); |
---|
1228 | 1273 | |
---|
1229 | 1274 | /* |
---|
.. | .. |
---|
1244 | 1289 | scrollpane.setWheelScrollingEnabled(true); |
---|
1245 | 1290 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1246 | 1291 | |
---|
1247 | | - /*JTabbedPane*/ jtp = new JTabbedPane(); |
---|
1248 | | - jtp.add(scrollpane); |
---|
| 1292 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1293 | + scenePanel.preferredWidth = 7; |
---|
| 1294 | + |
---|
| 1295 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1296 | + tabbedPane.add(scrollpane); |
---|
1249 | 1297 | |
---|
1250 | | - jtp.add(FSPane = new cFileSystemPane(this)); |
---|
| 1298 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1251 | 1299 | |
---|
1252 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1300 | + optionsPanel = new cGridBag().setVertical(true); |
---|
1253 | 1301 | |
---|
1254 | 1302 | optionsPanel.setName("Options"); |
---|
1255 | | - jtp.add(optionsPanel); |
---|
1256 | | - |
---|
| 1303 | + |
---|
| 1304 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1305 | + |
---|
| 1306 | + tabbedPane.add(optionsPanel); |
---|
| 1307 | + |
---|
| 1308 | + scenePanel.add(tabbedPane); |
---|
1257 | 1309 | |
---|
1258 | 1310 | /* |
---|
1259 | 1311 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1275 | 1327 | jtp.add(tree); |
---|
1276 | 1328 | */ |
---|
1277 | 1329 | |
---|
1278 | | - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel); |
---|
| 1330 | + bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
1279 | 1331 | bigPanel.setContinuousLayout(true); |
---|
1280 | 1332 | bigPanel.setOneTouchExpandable(true); |
---|
1281 | 1333 | bigPanel.setDividerLocation(0.8); |
---|
.. | .. |
---|
1287 | 1339 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1288 | 1340 | //bigPanel.add(ctrlPanel); |
---|
1289 | 1341 | //bigPanel.add(gridPanel); |
---|
| 1342 | + /** |
---|
1290 | 1343 | bigThree = new JPanel(); |
---|
1291 | 1344 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1292 | 1345 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1297 | 1350 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1298 | 1351 | aWindowConstraints.weightx = 0; |
---|
1299 | 1352 | aWindowConstraints.weighty = 1; |
---|
1300 | | - bigThree.add(jtp, aWindowConstraints); |
---|
| 1353 | + bigThree.add(scenePanel, aWindowConstraints); |
---|
1301 | 1354 | aWindowConstraints.weightx = 1; |
---|
1302 | 1355 | aWindowConstraints.gridwidth = 3; |
---|
1303 | 1356 | // aConstraints.gridheight = 3; |
---|
1304 | 1357 | aWindowConstraints.gridx = 1; |
---|
1305 | 1358 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
1306 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 1359 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
1307 | 1360 | aWindowConstraints.weightx = 0; |
---|
1308 | 1361 | aWindowConstraints.gridx = 4; |
---|
1309 | 1362 | aWindowConstraints.gridwidth = 1; |
---|
1310 | 1363 | // aConstraints.gridheight = 3; |
---|
1311 | 1364 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1312 | 1365 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1366 | + /**/ |
---|
1313 | 1367 | |
---|
| 1368 | + bigThree = new cGridBag(); |
---|
| 1369 | + bigThree.addComponent(scenePanel); |
---|
| 1370 | + bigThree.addComponent(centralPanel); |
---|
| 1371 | + bigThree.addComponent(XYZPanel); |
---|
| 1372 | + |
---|
1314 | 1373 | // // SIDE EFFECT!!! |
---|
1315 | 1374 | // aConstraints.gridx = 0; |
---|
1316 | 1375 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1331 | 1390 | //worldPane.add(bigPanel); |
---|
1332 | 1391 | //worldPane.add(worldPanel); |
---|
1333 | 1392 | /**/ |
---|
1334 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1393 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1394 | + frame.add(/*"Center",*/framePanel); |
---|
1335 | 1395 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1336 | 1396 | |
---|
1337 | 1397 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
.. | .. |
---|
1352 | 1412 | }); |
---|
1353 | 1413 | } |
---|
1354 | 1414 | |
---|
| 1415 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1416 | + { |
---|
| 1417 | + } |
---|
| 1418 | + |
---|
1355 | 1419 | JTree GetTree() |
---|
1356 | 1420 | { |
---|
1357 | 1421 | return objEditor.jTree; |
---|
.. | .. |
---|
1363 | 1427 | ctrlPanel.removeAll(); |
---|
1364 | 1428 | } |
---|
1365 | 1429 | |
---|
1366 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1430 | + void SetupMaterial(cGridBag panel) |
---|
1367 | 1431 | { |
---|
1368 | | - aConstraints.weighty = 0; |
---|
1369 | | - //aConstraints.weightx = 1; |
---|
1370 | | - /* |
---|
| 1432 | + /* |
---|
1371 | 1433 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1372 | 1434 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1373 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1374 | | - aConstraints.gridx += 1; |
---|
1375 | 1435 | */ |
---|
1376 | 1436 | |
---|
1377 | | - aConstraints.gridwidth = 1; |
---|
1378 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1379 | | - aConstraints.gridx += 1; |
---|
1380 | | - aConstraints.weighty = 0; |
---|
1381 | | - aConstraints.gridwidth = 1; |
---|
| 1437 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 1438 | + |
---|
| 1439 | + editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints); |
---|
1382 | 1440 | |
---|
1383 | 1441 | /* |
---|
1384 | 1442 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1385 | | - aConstraints.gridx += 1; |
---|
1386 | | - aConstraints.weighty = 0; |
---|
1387 | | - aConstraints.gridwidth = 1; |
---|
1388 | 1443 | */ |
---|
1389 | 1444 | |
---|
1390 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1391 | | - aConstraints.gridx += 1; |
---|
| 1445 | + editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints); |
---|
| 1446 | + editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints); |
---|
| 1447 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1448 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
1392 | 1449 | |
---|
1393 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1394 | | - |
---|
1395 | | - aConstraints.gridx += 1; |
---|
1396 | | - |
---|
1397 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1398 | | - |
---|
1399 | | - aConstraints.gridx += 1; |
---|
1400 | | - |
---|
1401 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1402 | | - |
---|
1403 | | - aConstraints.gridx = 0; |
---|
1404 | | - aConstraints.gridy += 1; |
---|
1405 | | - aConstraints.weighty = 0; |
---|
1406 | | - aConstraints.gridwidth = 1; |
---|
| 1450 | + panel.add(editBar); |
---|
| 1451 | + |
---|
1407 | 1452 | /**/ |
---|
1408 | 1453 | //aConstraints.weighty = 0; |
---|
1409 | 1454 | ////aConstraints.weightx = 1; |
---|
1410 | 1455 | //aConstraints.weighty = 1; |
---|
1411 | 1456 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1412 | 1457 | //aConstraints.gridx += 1; |
---|
1413 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1414 | | - aConstraints.weighty = 0; |
---|
1415 | | - aConstraints.gridx = 0; |
---|
1416 | | - aConstraints.gridy += 1; |
---|
1417 | | - aConstraints.gridwidth = 1; |
---|
| 1458 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1418 | 1459 | |
---|
1419 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1420 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1421 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1422 | | - aConstraints.gridx += 1; |
---|
1423 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1424 | | - //aConstraints.weightx = 0; |
---|
1425 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1426 | | - aConstraints.gridx = 0; |
---|
1427 | | - aConstraints.gridy += 1; |
---|
1428 | | - aConstraints.gridwidth = 1; |
---|
| 1460 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1461 | + |
---|
| 1462 | + cGridBag color = new cGridBag(); |
---|
| 1463 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1464 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1465 | + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1466 | + //colorField.preferredWidth = 200; |
---|
| 1467 | + colorSection.add(color); |
---|
1429 | 1468 | |
---|
1430 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1431 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1432 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1433 | | - aConstraints.gridx += 1; |
---|
1434 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1435 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1436 | | - aConstraints.gridx = 0; |
---|
1437 | | - aConstraints.gridy += 1; |
---|
1438 | | - aConstraints.gridwidth = 1; |
---|
| 1469 | + cGridBag modulation = new cGridBag(); |
---|
| 1470 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 1471 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1472 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1473 | + colorSection.add(modulation); |
---|
1439 | 1474 | |
---|
1440 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1441 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1442 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1443 | | - aConstraints.gridx += 1; |
---|
1444 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1445 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1446 | | - aConstraints.gridx = 0; |
---|
1447 | | - aConstraints.gridy += 1; |
---|
1448 | | - aConstraints.gridwidth = 1; |
---|
| 1475 | + cGridBag texture = new cGridBag(); |
---|
| 1476 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 1477 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1478 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1479 | + colorSection.add(texture); |
---|
1449 | 1480 | |
---|
1450 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1451 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1452 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1453 | | - aConstraints.gridx += 1; |
---|
1454 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1455 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1456 | | - aConstraints.gridx = 0; |
---|
1457 | | - aConstraints.gridy += 1; |
---|
1458 | | - aConstraints.gridwidth = 1; |
---|
| 1481 | + cGridBag anisoU = new cGridBag(); |
---|
| 1482 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1483 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1484 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1485 | + colorSection.add(anisoU); |
---|
1459 | 1486 | |
---|
1460 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1461 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1462 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1463 | | - aConstraints.gridx += 1; |
---|
1464 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1465 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1466 | | - aConstraints.gridx = 0; |
---|
1467 | | - aConstraints.gridy += 1; |
---|
1468 | | - aConstraints.gridwidth = 1; |
---|
| 1487 | + cGridBag anisoV = new cGridBag(); |
---|
| 1488 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1489 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1490 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1491 | + colorSection.add(anisoV); |
---|
1469 | 1492 | |
---|
1470 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1471 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1472 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1473 | | - aConstraints.gridx += 1; |
---|
1474 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1475 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1476 | | - aConstraints.gridx = 0; |
---|
1477 | | - aConstraints.gridy += 1; |
---|
1478 | | - aConstraints.gridwidth = 1; |
---|
| 1493 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1494 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1495 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1496 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1497 | + colorSection.add(shadowbias); |
---|
1479 | 1498 | |
---|
1480 | | - //aConstraints.weighty = 1; |
---|
1481 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1482 | | - //aConstraints.gridx += 1; |
---|
1483 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1484 | | - aConstraints.weighty = 0; |
---|
1485 | | - aConstraints.gridx = 0; |
---|
1486 | | - aConstraints.gridy += 1; |
---|
1487 | | - aConstraints.gridwidth = 1; |
---|
| 1499 | + panel.add(new JSeparator()); |
---|
| 1500 | + |
---|
| 1501 | + panel.add(colorSection); |
---|
| 1502 | + |
---|
| 1503 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1504 | + |
---|
| 1505 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 1506 | + |
---|
| 1507 | + cGridBag diffuse = new cGridBag(); |
---|
| 1508 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 1509 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1510 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1511 | + diffuseSection.add(diffuse); |
---|
1488 | 1512 | |
---|
1489 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1490 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1491 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1492 | | - aConstraints.gridx += 1; |
---|
1493 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1494 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1495 | | - aConstraints.gridx = 0; |
---|
1496 | | - aConstraints.gridy += 1; |
---|
1497 | | - aConstraints.gridwidth = 1; |
---|
| 1513 | + cGridBag diffuseness = new cGridBag(); |
---|
| 1514 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 1515 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1516 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1517 | + diffuseSection.add(diffuseness); |
---|
1498 | 1518 | |
---|
1499 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1500 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1501 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1502 | | - aConstraints.gridx += 1; |
---|
1503 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1504 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1505 | | - aConstraints.gridx = 0; |
---|
1506 | | - aConstraints.gridy += 1; |
---|
1507 | | - aConstraints.gridwidth = 1; |
---|
| 1519 | + cGridBag selfshadow = new cGridBag(); |
---|
| 1520 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 1521 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1522 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1523 | + diffuseSection.add(selfshadow); |
---|
1508 | 1524 | |
---|
1509 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1510 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1511 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1512 | | - aConstraints.gridx += 1; |
---|
1513 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1514 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1515 | | - aConstraints.gridx = 0; |
---|
1516 | | - aConstraints.gridy += 1; |
---|
1517 | | - aConstraints.gridwidth = 1; |
---|
| 1525 | + cGridBag sheen = new cGridBag(); |
---|
| 1526 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 1527 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1528 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1529 | + diffuseSection.add(sheen); |
---|
1518 | 1530 | |
---|
1519 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1520 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1521 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1522 | | - aConstraints.gridx += 1; |
---|
1523 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1524 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1525 | | - aConstraints.gridx = 0; |
---|
1526 | | - aConstraints.gridy += 1; |
---|
1527 | | - aConstraints.gridwidth = 1; |
---|
| 1531 | + cGridBag subsurface = new cGridBag(); |
---|
| 1532 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 1533 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1534 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1535 | + diffuseSection.add(subsurface); |
---|
1528 | 1536 | |
---|
1529 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1530 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1531 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1532 | | - aConstraints.gridx += 1; |
---|
1533 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1534 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1535 | | - aConstraints.gridx = 0; |
---|
1536 | | - aConstraints.gridy += 1; |
---|
1537 | | - aConstraints.gridwidth = 1; |
---|
| 1537 | + cGridBag shadow = new cGridBag(); |
---|
| 1538 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 1539 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1540 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1541 | + diffuseSection.add(shadow); |
---|
1538 | 1542 | |
---|
1539 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1540 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1541 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1542 | | - aConstraints.gridx += 1; |
---|
1543 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1544 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1545 | | - aConstraints.gridx = 0; |
---|
1546 | | - aConstraints.gridy += 1; |
---|
1547 | | - aConstraints.gridwidth = 1; |
---|
| 1543 | + cGridBag fakedepth = new cGridBag(); |
---|
| 1544 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 1545 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1546 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1547 | + diffuseSection.add(fakedepth); |
---|
1548 | 1548 | |
---|
1549 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1550 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1551 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1552 | | - aConstraints.gridx += 1; |
---|
1553 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1554 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1555 | | - aConstraints.gridx = 0; |
---|
1556 | | - aConstraints.gridy += 1; |
---|
1557 | | - aConstraints.gridwidth = 1; |
---|
| 1549 | + panel.add(new JSeparator()); |
---|
| 1550 | + |
---|
| 1551 | + panel.add(diffuseSection); |
---|
| 1552 | + |
---|
| 1553 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1554 | + |
---|
| 1555 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1558 | 1556 | |
---|
1559 | | - //aConstraints.weighty = 1; |
---|
1560 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1561 | | - //aConstraints.gridx += 1; |
---|
1562 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1563 | | - aConstraints.weighty = 0; |
---|
1564 | | - aConstraints.gridx = 0; |
---|
1565 | | - aConstraints.gridy += 1; |
---|
1566 | | - aConstraints.gridwidth = 1; |
---|
| 1557 | + cGridBag specular = new cGridBag(); |
---|
| 1558 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 1559 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1560 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1561 | + specularSection.add(specular); |
---|
1567 | 1562 | |
---|
1568 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1569 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1570 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1571 | | - aConstraints.gridx += 1; |
---|
1572 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1573 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1574 | | - aConstraints.gridx = 0; |
---|
1575 | | - aConstraints.gridy += 1; |
---|
1576 | | - aConstraints.gridwidth = 1; |
---|
| 1563 | + cGridBag lightarea = new cGridBag(); |
---|
| 1564 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 1565 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1566 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1567 | + specularSection.add(lightarea); |
---|
1577 | 1568 | |
---|
1578 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1579 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1580 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1581 | | - aConstraints.gridx += 1; |
---|
1582 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1583 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1584 | | - aConstraints.gridx = 0; |
---|
1585 | | - aConstraints.gridy += 1; |
---|
1586 | | - aConstraints.gridwidth = 1; |
---|
| 1569 | + cGridBag shininess = new cGridBag(); |
---|
| 1570 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 1571 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1572 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1573 | + specularSection.add(shininess); |
---|
1587 | 1574 | |
---|
1588 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1589 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1590 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1591 | | - aConstraints.gridx += 1; |
---|
1592 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1593 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1594 | | - aConstraints.gridx = 0; |
---|
1595 | | - aConstraints.gridy += 1; |
---|
1596 | | - aConstraints.gridwidth = 1; |
---|
| 1575 | + cGridBag metalness = new cGridBag(); |
---|
| 1576 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 1577 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1578 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1579 | + specularSection.add(metalness); |
---|
1597 | 1580 | |
---|
1598 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1599 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1600 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1601 | | - aConstraints.gridx += 1; |
---|
1602 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1603 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1604 | | - aConstraints.gridx = 0; |
---|
1605 | | - aConstraints.gridy += 1; |
---|
1606 | | - aConstraints.gridwidth = 1; |
---|
| 1581 | + cGridBag velvet = new cGridBag(); |
---|
| 1582 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 1583 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1584 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1585 | + specularSection.add(velvet); |
---|
1607 | 1586 | |
---|
1608 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1609 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1610 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1611 | | - aConstraints.gridx += 1; |
---|
1612 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1613 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1614 | | - aConstraints.gridx = 0; |
---|
1615 | | - aConstraints.gridy += 1; |
---|
1616 | | - aConstraints.gridwidth = 1; |
---|
1617 | | - |
---|
1618 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1619 | | - Return(); |
---|
| 1587 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1588 | + //Return(); |
---|
1620 | 1589 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1621 | 1590 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1622 | 1591 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1627 | 1596 | // aConstraints.gridy += 1; |
---|
1628 | 1597 | // aConstraints.gridwidth = 1; |
---|
1629 | 1598 | |
---|
1630 | | - //aConstraints.weighty = 1; |
---|
1631 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1632 | | - //aConstraints.gridx += 1; |
---|
1633 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1634 | | - aConstraints.weighty = 0; |
---|
1635 | | - aConstraints.gridx = 0; |
---|
1636 | | - aConstraints.gridy += 1; |
---|
1637 | | - aConstraints.gridwidth = 1; |
---|
1638 | 1599 | |
---|
1639 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1640 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1641 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1642 | | - aConstraints.gridx += 1; |
---|
1643 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1644 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1645 | | - aConstraints.gridx = 0; |
---|
1646 | | - aConstraints.gridy += 1; |
---|
1647 | | - aConstraints.gridwidth = 1; |
---|
| 1600 | + panel.add(new JSeparator()); |
---|
| 1601 | + |
---|
| 1602 | + panel.add(specularSection); |
---|
| 1603 | + |
---|
| 1604 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1605 | + |
---|
| 1606 | + cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1648 | 1607 | |
---|
1649 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1650 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1651 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1652 | | - aConstraints.gridx += 1; |
---|
1653 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1654 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1655 | | - aConstraints.gridx = 0; |
---|
1656 | | - aConstraints.gridy += 1; |
---|
1657 | | - aConstraints.gridwidth = 1; |
---|
| 1608 | + cGridBag camera = new cGridBag(); |
---|
| 1609 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 1610 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1611 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1612 | + globalSection.add(camera); |
---|
1658 | 1613 | |
---|
1659 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1660 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1661 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1662 | | - aConstraints.gridx += 1; |
---|
1663 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1664 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1665 | | - aConstraints.gridx = 0; |
---|
1666 | | - aConstraints.gridy += 1; |
---|
1667 | | - aConstraints.gridwidth = 1; |
---|
| 1614 | + cGridBag ambient = new cGridBag(); |
---|
| 1615 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 1616 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1617 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1618 | + globalSection.add(ambient); |
---|
1668 | 1619 | |
---|
1669 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1670 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1671 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1672 | | - aConstraints.gridx += 1; |
---|
1673 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1674 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1675 | | - aConstraints.gridx = 0; |
---|
1676 | | - aConstraints.gridy += 1; |
---|
1677 | | - aConstraints.gridwidth = 1; |
---|
1678 | | - aConstraints.weighty = 0; |
---|
| 1620 | + cGridBag backlit = new cGridBag(); |
---|
| 1621 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 1622 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1623 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1624 | + globalSection.add(backlit); |
---|
1679 | 1625 | |
---|
1680 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1681 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1682 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1683 | | - aConstraints.gridx += 1; |
---|
1684 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1685 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1686 | | - aConstraints.gridx = 0; |
---|
1687 | | - aConstraints.gridy += 1; |
---|
1688 | | - aConstraints.gridwidth = 1; |
---|
| 1626 | + cGridBag opacity = new cGridBag(); |
---|
| 1627 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1628 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1629 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1630 | + globalSection.add(opacity); |
---|
1689 | 1631 | |
---|
1690 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1691 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1692 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1693 | | - aConstraints.gridx += 1; |
---|
1694 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1695 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1696 | | - aConstraints.gridx = 0; |
---|
1697 | | - aConstraints.gridy += 1; |
---|
1698 | | - aConstraints.gridwidth = 1; |
---|
| 1632 | + panel.add(new JSeparator()); |
---|
| 1633 | + |
---|
| 1634 | + panel.add(globalSection); |
---|
| 1635 | + |
---|
| 1636 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1637 | + |
---|
| 1638 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1699 | 1639 | |
---|
1700 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1701 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1702 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1703 | | - aConstraints.gridx += 1; |
---|
1704 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1705 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1706 | | - aConstraints.gridx = 0; |
---|
1707 | | - aConstraints.gridy += 1; |
---|
1708 | | - aConstraints.gridwidth = 1; |
---|
| 1640 | + cGridBag bump = new cGridBag(); |
---|
| 1641 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 1642 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1643 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1644 | + textureSection.add(bump); |
---|
1709 | 1645 | |
---|
1710 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1711 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1712 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1713 | | - aConstraints.gridx += 1; |
---|
1714 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1715 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1716 | | - aConstraints.gridx = 0; |
---|
1717 | | - aConstraints.gridy += 1; |
---|
1718 | | - aConstraints.gridwidth = 1; |
---|
| 1646 | + cGridBag noise = new cGridBag(); |
---|
| 1647 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 1648 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1649 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 1650 | + textureSection.add(noise); |
---|
1719 | 1651 | |
---|
1720 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1721 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1722 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1723 | | - aConstraints.gridx += 1; |
---|
1724 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1725 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1726 | | - aConstraints.gridx = 0; |
---|
1727 | | - aConstraints.gridy += 1; |
---|
1728 | | - aConstraints.gridwidth = 1; |
---|
| 1652 | + cGridBag power = new cGridBag(); |
---|
| 1653 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 1654 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1655 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 1656 | + textureSection.add(power); |
---|
1729 | 1657 | |
---|
1730 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1731 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1732 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1733 | | - aConstraints.gridx += 1; |
---|
1734 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1735 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1736 | | - aConstraints.gridx = 0; |
---|
1737 | | - aConstraints.gridy += 1; |
---|
1738 | | - aConstraints.gridwidth = 1; |
---|
| 1658 | + cGridBag borderfade = new cGridBag(); |
---|
| 1659 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 1660 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1661 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1662 | + textureSection.add(borderfade); |
---|
1739 | 1663 | |
---|
1740 | | - //aConstraints.weighty = 1; |
---|
1741 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1742 | | - //aConstraints.gridx += 1; |
---|
1743 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1744 | | - aConstraints.weighty = 0; |
---|
| 1664 | + cGridBag fog = new cGridBag(); |
---|
| 1665 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 1666 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1667 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 1668 | + textureSection.add(fog); |
---|
1745 | 1669 | |
---|
1746 | | - aConstraints.gridx = 0; |
---|
1747 | | - aConstraints.gridy = 0; |
---|
1748 | | - aConstraints.gridwidth = 1; |
---|
| 1670 | + cGridBag opacityPower = new cGridBag(); |
---|
| 1671 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 1672 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1673 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 1674 | + textureSection.add(opacityPower); |
---|
| 1675 | + |
---|
| 1676 | + panel.add(new JSeparator()); |
---|
| 1677 | + |
---|
| 1678 | + panel.add(textureSection); |
---|
| 1679 | + |
---|
| 1680 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1749 | 1681 | |
---|
1750 | 1682 | SetMaterial(copy); // .GetMaterial()); |
---|
1751 | 1683 | |
---|
1752 | | - colorField.addChangeListener(this); |
---|
1753 | | - modulationField.addChangeListener(this); |
---|
| 1684 | + //colorField.addChangeListener(this); |
---|
| 1685 | +// modulationField.addChangeListener(this); |
---|
1754 | 1686 | metalnessField.addChangeListener(this); |
---|
1755 | 1687 | diffuseField.addChangeListener(this); |
---|
1756 | 1688 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1859 | 1791 | } |
---|
1860 | 1792 | |
---|
1861 | 1793 | // Images/textures |
---|
1862 | | - if (textures |
---|
1863 | | - && (filename.toLowerCase().endsWith(".jpg") |
---|
1864 | | - || filename.toLowerCase().endsWith(".jpeg") |
---|
1865 | | - || filename.toLowerCase().endsWith(".gif") |
---|
1866 | | - || filename.toLowerCase().endsWith(".png") |
---|
1867 | | - || filename.toLowerCase().endsWith(".tre") |
---|
1868 | | - || filename.toLowerCase().endsWith(".bmp") |
---|
1869 | | - || filename.toLowerCase().endsWith(".tga") |
---|
1870 | | - || filename.toLowerCase().endsWith(".sgi") |
---|
1871 | | - || filename.toLowerCase().endsWith(".tif") |
---|
1872 | | - || filename.toLowerCase().endsWith(".tiff"))) |
---|
| 1794 | + if (filename.toLowerCase().endsWith(".jpg") |
---|
| 1795 | + || filename.toLowerCase().endsWith(".jpeg") |
---|
| 1796 | + || filename.toLowerCase().endsWith(".gif") |
---|
| 1797 | + || filename.toLowerCase().endsWith(".png") |
---|
| 1798 | + || filename.toLowerCase().endsWith(".tre") |
---|
| 1799 | + || filename.toLowerCase().endsWith(".bmp") |
---|
| 1800 | + || filename.toLowerCase().endsWith(".tga") |
---|
| 1801 | + || filename.toLowerCase().endsWith(".sgi") |
---|
| 1802 | + || filename.toLowerCase().endsWith(".tif") |
---|
| 1803 | + || filename.toLowerCase().endsWith(".tiff")) |
---|
1873 | 1804 | { |
---|
1874 | | - DropTexture(filename); |
---|
| 1805 | + if (textures) |
---|
| 1806 | + DropTexture(filename); |
---|
| 1807 | + else |
---|
| 1808 | + CreateBillboard(filename); |
---|
1875 | 1809 | continue; |
---|
1876 | 1810 | } |
---|
1877 | 1811 | |
---|
.. | .. |
---|
1880 | 1814 | } |
---|
1881 | 1815 | |
---|
1882 | 1816 | ResetModel(); |
---|
| 1817 | + } |
---|
| 1818 | + |
---|
| 1819 | + void CreateBillboard(String filename) |
---|
| 1820 | + { |
---|
| 1821 | + Object3D source = null; |
---|
| 1822 | + Object3D group = copy; |
---|
| 1823 | + |
---|
| 1824 | + if (group.selection.size() > 0) |
---|
| 1825 | + { |
---|
| 1826 | + source = group.selection.get(0); |
---|
| 1827 | + } |
---|
| 1828 | + |
---|
| 1829 | + Grid grid = new Grid(1,1); |
---|
| 1830 | + grid.material = null; |
---|
| 1831 | + |
---|
| 1832 | + grid.toParent = LA.newMatrix(); |
---|
| 1833 | + grid.fromParent = LA.newMatrix(); |
---|
| 1834 | + LA.matYRotate(grid.toParent, Math.PI/2); |
---|
| 1835 | + LA.matXRotate(grid.toParent, -Math.PI/2); |
---|
| 1836 | + LA.matXRotate(grid.fromParent, Math.PI/2); |
---|
| 1837 | + LA.matYRotate(grid.fromParent, -Math.PI/2); |
---|
| 1838 | + |
---|
| 1839 | + BillboardNode bb = new BillboardNode(); |
---|
| 1840 | + bb.addChild(grid); |
---|
| 1841 | + |
---|
| 1842 | + Object3D newgroup = new Object3D(); |
---|
| 1843 | + newgroup.CreateMaterial(); |
---|
| 1844 | + |
---|
| 1845 | + File file = new File(filename); |
---|
| 1846 | + newgroup.name = file.getName(); |
---|
| 1847 | + newgroup.addChild(bb); |
---|
| 1848 | + |
---|
| 1849 | + Object3D main = newgroup; |
---|
| 1850 | + |
---|
| 1851 | + main.SetPigmentTexture(filename); |
---|
| 1852 | + |
---|
| 1853 | + if (source != null) |
---|
| 1854 | + { |
---|
| 1855 | + main.material = new cMaterial(source.material); |
---|
| 1856 | + if (main.projectedVertices.length < source.projectedVertices.length) |
---|
| 1857 | + { |
---|
| 1858 | + main.projectedVertices = new Object3D.cVector2[source.projectedVertices.length]; |
---|
| 1859 | + } |
---|
| 1860 | + |
---|
| 1861 | + for (int i=0; i<source.projectedVertices.length; i++) |
---|
| 1862 | + { |
---|
| 1863 | + main.projectedVertices[i].x = source.projectedVertices[i].x; |
---|
| 1864 | + main.projectedVertices[i].y = source.projectedVertices[i].y; |
---|
| 1865 | + } |
---|
| 1866 | + |
---|
| 1867 | + main.texres = source.texres; |
---|
| 1868 | + } |
---|
| 1869 | + |
---|
| 1870 | + makeSomething(newgroup, false); |
---|
1883 | 1871 | } |
---|
1884 | 1872 | |
---|
1885 | 1873 | Point location; |
---|
.. | .. |
---|
2138 | 2126 | { |
---|
2139 | 2127 | Mocap sel = (Mocap) copy.selection.get(0); |
---|
2140 | 2128 | |
---|
| 2129 | + sel.SetCurrentBones(sel.frame); |
---|
| 2130 | + |
---|
2141 | 2131 | sel.fullname = fullname; |
---|
2142 | 2132 | |
---|
2143 | 2133 | if (changename) |
---|
.. | .. |
---|
2151 | 2141 | sel.smoothed = false; |
---|
2152 | 2142 | |
---|
2153 | 2143 | // if (!changename) |
---|
2154 | | - sel.SetPositionDelta(false, true, true, true/*?*/); // false |
---|
| 2144 | + //sel.SetPositionDelta(false, true, true, true/*?*/); // false |
---|
| 2145 | + sel.SetGlobalTransform(); |
---|
| 2146 | + sel.LoadData(); |
---|
| 2147 | + sel.Rewind(); |
---|
| 2148 | + sel.Fade(); |
---|
2155 | 2149 | // sel.setPose(0); |
---|
2156 | 2150 | refreshContents(); |
---|
2157 | 2151 | } else |
---|
2158 | 2152 | { |
---|
2159 | 2153 | mocap.Reset(); |
---|
2160 | 2154 | // new skeleton |
---|
2161 | | - makeSomething(mocap, false); // true); |
---|
| 2155 | + makeSomething(mocap, true); // true); |
---|
2162 | 2156 | } |
---|
2163 | 2157 | } catch (Exception e) |
---|
2164 | 2158 | { |
---|
.. | .. |
---|
2185 | 2179 | { |
---|
2186 | 2180 | Mocap sel = (Mocap) select; |
---|
2187 | 2181 | |
---|
| 2182 | + sel.SetCurrentBones(sel.frame); |
---|
| 2183 | + |
---|
2188 | 2184 | File file = new File(fullname); |
---|
2189 | 2185 | |
---|
2190 | 2186 | // Mocap mocap = new Mocap("Mocap" + file.getName()); |
---|
.. | .. |
---|
2251 | 2247 | |
---|
2252 | 2248 | if (!changename) |
---|
2253 | 2249 | { |
---|
2254 | | - sel.SetPositionDelta(false, true, true, true/*?*/); |
---|
| 2250 | + //sel.SetPositionDelta(false, true, true, true/*?*/); |
---|
| 2251 | + sel.SetGlobalTransform(); |
---|
| 2252 | + sel.LoadData(); |
---|
| 2253 | + sel.Rewind(); |
---|
| 2254 | + sel.Fade(); |
---|
2255 | 2255 | } |
---|
2256 | 2256 | |
---|
2257 | 2257 | // sel.setPose(0); |
---|
.. | .. |
---|
2494 | 2494 | } |
---|
2495 | 2495 | if (input == null) |
---|
2496 | 2496 | { |
---|
| 2497 | + new Exception().printStackTrace(); |
---|
2497 | 2498 | System.exit(0); |
---|
2498 | 2499 | } |
---|
2499 | 2500 | |
---|
.. | .. |
---|
2890 | 2891 | // june 2013 copy.HardTouch(); |
---|
2891 | 2892 | cameraView.repaint(); |
---|
2892 | 2893 | return; |
---|
2893 | | - } else if (event.getSource() == toggleFullItem) |
---|
| 2894 | + } else if (event.getSource() == toggleTimelineItem) |
---|
2894 | 2895 | { |
---|
2895 | | - if (CameraPane.FULLSCREEN) |
---|
| 2896 | + timeline ^= true; |
---|
| 2897 | + |
---|
| 2898 | + if (timeline) |
---|
2896 | 2899 | { |
---|
2897 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
2898 | | - framePanel.add(bigThree); |
---|
2899 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
2900 | | - } else |
---|
2901 | | - { |
---|
2902 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
2903 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 2900 | + centralPanel.remove(cameraView); |
---|
| 2901 | + cameraPanel.add(cameraView); |
---|
| 2902 | + centralPanel.add(cameraPanel); |
---|
| 2903 | + frame.setJMenuBar(timelineMenubar); |
---|
| 2904 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 2905 | + if (!CameraPane.FULLSCREEN) |
---|
| 2906 | + ToggleFullScreen(); |
---|
| 2907 | + toggleFullScreenItem.setEnabled(false); |
---|
2904 | 2908 | } |
---|
| 2909 | + else |
---|
| 2910 | + { |
---|
| 2911 | + centralPanel.remove(cameraPanel); |
---|
| 2912 | + centralPanel.add(cameraView); |
---|
| 2913 | + frame.setJMenuBar(null); |
---|
| 2914 | + if (!wasFullScreen) |
---|
| 2915 | + ToggleFullScreen(); |
---|
| 2916 | + toggleFullScreenItem.setEnabled(true); |
---|
| 2917 | + } |
---|
| 2918 | + |
---|
2905 | 2919 | frame.validate(); |
---|
2906 | | - cameraView.ToggleFullScreen(); |
---|
| 2920 | + return; |
---|
| 2921 | + } else if (event.getSource() == toggleFullScreenItem) |
---|
| 2922 | + { |
---|
| 2923 | + ToggleFullScreen(); |
---|
| 2924 | + frame.validate(); |
---|
2907 | 2925 | |
---|
2908 | 2926 | return; |
---|
2909 | 2927 | } else if (event.getSource() == toggleRandomItem) |
---|
.. | .. |
---|
3013 | 3031 | objEditor.refreshContents(); |
---|
3014 | 3032 | } else if (event.getSource() == stepItem) |
---|
3015 | 3033 | { |
---|
3016 | | - cameraView.ONESTEP = true; |
---|
| 3034 | + //cameraView.ONESTEP = true; |
---|
| 3035 | + Globals.ONESTEP = true; |
---|
3017 | 3036 | cameraView.repaint(); |
---|
3018 | 3037 | return; |
---|
3019 | 3038 | } else if (event.getSource() == stepButton) |
---|
.. | .. |
---|
3152 | 3171 | cameraView.RevertCamera(); |
---|
3153 | 3172 | cameraView.repaint(); |
---|
3154 | 3173 | return; |
---|
3155 | | - } else if (event.getSource() == textureButton) |
---|
3156 | | - { |
---|
3157 | | - return; // true; |
---|
| 3174 | +// } else if (event.getSource() == textureButton) |
---|
| 3175 | +// { |
---|
| 3176 | +// return; // true; |
---|
3158 | 3177 | } else // combos... |
---|
3159 | 3178 | if (event.getSource() == texresMenu) |
---|
3160 | 3179 | { |
---|
.. | .. |
---|
3170 | 3189 | |
---|
3171 | 3190 | void ToggleAnimation() |
---|
3172 | 3191 | { |
---|
3173 | | - if (!CameraPane.ANIMATION) |
---|
| 3192 | + if (!Globals.ANIMATION) |
---|
3174 | 3193 | { |
---|
3175 | 3194 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3176 | 3195 | browser.show(); |
---|
3177 | 3196 | String filename = browser.getFile(); |
---|
3178 | 3197 | if (filename != null && filename.length() > 0) |
---|
3179 | 3198 | { |
---|
3180 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3199 | + Globals.filename = browser.getDirectory() + filename; |
---|
3181 | 3200 | //CameraPane.framecount = 0; |
---|
3182 | | - CameraPane.imagecount = 0; |
---|
| 3201 | + Globals.imagecount = 0; |
---|
3183 | 3202 | |
---|
3184 | | - CameraPane.ANIMATION ^= true; |
---|
| 3203 | + Globals.ANIMATION ^= true; |
---|
3185 | 3204 | |
---|
3186 | 3205 | GrafreeD.wav.cursor = 0; |
---|
3187 | 3206 | GrafreeD.wav.loop = 0; |
---|
3188 | 3207 | } |
---|
3189 | 3208 | } else |
---|
3190 | 3209 | { |
---|
3191 | | - CameraPane.ANIMATION ^= true; |
---|
| 3210 | + Globals.ANIMATION ^= true; |
---|
3192 | 3211 | } |
---|
3193 | 3212 | } |
---|
3194 | 3213 | |
---|
.. | .. |
---|
3205 | 3224 | callee.refreshContents(); |
---|
3206 | 3225 | } else |
---|
3207 | 3226 | { |
---|
| 3227 | + new Exception().printStackTrace(); |
---|
3208 | 3228 | System.exit(0); |
---|
3209 | 3229 | } |
---|
3210 | 3230 | } |
---|
.. | .. |
---|
3367 | 3387 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3368 | 3388 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3369 | 3389 | |
---|
3370 | | - if (!NumberSlider.frozen) |
---|
| 3390 | + if (!cNumberSlider.frozen) |
---|
3371 | 3391 | { |
---|
3372 | 3392 | //System.out.println("Propagate = " + propagate); |
---|
3373 | 3393 | copy.UpdateMaterial(anchor, current, propagate); |
---|
.. | .. |
---|
3415 | 3435 | || e.getSource() == apertureField |
---|
3416 | 3436 | || e.getSource() == shadowblurField) |
---|
3417 | 3437 | { |
---|
| 3438 | + new Exception().printStackTrace(); |
---|
3418 | 3439 | System.exit(0); |
---|
3419 | 3440 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3420 | 3441 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3441 | 3462 | //System.out.println("PARENT = " + parent); |
---|
3442 | 3463 | //if (parent != null) |
---|
3443 | 3464 | // parent.applySelf(); |
---|
3444 | | - refreshContents(); |
---|
| 3465 | + if (e.getSource() == normalpushField) |
---|
| 3466 | + { |
---|
| 3467 | + objEditor.refreshContents(); |
---|
| 3468 | + //Refresh(); |
---|
| 3469 | + } |
---|
| 3470 | + else |
---|
| 3471 | + refreshContents(); |
---|
3445 | 3472 | // ??? client.refreshEditWindow(); |
---|
3446 | 3473 | } |
---|
3447 | 3474 | //else |
---|
.. | .. |
---|
3453 | 3480 | //group.name = nameField.getText(); |
---|
3454 | 3481 | //objEditor.applySelf(); |
---|
3455 | 3482 | |
---|
3456 | | - assert (objEditor == this); |
---|
| 3483 | + // OCT2018: assert (objEditor == this); |
---|
3457 | 3484 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3458 | 3485 | //super.applySelf() |
---|
3459 | 3486 | ; else |
---|
.. | .. |
---|
3477 | 3504 | objEditor.copy = keep; |
---|
3478 | 3505 | } |
---|
3479 | 3506 | } |
---|
| 3507 | + |
---|
| 3508 | + if (normalpushField != null) |
---|
| 3509 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
3480 | 3510 | } |
---|
3481 | 3511 | |
---|
3482 | 3512 | void SnapObject() |
---|
3483 | 3513 | { |
---|
3484 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3485 | | - SnapObject(obj); |
---|
| 3514 | + if (copy.selection.size() > 0) |
---|
| 3515 | + { |
---|
| 3516 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 3517 | + SnapObject(obj); |
---|
| 3518 | + } |
---|
3486 | 3519 | } |
---|
3487 | 3520 | |
---|
3488 | 3521 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
3596 | 3629 | |
---|
3597 | 3630 | if (obj.parent != null) |
---|
3598 | 3631 | { |
---|
3599 | | - obj.parent.TransformToWorld(interest); |
---|
| 3632 | +// obj.parent.TransformToWorld(interest); |
---|
3600 | 3633 | } |
---|
3601 | 3634 | |
---|
3602 | 3635 | if (!CameraPane.TRACK) |
---|
.. | .. |
---|
3728 | 3761 | |
---|
3729 | 3762 | radioPanel.revalidate(); |
---|
3730 | 3763 | radioPanel.repaint(); |
---|
3731 | | - ctrlPanel.revalidate(); // ? new |
---|
| 3764 | + ctrlPanel.validate(); // ? new |
---|
3732 | 3765 | ctrlPanel.repaint(); |
---|
3733 | 3766 | } |
---|
3734 | 3767 | } |
---|
.. | .. |
---|
4374 | 4407 | //MenuItem normalLensItem; |
---|
4375 | 4408 | MenuItem editCameraItem; |
---|
4376 | 4409 | MenuItem revertCameraItem; |
---|
4377 | | - CheckboxMenuItem toggleLiveItem; |
---|
4378 | 4410 | MenuItem stepItem; |
---|
4379 | | - CheckboxMenuItem toggleFullItem; |
---|
| 4411 | + CheckboxMenuItem toggleLiveItem; |
---|
| 4412 | + CheckboxMenuItem toggleFullScreenItem; |
---|
| 4413 | + CheckboxMenuItem toggleTimelineItem; |
---|
4380 | 4414 | CheckboxMenuItem toggleRenderItem; |
---|
4381 | 4415 | CheckboxMenuItem toggleDebugItem; |
---|
4382 | 4416 | CheckboxMenuItem toggleFrustumItem; |
---|
.. | .. |
---|
4394 | 4428 | JPanel treePanel; |
---|
4395 | 4429 | JPanel radioPanel; |
---|
4396 | 4430 | ButtonGroup buttonGroup; |
---|
4397 | | - JPanel ctrlPanel; |
---|
4398 | | - JPanel materialPanel; |
---|
| 4431 | + cGridBag ctrlPanel; |
---|
| 4432 | + cGridBag materialPanel; |
---|
4399 | 4433 | JScrollPane infoPanel; |
---|
4400 | | - JPanel optionsPanel; |
---|
| 4434 | + cGridBag optionsPanel; |
---|
4401 | 4435 | JTabbedPane objectPanel; |
---|
4402 | | - JPanel XYZPanel; |
---|
| 4436 | + cGridBag XYZPanel; |
---|
4403 | 4437 | JSplitPane gridPanel; |
---|
4404 | 4438 | JSplitPane bigPanel; |
---|
4405 | | - JPanel bigThree; |
---|
4406 | | - JTabbedPane jtp; |
---|
4407 | | - JPanel cameraPanel; |
---|
| 4439 | + cGridBag bigThree; |
---|
| 4440 | + cGridBag scenePanel; |
---|
| 4441 | + cGridBag centralPanel; |
---|
| 4442 | + JSplitPane cameraPanel; |
---|
| 4443 | + JPanel timelinePanel; |
---|
| 4444 | + JMenuBar timelineMenubar; |
---|
4408 | 4445 | JSplitPane framePanel; |
---|
4409 | 4446 | JTextArea/*Field*/ nameField; |
---|
4410 | | - cButton textureButton; |
---|
| 4447 | + //cButton textureButton; |
---|
4411 | 4448 | cButton okButton; |
---|
4412 | 4449 | cButton applyButton; |
---|
4413 | 4450 | cButton cancelButton; |
---|
.. | .. |
---|
4454 | 4491 | // MATERIAL |
---|
4455 | 4492 | JLabel materialLabel; |
---|
4456 | 4493 | JLabel colorLabel; |
---|
4457 | | - NumberSlider colorField; |
---|
| 4494 | + cNumberSlider colorField; |
---|
4458 | 4495 | JLabel modulationLabel; |
---|
4459 | | - NumberSlider modulationField; |
---|
| 4496 | + cNumberSlider modulationField; |
---|
4460 | 4497 | JLabel metalnessLabel; |
---|
4461 | | - NumberSlider metalnessField; |
---|
| 4498 | + cNumberSlider metalnessField; |
---|
4462 | 4499 | JLabel diffuseLabel; |
---|
4463 | | - NumberSlider diffuseField; |
---|
| 4500 | + cNumberSlider diffuseField; |
---|
4464 | 4501 | JLabel specularLabel; |
---|
4465 | | - NumberSlider specularField; |
---|
| 4502 | + cNumberSlider specularField; |
---|
4466 | 4503 | JLabel shininessLabel; |
---|
4467 | | - NumberSlider shininessField; |
---|
| 4504 | + cNumberSlider shininessField; |
---|
4468 | 4505 | JLabel shiftLabel; |
---|
4469 | | - NumberSlider shiftField; |
---|
| 4506 | + cNumberSlider shiftField; |
---|
4470 | 4507 | JLabel ambientLabel; |
---|
4471 | | - NumberSlider ambientField; |
---|
| 4508 | + cNumberSlider ambientField; |
---|
4472 | 4509 | JLabel lightareaLabel; |
---|
4473 | | - NumberSlider lightareaField; |
---|
| 4510 | + cNumberSlider lightareaField; |
---|
4474 | 4511 | JLabel diffusenessLabel; |
---|
4475 | | - NumberSlider diffusenessField; |
---|
| 4512 | + cNumberSlider diffusenessField; |
---|
4476 | 4513 | JLabel velvetLabel; |
---|
4477 | | - NumberSlider velvetField; |
---|
| 4514 | + cNumberSlider velvetField; |
---|
4478 | 4515 | JLabel sheenLabel; |
---|
4479 | | - NumberSlider sheenField; |
---|
| 4516 | + cNumberSlider sheenField; |
---|
4480 | 4517 | JLabel subsurfaceLabel; |
---|
4481 | | - NumberSlider subsurfaceField; |
---|
| 4518 | + cNumberSlider subsurfaceField; |
---|
4482 | 4519 | //JLabel bumpLabel; |
---|
4483 | 4520 | //NumberSlider bumpField; |
---|
4484 | 4521 | JLabel backlitLabel; |
---|
4485 | | - NumberSlider backlitField; |
---|
| 4522 | + cNumberSlider backlitField; |
---|
4486 | 4523 | JLabel anisoLabel; |
---|
4487 | | - NumberSlider anisoField; |
---|
| 4524 | + cNumberSlider anisoField; |
---|
4488 | 4525 | JLabel anisoVLabel; |
---|
4489 | | - NumberSlider anisoVField; |
---|
| 4526 | + cNumberSlider anisoVField; |
---|
4490 | 4527 | JLabel cameraLabel; |
---|
4491 | | - NumberSlider cameraField; |
---|
| 4528 | + cNumberSlider cameraField; |
---|
4492 | 4529 | JLabel selfshadowLabel; |
---|
4493 | | - NumberSlider selfshadowField; |
---|
| 4530 | + cNumberSlider selfshadowField; |
---|
4494 | 4531 | JLabel shadowLabel; |
---|
4495 | | - NumberSlider shadowField; |
---|
| 4532 | + cNumberSlider shadowField; |
---|
4496 | 4533 | JLabel textureLabel; |
---|
4497 | | - NumberSlider textureField; |
---|
| 4534 | + cNumberSlider textureField; |
---|
4498 | 4535 | JLabel opacityLabel; |
---|
4499 | | - NumberSlider opacityField; |
---|
| 4536 | + cNumberSlider opacityField; |
---|
4500 | 4537 | JLabel fakedepthLabel; |
---|
4501 | | - NumberSlider fakedepthField; |
---|
| 4538 | + cNumberSlider fakedepthField; |
---|
4502 | 4539 | JLabel shadowbiasLabel; |
---|
4503 | | - NumberSlider shadowbiasField; |
---|
| 4540 | + cNumberSlider shadowbiasField; |
---|
4504 | 4541 | JLabel bumpLabel; |
---|
4505 | | - NumberSlider bumpField; |
---|
| 4542 | + cNumberSlider bumpField; |
---|
4506 | 4543 | JLabel noiseLabel; |
---|
4507 | | - NumberSlider noiseField; |
---|
| 4544 | + cNumberSlider noiseField; |
---|
4508 | 4545 | JLabel powerLabel; |
---|
4509 | | - NumberSlider powerField; |
---|
| 4546 | + cNumberSlider powerField; |
---|
4510 | 4547 | JLabel borderfadeLabel; |
---|
4511 | | - NumberSlider borderfadeField; |
---|
| 4548 | + cNumberSlider borderfadeField; |
---|
4512 | 4549 | JLabel fogLabel; |
---|
4513 | | - NumberSlider fogField; |
---|
| 4550 | + cNumberSlider fogField; |
---|
4514 | 4551 | JLabel opacityPowerLabel; |
---|
4515 | | - NumberSlider opacityPowerField; |
---|
| 4552 | + cNumberSlider opacityPowerField; |
---|
4516 | 4553 | JTree jTree; |
---|
4517 | 4554 | //ObjectUI parent; |
---|
| 4555 | + |
---|
| 4556 | + cNumberSlider normalpushField; |
---|
4518 | 4557 | } |
---|