.. | .. |
---|
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, |
---|
.. | .. |
---|
136 | 138 | public void closeUI() |
---|
137 | 139 | { |
---|
138 | 140 | //new Exception().printStackTrace(); |
---|
139 | | - System.out.println("this = " + this); |
---|
140 | | - System.out.println("objEditor = " + objEditor); |
---|
| 141 | +// System.out.println("this = " + this); |
---|
| 142 | +// System.out.println("objEditor = " + objEditor); |
---|
141 | 143 | //nameField.removeActionListener(this); |
---|
142 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 144 | +// objEditor.ctrlPanel.remove(nameField); |
---|
143 | 145 | |
---|
144 | 146 | if (!GroupEditor.allparams) |
---|
145 | 147 | return; |
---|
146 | 148 | |
---|
147 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
148 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
149 | | - objEditor.ctrlPanel.remove(markCB); |
---|
150 | | - |
---|
151 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
152 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
153 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
154 | | - |
---|
155 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
156 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
157 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
158 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
159 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
160 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
161 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
162 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
163 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
164 | | - 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); |
---|
165 | 167 | |
---|
166 | | - Remove(normalpushField); |
---|
| 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); |
---|
167 | 175 | } |
---|
168 | 176 | |
---|
169 | 177 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
351 | 359 | objectPanel = new JTabbedPane(); |
---|
352 | 360 | toolbarPanel = new JPanel(); |
---|
353 | 361 | toolbarPanel.setName("Toolbar"); |
---|
354 | | - treePanel = new JPanel(); |
---|
| 362 | + treePanel = new cGridBag(); |
---|
355 | 363 | treePanel.setName("Tree"); |
---|
356 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
| 364 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
357 | 365 | ctrlPanel.setName("Edit"); |
---|
358 | | - materialPanel = new JPanel(); |
---|
| 366 | + materialPanel = new cGridBag().setVertical(true); |
---|
359 | 367 | materialPanel.setName("Material"); |
---|
360 | 368 | /*JTextPane*/ |
---|
361 | 369 | infoarea = createTextPane(); |
---|
| 370 | + doc = infoarea.getStyledDocument(); |
---|
| 371 | + |
---|
362 | 372 | infoarea.setEditable(true); |
---|
363 | 373 | SetText(); |
---|
364 | 374 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
365 | 375 | // infoarea.setOpaque(false); |
---|
366 | 376 | // //infoarea.setForeground(textcolor); |
---|
367 | | - infoarea.setLineWrap(true); |
---|
368 | | - infoarea.setWrapStyleWord(true); |
---|
| 377 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 378 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
369 | 379 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
370 | 380 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
371 | 381 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
376 | 386 | mainPanel.setName("Main"); |
---|
377 | 387 | mainPanel.setContinuousLayout(true); |
---|
378 | 388 | mainPanel.setOneTouchExpandable(true); |
---|
379 | | - mainPanel.setDividerLocation(1.0); |
---|
380 | 389 | mainPanel.setDividerSize(9); |
---|
381 | | - mainPanel.setResizeWeight(0); |
---|
| 390 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 391 | + mainPanel.setResizeWeight(0.5); |
---|
382 | 392 | |
---|
383 | 393 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
384 | 394 | //mainPanel.setLayout(new GridBagLayout()); |
---|
385 | 395 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
386 | | - treePanel.setLayout(new GridBagLayout()); |
---|
387 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
388 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 396 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 397 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 398 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
389 | 399 | |
---|
390 | 400 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
391 | 401 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
424 | 434 | static String newline = "\n"; |
---|
425 | 435 | protected static final String buttonString = "JButton"; |
---|
426 | 436 | StyledDocument doc; |
---|
427 | | - JTextArea infoarea; |
---|
| 437 | + JTextPane infoarea; |
---|
428 | 438 | |
---|
429 | 439 | void ClearInfo() |
---|
430 | 440 | { |
---|
.. | .. |
---|
491 | 501 | } |
---|
492 | 502 | |
---|
493 | 503 | if (full) |
---|
494 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 504 | + { |
---|
| 505 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 506 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 507 | + } |
---|
495 | 508 | |
---|
496 | 509 | if (sel.bRep != null) |
---|
497 | 510 | { |
---|
.. | .. |
---|
589 | 602 | { |
---|
590 | 603 | CameraPane.pointflow = (PointFlow) sel; |
---|
591 | 604 | } |
---|
| 605 | + |
---|
| 606 | + si.SendInfo("_____________________", "regular"); |
---|
| 607 | + si.SendInfo("", "regular"); |
---|
592 | 608 | } |
---|
593 | 609 | } |
---|
594 | 610 | |
---|
.. | .. |
---|
620 | 636 | cameraView.ToggleFullScreen(); |
---|
621 | 637 | } |
---|
622 | 638 | |
---|
623 | | - private JTextArea createTextPane() |
---|
| 639 | + private JTextPane createTextPane() |
---|
624 | 640 | { |
---|
625 | | - String[] initString = |
---|
626 | | - { |
---|
627 | | - "This is an editable JTextPane, ", //regular |
---|
628 | | - "another ", //italic |
---|
629 | | - "styled ", //bold |
---|
630 | | - "text ", //small |
---|
631 | | - "component, ", //large |
---|
632 | | - "which supports embedded components..." + newline,//regular |
---|
633 | | - " " + newline, //button |
---|
634 | | - "...and embedded icons..." + newline, //regular |
---|
635 | | - " ", //icon |
---|
636 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
637 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
638 | | - + "cover methods for interacting with those objects." |
---|
639 | | - }; |
---|
| 641 | +// TEXTAREA String[] initString = |
---|
| 642 | +// { |
---|
| 643 | +// "This is an editable JTextPane, ", //regular |
---|
| 644 | +// "another ", //italic |
---|
| 645 | +// "styled ", //bold |
---|
| 646 | +// "text ", //small |
---|
| 647 | +// "component, ", //large |
---|
| 648 | +// "which supports embedded components..." + newline,//regular |
---|
| 649 | +// " " + newline, //button |
---|
| 650 | +// "...and embedded icons..." + newline, //regular |
---|
| 651 | +// " ", //icon |
---|
| 652 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 653 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 654 | +// + "cover methods for interacting with those objects." |
---|
| 655 | +// }; |
---|
| 656 | +// |
---|
| 657 | +// String[] initStyles = |
---|
| 658 | +// { |
---|
| 659 | +// "regular", "italic", "bold", "small", "large", |
---|
| 660 | +// "regular", "button", "regular", "icon", |
---|
| 661 | +// "regular" |
---|
| 662 | +// }; |
---|
| 663 | +// |
---|
| 664 | +// JTextPane textPane = new JTextPane(); |
---|
| 665 | +// textPane.setEditable(true); |
---|
| 666 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 667 | +// addStylesToDocument(doc); |
---|
| 668 | +// |
---|
| 669 | +// try |
---|
| 670 | +// { |
---|
| 671 | +// for (int j = 0; j < 2; j++) |
---|
| 672 | +// { |
---|
| 673 | +// for (int i = 0; i < initString.length; i++) |
---|
| 674 | +// { |
---|
| 675 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 676 | +// doc.getStyle(initStyles[i])); |
---|
| 677 | +// } |
---|
| 678 | +// } |
---|
| 679 | +// } catch (BadLocationException ble) |
---|
| 680 | +// { |
---|
| 681 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 682 | +// } |
---|
640 | 683 | |
---|
641 | | - String[] initStyles = |
---|
642 | | - { |
---|
643 | | - "regular", "italic", "bold", "small", "large", |
---|
644 | | - "regular", "button", "regular", "icon", |
---|
645 | | - "regular" |
---|
646 | | - }; |
---|
647 | | - |
---|
648 | | - JTextPane textPane = new JTextPane(); |
---|
649 | | - textPane.setEditable(true); |
---|
650 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
651 | | - addStylesToDocument(doc); |
---|
652 | | - |
---|
653 | | - try |
---|
654 | | - { |
---|
655 | | - for (int j = 0; j < 2; j++) |
---|
656 | | - { |
---|
657 | | - for (int i = 0; i < initString.length; i++) |
---|
658 | | - { |
---|
659 | | - doc.insertString(doc.getLength(), initString[i], |
---|
660 | | - doc.getStyle(initStyles[i])); |
---|
661 | | - } |
---|
662 | | - } |
---|
663 | | - } catch (BadLocationException ble) |
---|
664 | | - { |
---|
665 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
666 | | - } |
---|
667 | | - |
---|
668 | | - return new JTextArea(); // textPane; |
---|
| 684 | + return new JTextPane(); // textPane; |
---|
669 | 685 | } |
---|
670 | 686 | |
---|
671 | 687 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
765 | 781 | JButton slowerButton; |
---|
766 | 782 | JButton fasterButton; |
---|
767 | 783 | JButton remarkButton; |
---|
| 784 | + |
---|
| 785 | + cGridBag namePanel; |
---|
| 786 | + cGridBag setupPanel; |
---|
| 787 | + cGridBag commandsPanel; |
---|
| 788 | + cGridBag pushPanel; |
---|
| 789 | + cGridBag fillPanel; |
---|
768 | 790 | |
---|
769 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 791 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
770 | 792 | { |
---|
771 | 793 | JCheckBox cb; |
---|
772 | 794 | |
---|
773 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
774 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
775 | | -// oe.aConstraints.weightx = 1; |
---|
776 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
777 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 795 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
778 | 796 | cb.addItemListener(this); |
---|
779 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
780 | | - oe.aConstraints.gridwidth = 1; |
---|
781 | | - oe.aConstraints.gridx += 1; |
---|
782 | 797 | |
---|
783 | 798 | return cb; |
---|
784 | 799 | } |
---|
785 | 800 | |
---|
786 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 801 | + cButton AddButton(cGridBag panel, String label) |
---|
787 | 802 | { |
---|
788 | 803 | cButton cb; |
---|
789 | 804 | |
---|
790 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
791 | | - oe.aConstraints.gridwidth = 1; |
---|
792 | | -// oe.aConstraints.weightx = 1; |
---|
793 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
794 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 805 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
795 | 806 | cb.addActionListener(this); |
---|
796 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
797 | | - oe.aConstraints.gridwidth = 1; |
---|
798 | | - oe.aConstraints.gridx += 1; |
---|
799 | 807 | |
---|
800 | 808 | return cb; |
---|
801 | 809 | } |
---|
802 | 810 | |
---|
803 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 811 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
804 | 812 | { |
---|
805 | 813 | JComboBox combo; |
---|
806 | 814 | |
---|
807 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
808 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
809 | | - oe.aConstraints.gridx += 1; |
---|
| 815 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
810 | 816 | combo.addActionListener(this); |
---|
811 | 817 | |
---|
812 | 818 | return combo; |
---|
813 | 819 | } |
---|
814 | 820 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 821 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
816 | 822 | { |
---|
817 | | - NumberSlider combo; |
---|
| 823 | + cGridBag control = new cGridBag(); |
---|
| 824 | + |
---|
| 825 | + cNumberSlider combo; |
---|
818 | 826 | |
---|
819 | 827 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 828 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
823 | | - aConstraints.gridwidth = 1; |
---|
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, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
829 | | - aConstraints.gridx += 1; |
---|
830 | | - aConstraints.gridwidth = 1; |
---|
831 | | - |
---|
| 829 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 830 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 831 | combo.setFloat(current); |
---|
833 | | - |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 832 | + |
---|
| 833 | + panel.add(control); |
---|
| 834 | + |
---|
| 835 | + return control; |
---|
839 | 836 | } |
---|
840 | 837 | |
---|
841 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 838 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
842 | 839 | { |
---|
843 | | - NumberSlider combo; |
---|
| 840 | + cGridBag control = new cGridBag(); |
---|
| 841 | + |
---|
| 842 | + cNumberSlider combo; |
---|
844 | 843 | |
---|
845 | 844 | JLabel jlabel = new JLabel(label); |
---|
846 | | - |
---|
847 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
848 | 845 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
849 | | - aConstraints.gridwidth = 2; |
---|
850 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
851 | | - aConstraints.gridx += 1; |
---|
852 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
853 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
854 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
855 | | - aConstraints.gridx += 1; |
---|
856 | | - aConstraints.gridwidth = 1; |
---|
857 | | - |
---|
| 846 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 847 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
858 | 848 | combo.setInteger(current); |
---|
859 | 849 | |
---|
860 | | - combo.label = jlabel; |
---|
861 | | - |
---|
862 | | - combo.addChangeListener(this); |
---|
863 | | - |
---|
864 | | - return combo; |
---|
| 850 | + panel.add(control); |
---|
| 851 | + |
---|
| 852 | + return control; |
---|
865 | 853 | } |
---|
866 | 854 | |
---|
867 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 855 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
868 | 856 | { |
---|
869 | 857 | JTextArea text; |
---|
870 | 858 | |
---|
871 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
872 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
873 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 859 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
874 | 860 | text.addCaretListener(this); |
---|
875 | | - aConstraints.gridx += 1; |
---|
876 | | - aConstraints.gridwidth = 1; |
---|
877 | 861 | |
---|
878 | 862 | return text; |
---|
879 | 863 | } |
---|
.. | .. |
---|
903 | 887 | objEditor.ctrlPanel.remove(j); |
---|
904 | 888 | } |
---|
905 | 889 | |
---|
| 890 | + void Remove(cNumberSlider j) |
---|
| 891 | + { |
---|
| 892 | + j.removeChangeListener(this); |
---|
| 893 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 894 | + objEditor.ctrlPanel.remove(j); |
---|
| 895 | + } |
---|
| 896 | + |
---|
906 | 897 | /* |
---|
907 | 898 | */ |
---|
908 | | - void Return() // ObjEditor oe) |
---|
| 899 | + void Return0() // ObjEditor oe) |
---|
909 | 900 | { |
---|
910 | 901 | aConstraints.gridy += 1; |
---|
911 | 902 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
960 | 951 | |
---|
961 | 952 | void SetupUI2(ObjEditor oe) |
---|
962 | 953 | { |
---|
963 | | -// oe.aConstraints.weightx = 0; |
---|
964 | | -// oe.aConstraints.weighty = 0; |
---|
965 | | -// oe.aConstraints.gridx = 0; |
---|
966 | | -// oe.aConstraints.gridy = 0; |
---|
967 | | - SetupName(oe); |
---|
| 954 | + //SetupName(oe); |
---|
| 955 | + |
---|
| 956 | + namePanel = new cGridBag(); |
---|
| 957 | + |
---|
| 958 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 959 | + namePanel.add(nameField); |
---|
| 960 | + oe.ctrlPanel.add(namePanel); |
---|
| 961 | + |
---|
| 962 | + oe.ctrlPanel.Return(); |
---|
968 | 963 | |
---|
969 | 964 | if (!GroupEditor.allparams) |
---|
970 | 965 | return; |
---|
971 | 966 | |
---|
972 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
973 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
974 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 967 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 968 | + |
---|
| 969 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 970 | + if (Globals.ADVANCED) |
---|
| 971 | + link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master); |
---|
| 972 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
975 | 973 | // Return(); |
---|
976 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
977 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
978 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
979 | | - Return(); |
---|
980 | | - resetButton = AddButton(oe, "Reset"); |
---|
981 | | - stepButton = AddButton(oe, "Step"); |
---|
| 974 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 975 | + rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind); |
---|
| 976 | + randomCB = AddCheckBox(setupPanel, "Rand", copy.random); |
---|
| 977 | + |
---|
| 978 | + oe.ctrlPanel.add(setupPanel); |
---|
| 979 | + oe.ctrlPanel.Return(); |
---|
| 980 | + |
---|
| 981 | + commandsPanel = new cGridBag().setVertical(false); |
---|
| 982 | + |
---|
| 983 | + resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 984 | + stepButton = AddButton(commandsPanel, "Step"); |
---|
982 | 985 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
983 | 986 | // stepAllButton = AddButton(oe, "Step All"); |
---|
984 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
| 987 | + speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup); |
---|
985 | 988 | // Return(); |
---|
986 | | - slowerButton = AddButton(oe, "Slow"); |
---|
987 | | - fasterButton = AddButton(oe, "Fast"); |
---|
988 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 989 | + slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 990 | + fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 991 | + remarkButton = AddButton(commandsPanel, "Remark"); |
---|
989 | 992 | |
---|
990 | | - Return(); |
---|
| 993 | + oe.ctrlPanel.add(commandsPanel); |
---|
| 994 | + oe.ctrlPanel.Return(); |
---|
991 | 995 | |
---|
992 | | - normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
993 | | - Return(); |
---|
| 996 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1); |
---|
| 997 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 998 | + //Return(); |
---|
| 999 | + |
---|
| 1000 | + oe.ctrlPanel.Return(); |
---|
994 | 1001 | |
---|
995 | 1002 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
996 | 1003 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1085 | 1092 | oe.aConstraints.gridwidth = 1; |
---|
1086 | 1093 | /**/ |
---|
1087 | 1094 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1088 | | - Return(); |
---|
| 1095 | + oe.ctrlPanel.Return(); |
---|
1089 | 1096 | |
---|
1090 | 1097 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1091 | 1098 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1187 | 1194 | //JPanel worldPanel = |
---|
1188 | 1195 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1189 | 1196 | //worldPanel.setName("World"); |
---|
1190 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
| 1197 | + centralPanel = new cGridBag(); |
---|
| 1198 | + centralPanel.preferredWidth = 20; |
---|
1191 | 1199 | timelinePanel = new JPanel(new BorderLayout()); |
---|
1192 | 1200 | timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1193 | 1201 | |
---|
.. | .. |
---|
1217 | 1225 | //frontView.object = copy; |
---|
1218 | 1226 | //sideView.object = copy; |
---|
1219 | 1227 | |
---|
1220 | | - XYZPanel = new JPanel(); |
---|
1221 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1228 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1229 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1222 | 1230 | |
---|
1223 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1224 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1225 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1231 | + XYZPanel.preferredWidth = 5; |
---|
| 1232 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1233 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1234 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1226 | 1235 | |
---|
1227 | 1236 | /* |
---|
1228 | 1237 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1260 | 1269 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1261 | 1270 | //tmp.setName("Edit"); |
---|
1262 | 1271 | objectPanel.add(materialPanel); |
---|
1263 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1264 | | - north.setName("Edit"); |
---|
1265 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1266 | | - objectPanel.add(north); |
---|
| 1272 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1273 | +// north.setName("Edit"); |
---|
| 1274 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1275 | +// objectPanel.add(north); |
---|
| 1276 | + objectPanel.add(ctrlPanel); |
---|
1267 | 1277 | objectPanel.add(infoPanel); |
---|
1268 | 1278 | |
---|
1269 | 1279 | /* |
---|
.. | .. |
---|
1284 | 1294 | scrollpane.setWheelScrollingEnabled(true); |
---|
1285 | 1295 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1286 | 1296 | |
---|
1287 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1288 | | - scenePanel.add(scrollpane); |
---|
| 1297 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1298 | + scenePanel.preferredWidth = 7; |
---|
| 1299 | + |
---|
| 1300 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1301 | + tabbedPane.add(scrollpane); |
---|
1289 | 1302 | |
---|
1290 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
| 1303 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1291 | 1304 | |
---|
1292 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1305 | + optionsPanel = new cGridBag().setVertical(true); |
---|
1293 | 1306 | |
---|
1294 | 1307 | optionsPanel.setName("Options"); |
---|
1295 | | - scenePanel.add(optionsPanel); |
---|
1296 | | - |
---|
| 1308 | + |
---|
| 1309 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1310 | + |
---|
| 1311 | + tabbedPane.add(optionsPanel); |
---|
| 1312 | + |
---|
| 1313 | + scenePanel.add(tabbedPane); |
---|
1297 | 1314 | |
---|
1298 | 1315 | /* |
---|
1299 | 1316 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1327 | 1344 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1328 | 1345 | //bigPanel.add(ctrlPanel); |
---|
1329 | 1346 | //bigPanel.add(gridPanel); |
---|
| 1347 | + /** |
---|
1330 | 1348 | bigThree = new JPanel(); |
---|
1331 | 1349 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1332 | 1350 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1350 | 1368 | // aConstraints.gridheight = 3; |
---|
1351 | 1369 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1352 | 1370 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1371 | + /**/ |
---|
1353 | 1372 | |
---|
| 1373 | + bigThree = new cGridBag(); |
---|
| 1374 | + bigThree.addComponent(scenePanel); |
---|
| 1375 | + bigThree.addComponent(centralPanel); |
---|
| 1376 | + bigThree.addComponent(XYZPanel); |
---|
| 1377 | + |
---|
1354 | 1378 | // // SIDE EFFECT!!! |
---|
1355 | 1379 | // aConstraints.gridx = 0; |
---|
1356 | 1380 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1393 | 1417 | }); |
---|
1394 | 1418 | } |
---|
1395 | 1419 | |
---|
| 1420 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1421 | + { |
---|
| 1422 | + } |
---|
| 1423 | + |
---|
1396 | 1424 | JTree GetTree() |
---|
1397 | 1425 | { |
---|
1398 | 1426 | return objEditor.jTree; |
---|
.. | .. |
---|
1404 | 1432 | ctrlPanel.removeAll(); |
---|
1405 | 1433 | } |
---|
1406 | 1434 | |
---|
1407 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1435 | + void SetupMaterial(cGridBag panel) |
---|
1408 | 1436 | { |
---|
1409 | | - aConstraints.weighty = 0; |
---|
1410 | | - //aConstraints.weightx = 1; |
---|
1411 | | - /* |
---|
| 1437 | + /* |
---|
1412 | 1438 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1413 | 1439 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1414 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1415 | | - aConstraints.gridx += 1; |
---|
1416 | 1440 | */ |
---|
1417 | 1441 | |
---|
1418 | | - aConstraints.gridwidth = 1; |
---|
1419 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1420 | | - aConstraints.gridx += 1; |
---|
1421 | | - aConstraints.weighty = 0; |
---|
1422 | | - aConstraints.gridwidth = 1; |
---|
| 1442 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 1443 | + |
---|
| 1444 | + editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1445 | + createMaterialButton.setToolTipText("Create material"); |
---|
1423 | 1446 | |
---|
1424 | 1447 | /* |
---|
1425 | 1448 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1426 | | - aConstraints.gridx += 1; |
---|
1427 | | - aConstraints.weighty = 0; |
---|
1428 | | - aConstraints.gridwidth = 1; |
---|
1429 | 1449 | */ |
---|
1430 | 1450 | |
---|
1431 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1432 | | - aConstraints.gridx += 1; |
---|
| 1451 | + editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1452 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1453 | + |
---|
| 1454 | + editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1455 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1456 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
1433 | 1457 | |
---|
1434 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1435 | | - |
---|
1436 | | - aConstraints.gridx += 1; |
---|
1437 | | - |
---|
1438 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1439 | | - |
---|
1440 | | - aConstraints.gridx += 1; |
---|
1441 | | - |
---|
1442 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1443 | | - |
---|
1444 | | - aConstraints.gridx = 0; |
---|
1445 | | - aConstraints.gridy += 1; |
---|
1446 | | - aConstraints.weighty = 0; |
---|
1447 | | - aConstraints.gridwidth = 1; |
---|
| 1458 | + editBar.preferredHeight = 15; |
---|
| 1459 | + |
---|
| 1460 | + panel.add(editBar); |
---|
| 1461 | + |
---|
1448 | 1462 | /**/ |
---|
1449 | 1463 | //aConstraints.weighty = 0; |
---|
1450 | 1464 | ////aConstraints.weightx = 1; |
---|
1451 | 1465 | //aConstraints.weighty = 1; |
---|
1452 | 1466 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1453 | 1467 | //aConstraints.gridx += 1; |
---|
1454 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1455 | | - aConstraints.weighty = 0; |
---|
1456 | | - aConstraints.gridx = 0; |
---|
1457 | | - aConstraints.gridy += 1; |
---|
1458 | | - aConstraints.gridwidth = 1; |
---|
| 1468 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1459 | 1469 | |
---|
1460 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1461 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1462 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1463 | | - aConstraints.gridx += 1; |
---|
1464 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1465 | | - //aConstraints.weightx = 0; |
---|
1466 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1467 | | - aConstraints.gridx = 0; |
---|
1468 | | - aConstraints.gridy += 1; |
---|
1469 | | - aConstraints.gridwidth = 1; |
---|
| 1470 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1471 | + |
---|
| 1472 | + cGridBag color = new cGridBag(); |
---|
| 1473 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1474 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1475 | + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1476 | + //colorField.preferredWidth = 200; |
---|
| 1477 | + colorSection.add(color); |
---|
1470 | 1478 | |
---|
1471 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1472 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1473 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1474 | | - aConstraints.gridx += 1; |
---|
1475 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1476 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1477 | | - aConstraints.gridx = 0; |
---|
1478 | | - aConstraints.gridy += 1; |
---|
1479 | | - aConstraints.gridwidth = 1; |
---|
| 1479 | + cGridBag modulation = new cGridBag(); |
---|
| 1480 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 1481 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1482 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1483 | + colorSection.add(modulation); |
---|
1480 | 1484 | |
---|
1481 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1482 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1483 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1484 | | - aConstraints.gridx += 1; |
---|
1485 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1486 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1487 | | - aConstraints.gridx = 0; |
---|
1488 | | - aConstraints.gridy += 1; |
---|
1489 | | - aConstraints.gridwidth = 1; |
---|
| 1485 | + cGridBag texture = new cGridBag(); |
---|
| 1486 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 1487 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1488 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1489 | + colorSection.add(texture); |
---|
1490 | 1490 | |
---|
1491 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1492 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1493 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1494 | | - aConstraints.gridx += 1; |
---|
1495 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1496 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1497 | | - aConstraints.gridx = 0; |
---|
1498 | | - aConstraints.gridy += 1; |
---|
1499 | | - aConstraints.gridwidth = 1; |
---|
| 1491 | + cGridBag anisoU = new cGridBag(); |
---|
| 1492 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1493 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1494 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1495 | + colorSection.add(anisoU); |
---|
1500 | 1496 | |
---|
1501 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1502 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1503 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1504 | | - aConstraints.gridx += 1; |
---|
1505 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1506 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1507 | | - aConstraints.gridx = 0; |
---|
1508 | | - aConstraints.gridy += 1; |
---|
1509 | | - aConstraints.gridwidth = 1; |
---|
| 1497 | + cGridBag anisoV = new cGridBag(); |
---|
| 1498 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1499 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1500 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1501 | + colorSection.add(anisoV); |
---|
1510 | 1502 | |
---|
1511 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1512 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1513 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1514 | | - aConstraints.gridx += 1; |
---|
1515 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1516 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1517 | | - aConstraints.gridx = 0; |
---|
1518 | | - aConstraints.gridy += 1; |
---|
1519 | | - aConstraints.gridwidth = 1; |
---|
| 1503 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1504 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1505 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1506 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1507 | + colorSection.add(shadowbias); |
---|
1520 | 1508 | |
---|
1521 | | - //aConstraints.weighty = 1; |
---|
1522 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1523 | | - //aConstraints.gridx += 1; |
---|
1524 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1525 | | - aConstraints.weighty = 0; |
---|
1526 | | - aConstraints.gridx = 0; |
---|
1527 | | - aConstraints.gridy += 1; |
---|
1528 | | - aConstraints.gridwidth = 1; |
---|
| 1509 | + panel.add(new JSeparator()); |
---|
| 1510 | + |
---|
| 1511 | + panel.add(colorSection); |
---|
| 1512 | + |
---|
| 1513 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1514 | + |
---|
| 1515 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 1516 | + |
---|
| 1517 | + cGridBag diffuse = new cGridBag(); |
---|
| 1518 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 1519 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1520 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1521 | + diffuseSection.add(diffuse); |
---|
1529 | 1522 | |
---|
1530 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1531 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1532 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1533 | | - aConstraints.gridx += 1; |
---|
1534 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1535 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1536 | | - aConstraints.gridx = 0; |
---|
1537 | | - aConstraints.gridy += 1; |
---|
1538 | | - aConstraints.gridwidth = 1; |
---|
| 1523 | + cGridBag diffuseness = new cGridBag(); |
---|
| 1524 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 1525 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1526 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1527 | + diffuseSection.add(diffuseness); |
---|
1539 | 1528 | |
---|
1540 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1541 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1542 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1543 | | - aConstraints.gridx += 1; |
---|
1544 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1545 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1546 | | - aConstraints.gridx = 0; |
---|
1547 | | - aConstraints.gridy += 1; |
---|
1548 | | - aConstraints.gridwidth = 1; |
---|
| 1529 | + cGridBag selfshadow = new cGridBag(); |
---|
| 1530 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 1531 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1532 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1533 | + diffuseSection.add(selfshadow); |
---|
1549 | 1534 | |
---|
1550 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1551 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1552 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1553 | | - aConstraints.gridx += 1; |
---|
1554 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1555 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1556 | | - aConstraints.gridx = 0; |
---|
1557 | | - aConstraints.gridy += 1; |
---|
1558 | | - aConstraints.gridwidth = 1; |
---|
| 1535 | + cGridBag sheen = new cGridBag(); |
---|
| 1536 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 1537 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1538 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1539 | + diffuseSection.add(sheen); |
---|
1559 | 1540 | |
---|
1560 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1561 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1562 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1563 | | - aConstraints.gridx += 1; |
---|
1564 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1565 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1566 | | - aConstraints.gridx = 0; |
---|
1567 | | - aConstraints.gridy += 1; |
---|
1568 | | - aConstraints.gridwidth = 1; |
---|
| 1541 | + cGridBag subsurface = new cGridBag(); |
---|
| 1542 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 1543 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1544 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1545 | + diffuseSection.add(subsurface); |
---|
1569 | 1546 | |
---|
1570 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1571 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1572 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1573 | | - aConstraints.gridx += 1; |
---|
1574 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1575 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1576 | | - aConstraints.gridx = 0; |
---|
1577 | | - aConstraints.gridy += 1; |
---|
1578 | | - aConstraints.gridwidth = 1; |
---|
| 1547 | + cGridBag shadow = new cGridBag(); |
---|
| 1548 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 1549 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1550 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1551 | + diffuseSection.add(shadow); |
---|
1579 | 1552 | |
---|
1580 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1581 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1582 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1583 | | - aConstraints.gridx += 1; |
---|
1584 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1585 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1586 | | - aConstraints.gridx = 0; |
---|
1587 | | - aConstraints.gridy += 1; |
---|
1588 | | - aConstraints.gridwidth = 1; |
---|
| 1553 | + cGridBag fakedepth = new cGridBag(); |
---|
| 1554 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 1555 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1556 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1557 | + diffuseSection.add(fakedepth); |
---|
1589 | 1558 | |
---|
1590 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1591 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1592 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1593 | | - aConstraints.gridx += 1; |
---|
1594 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1595 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1596 | | - aConstraints.gridx = 0; |
---|
1597 | | - aConstraints.gridy += 1; |
---|
1598 | | - aConstraints.gridwidth = 1; |
---|
| 1559 | + panel.add(new JSeparator()); |
---|
| 1560 | + |
---|
| 1561 | + panel.add(diffuseSection); |
---|
| 1562 | + |
---|
| 1563 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1564 | + |
---|
| 1565 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1599 | 1566 | |
---|
1600 | | - //aConstraints.weighty = 1; |
---|
1601 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1602 | | - //aConstraints.gridx += 1; |
---|
1603 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1604 | | - aConstraints.weighty = 0; |
---|
1605 | | - aConstraints.gridx = 0; |
---|
1606 | | - aConstraints.gridy += 1; |
---|
1607 | | - aConstraints.gridwidth = 1; |
---|
| 1567 | + cGridBag specular = new cGridBag(); |
---|
| 1568 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 1569 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1570 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1571 | + specularSection.add(specular); |
---|
1608 | 1572 | |
---|
1609 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1610 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1611 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1612 | | - aConstraints.gridx += 1; |
---|
1613 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1614 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1615 | | - aConstraints.gridx = 0; |
---|
1616 | | - aConstraints.gridy += 1; |
---|
1617 | | - aConstraints.gridwidth = 1; |
---|
| 1573 | + cGridBag lightarea = new cGridBag(); |
---|
| 1574 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 1575 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1576 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1577 | + specularSection.add(lightarea); |
---|
1618 | 1578 | |
---|
1619 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1620 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1621 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1622 | | - aConstraints.gridx += 1; |
---|
1623 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1624 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1625 | | - aConstraints.gridx = 0; |
---|
1626 | | - aConstraints.gridy += 1; |
---|
1627 | | - aConstraints.gridwidth = 1; |
---|
| 1579 | + cGridBag shininess = new cGridBag(); |
---|
| 1580 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 1581 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1582 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1583 | + specularSection.add(shininess); |
---|
1628 | 1584 | |
---|
1629 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1630 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1631 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1632 | | - aConstraints.gridx += 1; |
---|
1633 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1634 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1635 | | - aConstraints.gridx = 0; |
---|
1636 | | - aConstraints.gridy += 1; |
---|
1637 | | - aConstraints.gridwidth = 1; |
---|
| 1585 | + cGridBag metalness = new cGridBag(); |
---|
| 1586 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 1587 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1588 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1589 | + specularSection.add(metalness); |
---|
1638 | 1590 | |
---|
1639 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1640 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1641 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1642 | | - aConstraints.gridx += 1; |
---|
1643 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1644 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1645 | | - aConstraints.gridx = 0; |
---|
1646 | | - aConstraints.gridy += 1; |
---|
1647 | | - aConstraints.gridwidth = 1; |
---|
| 1591 | + cGridBag velvet = new cGridBag(); |
---|
| 1592 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 1593 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1594 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1595 | + specularSection.add(velvet); |
---|
1648 | 1596 | |
---|
1649 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1650 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1651 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1652 | | - aConstraints.gridx += 1; |
---|
1653 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1654 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1655 | | - aConstraints.gridx = 0; |
---|
1656 | | - aConstraints.gridy += 1; |
---|
1657 | | - aConstraints.gridwidth = 1; |
---|
1658 | | - |
---|
1659 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1660 | | - Return(); |
---|
| 1597 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1598 | + //Return(); |
---|
1661 | 1599 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1662 | 1600 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1663 | 1601 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1668 | 1606 | // aConstraints.gridy += 1; |
---|
1669 | 1607 | // aConstraints.gridwidth = 1; |
---|
1670 | 1608 | |
---|
1671 | | - //aConstraints.weighty = 1; |
---|
1672 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1673 | | - //aConstraints.gridx += 1; |
---|
1674 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1675 | | - aConstraints.weighty = 0; |
---|
1676 | | - aConstraints.gridx = 0; |
---|
1677 | | - aConstraints.gridy += 1; |
---|
1678 | | - aConstraints.gridwidth = 1; |
---|
1679 | 1609 | |
---|
1680 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1681 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1682 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1683 | | - aConstraints.gridx += 1; |
---|
1684 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1685 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1686 | | - aConstraints.gridx = 0; |
---|
1687 | | - aConstraints.gridy += 1; |
---|
1688 | | - aConstraints.gridwidth = 1; |
---|
| 1610 | + panel.add(new JSeparator()); |
---|
| 1611 | + |
---|
| 1612 | + panel.add(specularSection); |
---|
| 1613 | + |
---|
| 1614 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1615 | + |
---|
| 1616 | + cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1689 | 1617 | |
---|
1690 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1691 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1692 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1693 | | - aConstraints.gridx += 1; |
---|
1694 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1695 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1696 | | - aConstraints.gridx = 0; |
---|
1697 | | - aConstraints.gridy += 1; |
---|
1698 | | - aConstraints.gridwidth = 1; |
---|
| 1618 | + cGridBag camera = new cGridBag(); |
---|
| 1619 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 1620 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1621 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1622 | + globalSection.add(camera); |
---|
1699 | 1623 | |
---|
1700 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1701 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1702 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1703 | | - aConstraints.gridx += 1; |
---|
1704 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1705 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1706 | | - aConstraints.gridx = 0; |
---|
1707 | | - aConstraints.gridy += 1; |
---|
1708 | | - aConstraints.gridwidth = 1; |
---|
| 1624 | + cGridBag ambient = new cGridBag(); |
---|
| 1625 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 1626 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1627 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1628 | + globalSection.add(ambient); |
---|
1709 | 1629 | |
---|
1710 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1711 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1712 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1713 | | - aConstraints.gridx += 1; |
---|
1714 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1715 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1716 | | - aConstraints.gridx = 0; |
---|
1717 | | - aConstraints.gridy += 1; |
---|
1718 | | - aConstraints.gridwidth = 1; |
---|
1719 | | - aConstraints.weighty = 0; |
---|
| 1630 | + cGridBag backlit = new cGridBag(); |
---|
| 1631 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 1632 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1633 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1634 | + globalSection.add(backlit); |
---|
1720 | 1635 | |
---|
1721 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1722 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1723 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1724 | | - aConstraints.gridx += 1; |
---|
1725 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1726 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1727 | | - aConstraints.gridx = 0; |
---|
1728 | | - aConstraints.gridy += 1; |
---|
1729 | | - aConstraints.gridwidth = 1; |
---|
| 1636 | + cGridBag opacity = new cGridBag(); |
---|
| 1637 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1638 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1639 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1640 | + globalSection.add(opacity); |
---|
1730 | 1641 | |
---|
1731 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1732 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1733 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1734 | | - aConstraints.gridx += 1; |
---|
1735 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1736 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1737 | | - aConstraints.gridx = 0; |
---|
1738 | | - aConstraints.gridy += 1; |
---|
1739 | | - aConstraints.gridwidth = 1; |
---|
| 1642 | + panel.add(new JSeparator()); |
---|
| 1643 | + |
---|
| 1644 | + panel.add(globalSection); |
---|
| 1645 | + |
---|
| 1646 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1647 | + |
---|
| 1648 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1740 | 1649 | |
---|
1741 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1742 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1743 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1744 | | - aConstraints.gridx += 1; |
---|
1745 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1746 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1747 | | - aConstraints.gridx = 0; |
---|
1748 | | - aConstraints.gridy += 1; |
---|
1749 | | - aConstraints.gridwidth = 1; |
---|
| 1650 | + cGridBag bump = new cGridBag(); |
---|
| 1651 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 1652 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1653 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1654 | + textureSection.add(bump); |
---|
1750 | 1655 | |
---|
1751 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1752 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1753 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1754 | | - aConstraints.gridx += 1; |
---|
1755 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1756 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1757 | | - aConstraints.gridx = 0; |
---|
1758 | | - aConstraints.gridy += 1; |
---|
1759 | | - aConstraints.gridwidth = 1; |
---|
| 1656 | + cGridBag noise = new cGridBag(); |
---|
| 1657 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 1658 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1659 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 1660 | + textureSection.add(noise); |
---|
1760 | 1661 | |
---|
1761 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1762 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1763 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1764 | | - aConstraints.gridx += 1; |
---|
1765 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1766 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1767 | | - aConstraints.gridx = 0; |
---|
1768 | | - aConstraints.gridy += 1; |
---|
1769 | | - aConstraints.gridwidth = 1; |
---|
| 1662 | + cGridBag power = new cGridBag(); |
---|
| 1663 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 1664 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1665 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 1666 | + textureSection.add(power); |
---|
1770 | 1667 | |
---|
1771 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1772 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1773 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1774 | | - aConstraints.gridx += 1; |
---|
1775 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1776 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1777 | | - aConstraints.gridx = 0; |
---|
1778 | | - aConstraints.gridy += 1; |
---|
1779 | | - aConstraints.gridwidth = 1; |
---|
| 1668 | + cGridBag borderfade = new cGridBag(); |
---|
| 1669 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 1670 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1671 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1672 | + textureSection.add(borderfade); |
---|
1780 | 1673 | |
---|
1781 | | - //aConstraints.weighty = 1; |
---|
1782 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1783 | | - //aConstraints.gridx += 1; |
---|
1784 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1785 | | - aConstraints.weighty = 0; |
---|
| 1674 | + cGridBag fog = new cGridBag(); |
---|
| 1675 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 1676 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1677 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 1678 | + textureSection.add(fog); |
---|
1786 | 1679 | |
---|
1787 | | - aConstraints.gridx = 0; |
---|
1788 | | - aConstraints.gridy = 0; |
---|
1789 | | - aConstraints.gridwidth = 1; |
---|
| 1680 | + cGridBag opacityPower = new cGridBag(); |
---|
| 1681 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 1682 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1683 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 1684 | + textureSection.add(opacityPower); |
---|
| 1685 | + |
---|
| 1686 | + panel.add(new JSeparator()); |
---|
| 1687 | + |
---|
| 1688 | + panel.add(textureSection); |
---|
| 1689 | + |
---|
| 1690 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1790 | 1691 | |
---|
1791 | 1692 | SetMaterial(copy); // .GetMaterial()); |
---|
1792 | 1693 | |
---|
1793 | | - colorField.addChangeListener(this); |
---|
1794 | | - modulationField.addChangeListener(this); |
---|
| 1694 | + //colorField.addChangeListener(this); |
---|
| 1695 | +// modulationField.addChangeListener(this); |
---|
1795 | 1696 | metalnessField.addChangeListener(this); |
---|
1796 | 1697 | diffuseField.addChangeListener(this); |
---|
1797 | 1698 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
2603 | 2504 | } |
---|
2604 | 2505 | if (input == null) |
---|
2605 | 2506 | { |
---|
| 2507 | + new Exception().printStackTrace(); |
---|
2606 | 2508 | System.exit(0); |
---|
2607 | 2509 | } |
---|
2608 | 2510 | |
---|
.. | .. |
---|
3300 | 3202 | if (!Globals.ANIMATION) |
---|
3301 | 3203 | { |
---|
3302 | 3204 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3303 | | - browser.show(); |
---|
| 3205 | + browser.setVisible(true); |
---|
3304 | 3206 | String filename = browser.getFile(); |
---|
3305 | 3207 | if (filename != null && filename.length() > 0) |
---|
3306 | 3208 | { |
---|
.. | .. |
---|
3332 | 3234 | callee.refreshContents(); |
---|
3333 | 3235 | } else |
---|
3334 | 3236 | { |
---|
| 3237 | + new Exception().printStackTrace(); |
---|
3335 | 3238 | System.exit(0); |
---|
3336 | 3239 | } |
---|
3337 | 3240 | } |
---|
.. | .. |
---|
3494 | 3397 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3495 | 3398 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3496 | 3399 | |
---|
3497 | | - if (!NumberSlider.frozen) |
---|
| 3400 | + if (!cNumberSlider.frozen) |
---|
3498 | 3401 | { |
---|
3499 | 3402 | //System.out.println("Propagate = " + propagate); |
---|
3500 | 3403 | copy.UpdateMaterial(anchor, current, propagate); |
---|
.. | .. |
---|
3542 | 3445 | || e.getSource() == apertureField |
---|
3543 | 3446 | || e.getSource() == shadowblurField) |
---|
3544 | 3447 | { |
---|
| 3448 | + new Exception().printStackTrace(); |
---|
3545 | 3449 | System.exit(0); |
---|
3546 | 3450 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3547 | 3451 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3867 | 3771 | |
---|
3868 | 3772 | radioPanel.revalidate(); |
---|
3869 | 3773 | radioPanel.repaint(); |
---|
3870 | | - ctrlPanel.revalidate(); // ? new |
---|
| 3774 | + ctrlPanel.validate(); // ? new |
---|
3871 | 3775 | ctrlPanel.repaint(); |
---|
3872 | 3776 | } |
---|
3873 | 3777 | } |
---|
.. | .. |
---|
4513 | 4417 | //MenuItem normalLensItem; |
---|
4514 | 4418 | MenuItem editCameraItem; |
---|
4515 | 4419 | MenuItem revertCameraItem; |
---|
4516 | | - CheckboxMenuItem toggleLiveItem; |
---|
4517 | 4420 | MenuItem stepItem; |
---|
| 4421 | + CheckboxMenuItem toggleLiveItem; |
---|
4518 | 4422 | CheckboxMenuItem toggleFullScreenItem; |
---|
4519 | 4423 | CheckboxMenuItem toggleTimelineItem; |
---|
4520 | 4424 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4531 | 4435 | JSplitPane mainPanel; |
---|
4532 | 4436 | JScrollPane scrollpane; |
---|
4533 | 4437 | JPanel toolbarPanel; |
---|
4534 | | - JPanel treePanel; |
---|
| 4438 | + cGridBag treePanel; |
---|
4535 | 4439 | JPanel radioPanel; |
---|
4536 | 4440 | ButtonGroup buttonGroup; |
---|
4537 | | - JPanel ctrlPanel; |
---|
4538 | | - JPanel materialPanel; |
---|
| 4441 | + cGridBag ctrlPanel; |
---|
| 4442 | + cGridBag materialPanel; |
---|
4539 | 4443 | JScrollPane infoPanel; |
---|
4540 | | - JPanel optionsPanel; |
---|
| 4444 | + cGridBag optionsPanel; |
---|
4541 | 4445 | JTabbedPane objectPanel; |
---|
4542 | | - JPanel XYZPanel; |
---|
| 4446 | + cGridBag XYZPanel; |
---|
4543 | 4447 | JSplitPane gridPanel; |
---|
4544 | 4448 | JSplitPane bigPanel; |
---|
4545 | | - JPanel bigThree; |
---|
4546 | | - JTabbedPane scenePanel; |
---|
4547 | | - JPanel centralPanel; |
---|
| 4449 | + cGridBag bigThree; |
---|
| 4450 | + cGridBag scenePanel; |
---|
| 4451 | + cGridBag centralPanel; |
---|
4548 | 4452 | JSplitPane cameraPanel; |
---|
4549 | 4453 | JPanel timelinePanel; |
---|
4550 | 4454 | JMenuBar timelineMenubar; |
---|
.. | .. |
---|
4597 | 4501 | // MATERIAL |
---|
4598 | 4502 | JLabel materialLabel; |
---|
4599 | 4503 | JLabel colorLabel; |
---|
4600 | | - NumberSlider colorField; |
---|
| 4504 | + cNumberSlider colorField; |
---|
4601 | 4505 | JLabel modulationLabel; |
---|
4602 | | - NumberSlider modulationField; |
---|
| 4506 | + cNumberSlider modulationField; |
---|
4603 | 4507 | JLabel metalnessLabel; |
---|
4604 | | - NumberSlider metalnessField; |
---|
| 4508 | + cNumberSlider metalnessField; |
---|
4605 | 4509 | JLabel diffuseLabel; |
---|
4606 | | - NumberSlider diffuseField; |
---|
| 4510 | + cNumberSlider diffuseField; |
---|
4607 | 4511 | JLabel specularLabel; |
---|
4608 | | - NumberSlider specularField; |
---|
| 4512 | + cNumberSlider specularField; |
---|
4609 | 4513 | JLabel shininessLabel; |
---|
4610 | | - NumberSlider shininessField; |
---|
| 4514 | + cNumberSlider shininessField; |
---|
4611 | 4515 | JLabel shiftLabel; |
---|
4612 | | - NumberSlider shiftField; |
---|
| 4516 | + cNumberSlider shiftField; |
---|
4613 | 4517 | JLabel ambientLabel; |
---|
4614 | | - NumberSlider ambientField; |
---|
| 4518 | + cNumberSlider ambientField; |
---|
4615 | 4519 | JLabel lightareaLabel; |
---|
4616 | | - NumberSlider lightareaField; |
---|
| 4520 | + cNumberSlider lightareaField; |
---|
4617 | 4521 | JLabel diffusenessLabel; |
---|
4618 | | - NumberSlider diffusenessField; |
---|
| 4522 | + cNumberSlider diffusenessField; |
---|
4619 | 4523 | JLabel velvetLabel; |
---|
4620 | | - NumberSlider velvetField; |
---|
| 4524 | + cNumberSlider velvetField; |
---|
4621 | 4525 | JLabel sheenLabel; |
---|
4622 | | - NumberSlider sheenField; |
---|
| 4526 | + cNumberSlider sheenField; |
---|
4623 | 4527 | JLabel subsurfaceLabel; |
---|
4624 | | - NumberSlider subsurfaceField; |
---|
| 4528 | + cNumberSlider subsurfaceField; |
---|
4625 | 4529 | //JLabel bumpLabel; |
---|
4626 | 4530 | //NumberSlider bumpField; |
---|
4627 | 4531 | JLabel backlitLabel; |
---|
4628 | | - NumberSlider backlitField; |
---|
| 4532 | + cNumberSlider backlitField; |
---|
4629 | 4533 | JLabel anisoLabel; |
---|
4630 | | - NumberSlider anisoField; |
---|
| 4534 | + cNumberSlider anisoField; |
---|
4631 | 4535 | JLabel anisoVLabel; |
---|
4632 | | - NumberSlider anisoVField; |
---|
| 4536 | + cNumberSlider anisoVField; |
---|
4633 | 4537 | JLabel cameraLabel; |
---|
4634 | | - NumberSlider cameraField; |
---|
| 4538 | + cNumberSlider cameraField; |
---|
4635 | 4539 | JLabel selfshadowLabel; |
---|
4636 | | - NumberSlider selfshadowField; |
---|
| 4540 | + cNumberSlider selfshadowField; |
---|
4637 | 4541 | JLabel shadowLabel; |
---|
4638 | | - NumberSlider shadowField; |
---|
| 4542 | + cNumberSlider shadowField; |
---|
4639 | 4543 | JLabel textureLabel; |
---|
4640 | | - NumberSlider textureField; |
---|
| 4544 | + cNumberSlider textureField; |
---|
4641 | 4545 | JLabel opacityLabel; |
---|
4642 | | - NumberSlider opacityField; |
---|
| 4546 | + cNumberSlider opacityField; |
---|
4643 | 4547 | JLabel fakedepthLabel; |
---|
4644 | | - NumberSlider fakedepthField; |
---|
| 4548 | + cNumberSlider fakedepthField; |
---|
4645 | 4549 | JLabel shadowbiasLabel; |
---|
4646 | | - NumberSlider shadowbiasField; |
---|
| 4550 | + cNumberSlider shadowbiasField; |
---|
4647 | 4551 | JLabel bumpLabel; |
---|
4648 | | - NumberSlider bumpField; |
---|
| 4552 | + cNumberSlider bumpField; |
---|
4649 | 4553 | JLabel noiseLabel; |
---|
4650 | | - NumberSlider noiseField; |
---|
| 4554 | + cNumberSlider noiseField; |
---|
4651 | 4555 | JLabel powerLabel; |
---|
4652 | | - NumberSlider powerField; |
---|
| 4556 | + cNumberSlider powerField; |
---|
4653 | 4557 | JLabel borderfadeLabel; |
---|
4654 | | - NumberSlider borderfadeField; |
---|
| 4558 | + cNumberSlider borderfadeField; |
---|
4655 | 4559 | JLabel fogLabel; |
---|
4656 | | - NumberSlider fogField; |
---|
| 4560 | + cNumberSlider fogField; |
---|
4657 | 4561 | JLabel opacityPowerLabel; |
---|
4658 | | - NumberSlider opacityPowerField; |
---|
| 4562 | + cNumberSlider opacityPowerField; |
---|
4659 | 4563 | JTree jTree; |
---|
4660 | 4564 | //ObjectUI parent; |
---|
4661 | 4565 | |
---|
4662 | | - NumberSlider normalpushField; |
---|
| 4566 | + cNumberSlider normalpushField; |
---|
4663 | 4567 | } |
---|