.. | .. |
---|
138 | 138 | public void closeUI() |
---|
139 | 139 | { |
---|
140 | 140 | //new Exception().printStackTrace(); |
---|
141 | | - System.out.println("this = " + this); |
---|
142 | | - System.out.println("objEditor = " + objEditor); |
---|
| 141 | +// System.out.println("this = " + this); |
---|
| 142 | +// System.out.println("objEditor = " + objEditor); |
---|
143 | 143 | //nameField.removeActionListener(this); |
---|
144 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 144 | +// objEditor.ctrlPanel.remove(nameField); |
---|
145 | 145 | |
---|
146 | 146 | if (!GroupEditor.allparams) |
---|
147 | 147 | return; |
---|
148 | 148 | |
---|
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); |
---|
| 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 | 167 | |
---|
168 | | - 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); |
---|
169 | 175 | } |
---|
170 | 176 | |
---|
171 | 177 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
353 | 359 | objectPanel = new JTabbedPane(); |
---|
354 | 360 | toolbarPanel = new JPanel(); |
---|
355 | 361 | toolbarPanel.setName("Toolbar"); |
---|
356 | | - treePanel = new JPanel(); |
---|
| 362 | + treePanel = new cGridBag(); |
---|
357 | 363 | treePanel.setName("Tree"); |
---|
358 | | - ctrlPanel = new cGridBag(); // new GridBagLayout()); |
---|
| 364 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
359 | 365 | ctrlPanel.setName("Edit"); |
---|
360 | 366 | materialPanel = new cGridBag().setVertical(true); |
---|
361 | 367 | materialPanel.setName("Material"); |
---|
362 | 368 | /*JTextPane*/ |
---|
363 | 369 | infoarea = createTextPane(); |
---|
| 370 | + doc = infoarea.getStyledDocument(); |
---|
| 371 | + |
---|
364 | 372 | infoarea.setEditable(true); |
---|
365 | 373 | SetText(); |
---|
366 | 374 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
367 | 375 | // infoarea.setOpaque(false); |
---|
368 | 376 | // //infoarea.setForeground(textcolor); |
---|
369 | | - infoarea.setLineWrap(true); |
---|
370 | | - infoarea.setWrapStyleWord(true); |
---|
| 377 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 378 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
371 | 379 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
372 | 380 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
373 | 381 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
378 | 386 | mainPanel.setName("Main"); |
---|
379 | 387 | mainPanel.setContinuousLayout(true); |
---|
380 | 388 | mainPanel.setOneTouchExpandable(true); |
---|
381 | | - mainPanel.setDividerLocation(1.0); |
---|
382 | 389 | mainPanel.setDividerSize(9); |
---|
383 | | - mainPanel.setResizeWeight(0); |
---|
| 390 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 391 | + mainPanel.setResizeWeight(0.5); |
---|
384 | 392 | |
---|
385 | 393 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
386 | 394 | //mainPanel.setLayout(new GridBagLayout()); |
---|
387 | 395 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
388 | | - treePanel.setLayout(new GridBagLayout()); |
---|
389 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 396 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 397 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
390 | 398 | //materialPanel.setLayout(new GridBagLayout()); |
---|
391 | 399 | |
---|
392 | 400 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
.. | .. |
---|
426 | 434 | static String newline = "\n"; |
---|
427 | 435 | protected static final String buttonString = "JButton"; |
---|
428 | 436 | StyledDocument doc; |
---|
429 | | - JTextArea infoarea; |
---|
| 437 | + JTextPane infoarea; |
---|
430 | 438 | |
---|
431 | 439 | void ClearInfo() |
---|
432 | 440 | { |
---|
.. | .. |
---|
493 | 501 | } |
---|
494 | 502 | |
---|
495 | 503 | if (full) |
---|
496 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 504 | + { |
---|
| 505 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 506 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 507 | + } |
---|
497 | 508 | |
---|
498 | 509 | if (sel.bRep != null) |
---|
499 | 510 | { |
---|
.. | .. |
---|
591 | 602 | { |
---|
592 | 603 | CameraPane.pointflow = (PointFlow) sel; |
---|
593 | 604 | } |
---|
| 605 | + |
---|
| 606 | + si.SendInfo("_____________________", "regular"); |
---|
| 607 | + si.SendInfo("", "regular"); |
---|
594 | 608 | } |
---|
595 | 609 | } |
---|
596 | 610 | |
---|
.. | .. |
---|
622 | 636 | cameraView.ToggleFullScreen(); |
---|
623 | 637 | } |
---|
624 | 638 | |
---|
625 | | - private JTextArea createTextPane() |
---|
| 639 | + private JTextPane createTextPane() |
---|
626 | 640 | { |
---|
627 | | - String[] initString = |
---|
628 | | - { |
---|
629 | | - "This is an editable JTextPane, ", //regular |
---|
630 | | - "another ", //italic |
---|
631 | | - "styled ", //bold |
---|
632 | | - "text ", //small |
---|
633 | | - "component, ", //large |
---|
634 | | - "which supports embedded components..." + newline,//regular |
---|
635 | | - " " + newline, //button |
---|
636 | | - "...and embedded icons..." + newline, //regular |
---|
637 | | - " ", //icon |
---|
638 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
639 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
640 | | - + "cover methods for interacting with those objects." |
---|
641 | | - }; |
---|
| 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 | +// } |
---|
642 | 683 | |
---|
643 | | - String[] initStyles = |
---|
644 | | - { |
---|
645 | | - "regular", "italic", "bold", "small", "large", |
---|
646 | | - "regular", "button", "regular", "icon", |
---|
647 | | - "regular" |
---|
648 | | - }; |
---|
649 | | - |
---|
650 | | - JTextPane textPane = new JTextPane(); |
---|
651 | | - textPane.setEditable(true); |
---|
652 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
653 | | - addStylesToDocument(doc); |
---|
654 | | - |
---|
655 | | - try |
---|
656 | | - { |
---|
657 | | - for (int j = 0; j < 2; j++) |
---|
658 | | - { |
---|
659 | | - for (int i = 0; i < initString.length; i++) |
---|
660 | | - { |
---|
661 | | - doc.insertString(doc.getLength(), initString[i], |
---|
662 | | - doc.getStyle(initStyles[i])); |
---|
663 | | - } |
---|
664 | | - } |
---|
665 | | - } catch (BadLocationException ble) |
---|
666 | | - { |
---|
667 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
668 | | - } |
---|
669 | | - |
---|
670 | | - return new JTextArea(); // textPane; |
---|
| 684 | + return new JTextPane(); // textPane; |
---|
671 | 685 | } |
---|
672 | 686 | |
---|
673 | 687 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
767 | 781 | JButton slowerButton; |
---|
768 | 782 | JButton fasterButton; |
---|
769 | 783 | JButton remarkButton; |
---|
| 784 | + |
---|
| 785 | + cGridBag namePanel; |
---|
| 786 | + cGridBag setupPanel; |
---|
| 787 | + cGridBag commandsPanel; |
---|
| 788 | + cGridBag pushPanel; |
---|
| 789 | + cGridBag fillPanel; |
---|
770 | 790 | |
---|
771 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 791 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
772 | 792 | { |
---|
773 | 793 | JCheckBox cb; |
---|
774 | 794 | |
---|
775 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
776 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
777 | | -// oe.aConstraints.weightx = 1; |
---|
778 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
779 | | - 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); |
---|
780 | 796 | cb.addItemListener(this); |
---|
781 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
782 | | - oe.aConstraints.gridwidth = 1; |
---|
783 | | - oe.aConstraints.gridx += 1; |
---|
784 | 797 | |
---|
785 | 798 | return cb; |
---|
786 | 799 | } |
---|
787 | 800 | |
---|
788 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 801 | + cButton AddButton(cGridBag panel, String label) |
---|
789 | 802 | { |
---|
790 | 803 | cButton cb; |
---|
791 | 804 | |
---|
792 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
793 | | - oe.aConstraints.gridwidth = 1; |
---|
794 | | -// oe.aConstraints.weightx = 1; |
---|
795 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
796 | | - 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); |
---|
797 | 806 | cb.addActionListener(this); |
---|
798 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
799 | | - oe.aConstraints.gridwidth = 1; |
---|
800 | | - oe.aConstraints.gridx += 1; |
---|
801 | 807 | |
---|
802 | 808 | return cb; |
---|
803 | 809 | } |
---|
804 | 810 | |
---|
805 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 811 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
806 | 812 | { |
---|
807 | 813 | JComboBox combo; |
---|
808 | 814 | |
---|
809 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
810 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
811 | | - oe.aConstraints.gridx += 1; |
---|
| 815 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
812 | 816 | combo.addActionListener(this); |
---|
813 | 817 | |
---|
814 | 818 | return combo; |
---|
815 | 819 | } |
---|
816 | 820 | |
---|
817 | | - cNumberSlider AddSlider(cGridBag 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) |
---|
818 | 822 | { |
---|
819 | 823 | cGridBag control = new cGridBag(); |
---|
820 | 824 | |
---|
.. | .. |
---|
826 | 830 | control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
827 | 831 | combo.setFloat(current); |
---|
828 | 832 | |
---|
829 | | - ctrlPanel.add(control); |
---|
| 833 | + panel.add(control); |
---|
830 | 834 | |
---|
831 | | - return combo; |
---|
| 835 | + return control; |
---|
832 | 836 | } |
---|
833 | 837 | |
---|
834 | | - cNumberSlider AddSlider(cGridBag ctrlPanel, String label, int min, int max, int current) |
---|
| 838 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
835 | 839 | { |
---|
836 | 840 | cGridBag control = new cGridBag(); |
---|
837 | 841 | |
---|
.. | .. |
---|
839 | 843 | |
---|
840 | 844 | JLabel jlabel = new JLabel(label); |
---|
841 | 845 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
842 | | - ctrlPanel.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
843 | | - ctrlPanel.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 846 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 847 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
844 | 848 | combo.setInteger(current); |
---|
845 | 849 | |
---|
846 | | - ctrlPanel.add(control); |
---|
| 850 | + panel.add(control); |
---|
847 | 851 | |
---|
848 | | - return combo; |
---|
| 852 | + return control; |
---|
849 | 853 | } |
---|
850 | 854 | |
---|
851 | 855 | JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
852 | 856 | { |
---|
853 | 857 | JTextArea text; |
---|
854 | 858 | |
---|
855 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
856 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
857 | 859 | ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
858 | 860 | text.addCaretListener(this); |
---|
859 | | - aConstraints.gridx += 1; |
---|
860 | | - aConstraints.gridwidth = 1; |
---|
861 | 861 | |
---|
862 | 862 | return text; |
---|
863 | 863 | } |
---|
.. | .. |
---|
896 | 896 | |
---|
897 | 897 | /* |
---|
898 | 898 | */ |
---|
899 | | - void Return() // ObjEditor oe) |
---|
| 899 | + void Return0() // ObjEditor oe) |
---|
900 | 900 | { |
---|
901 | 901 | aConstraints.gridy += 1; |
---|
902 | 902 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
951 | 951 | |
---|
952 | 952 | void SetupUI2(ObjEditor oe) |
---|
953 | 953 | { |
---|
954 | | -// oe.aConstraints.weightx = 0; |
---|
955 | | -// oe.aConstraints.weighty = 0; |
---|
956 | | -// oe.aConstraints.gridx = 0; |
---|
957 | | -// oe.aConstraints.gridy = 0; |
---|
958 | | - 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(); |
---|
959 | 963 | |
---|
960 | 964 | if (!GroupEditor.allparams) |
---|
961 | 965 | return; |
---|
962 | 966 | |
---|
963 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
964 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
965 | | - 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); |
---|
966 | 973 | // Return(); |
---|
967 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
968 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
969 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
970 | | - Return(); |
---|
971 | | - resetButton = AddButton(oe, "Reset"); |
---|
972 | | - 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"); |
---|
973 | 985 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
974 | 986 | // stepAllButton = AddButton(oe, "Step All"); |
---|
975 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
| 987 | + speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup); |
---|
976 | 988 | // Return(); |
---|
977 | | - slowerButton = AddButton(oe, "Slow"); |
---|
978 | | - fasterButton = AddButton(oe, "Fast"); |
---|
979 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 989 | + slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 990 | + fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 991 | + remarkButton = AddButton(commandsPanel, "Remark"); |
---|
980 | 992 | |
---|
981 | | - //Return(); |
---|
| 993 | + oe.ctrlPanel.add(commandsPanel); |
---|
| 994 | + oe.ctrlPanel.Return(); |
---|
982 | 995 | |
---|
983 | | - //normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
| 996 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1); |
---|
| 997 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
984 | 998 | //Return(); |
---|
| 999 | + |
---|
| 1000 | + oe.ctrlPanel.Return(); |
---|
985 | 1001 | |
---|
986 | 1002 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
987 | 1003 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1076 | 1092 | oe.aConstraints.gridwidth = 1; |
---|
1077 | 1093 | /**/ |
---|
1078 | 1094 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1079 | | - Return(); |
---|
| 1095 | + oe.ctrlPanel.Return(); |
---|
1080 | 1096 | |
---|
1081 | 1097 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1082 | 1098 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1253 | 1269 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1254 | 1270 | //tmp.setName("Edit"); |
---|
1255 | 1271 | objectPanel.add(materialPanel); |
---|
1256 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1257 | | - north.setName("Edit"); |
---|
1258 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1259 | | - 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); |
---|
1260 | 1277 | objectPanel.add(infoPanel); |
---|
1261 | 1278 | |
---|
1262 | 1279 | /* |
---|
.. | .. |
---|
1415 | 1432 | ctrlPanel.removeAll(); |
---|
1416 | 1433 | } |
---|
1417 | 1434 | |
---|
1418 | | - void SetupMaterial(cGridBag ctrlPanel) |
---|
| 1435 | + void SetupMaterial(cGridBag panel) |
---|
1419 | 1436 | { |
---|
1420 | 1437 | /* |
---|
1421 | 1438 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
.. | .. |
---|
1424 | 1441 | |
---|
1425 | 1442 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1426 | 1443 | |
---|
1427 | | - editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints); |
---|
| 1444 | + editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1445 | + createMaterialButton.setToolTipText("Create material"); |
---|
1428 | 1446 | |
---|
1429 | 1447 | /* |
---|
1430 | 1448 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1431 | 1449 | */ |
---|
1432 | 1450 | |
---|
1433 | | - editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints); |
---|
1434 | | - editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints); |
---|
| 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); |
---|
1435 | 1455 | editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
1436 | 1456 | editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
1437 | 1457 | |
---|
1438 | | - ctrlPanel.add(editBar); |
---|
| 1458 | + editBar.preferredHeight = 15; |
---|
| 1459 | + |
---|
| 1460 | + panel.add(editBar); |
---|
1439 | 1461 | |
---|
1440 | 1462 | /**/ |
---|
1441 | 1463 | //aConstraints.weighty = 0; |
---|
.. | .. |
---|
1484 | 1506 | shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1485 | 1507 | colorSection.add(shadowbias); |
---|
1486 | 1508 | |
---|
1487 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1509 | + panel.add(new JSeparator()); |
---|
1488 | 1510 | |
---|
1489 | | - ctrlPanel.add(colorSection); |
---|
| 1511 | + panel.add(colorSection); |
---|
1490 | 1512 | |
---|
1491 | 1513 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1492 | 1514 | |
---|
.. | .. |
---|
1534 | 1556 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1535 | 1557 | diffuseSection.add(fakedepth); |
---|
1536 | 1558 | |
---|
1537 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1559 | + panel.add(new JSeparator()); |
---|
1538 | 1560 | |
---|
1539 | | - ctrlPanel.add(diffuseSection); |
---|
| 1561 | + panel.add(diffuseSection); |
---|
1540 | 1562 | |
---|
1541 | 1563 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1542 | 1564 | |
---|
.. | .. |
---|
1572 | 1594 | velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1573 | 1595 | specularSection.add(velvet); |
---|
1574 | 1596 | |
---|
1575 | | - shiftField = AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
| 1597 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
1576 | 1598 | //Return(); |
---|
1577 | 1599 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1578 | 1600 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
1585 | 1607 | // aConstraints.gridwidth = 1; |
---|
1586 | 1608 | |
---|
1587 | 1609 | |
---|
1588 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1610 | + panel.add(new JSeparator()); |
---|
1589 | 1611 | |
---|
1590 | | - ctrlPanel.add(specularSection); |
---|
| 1612 | + panel.add(specularSection); |
---|
1591 | 1613 | |
---|
1592 | 1614 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1593 | 1615 | |
---|
.. | .. |
---|
1617 | 1639 | opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1618 | 1640 | globalSection.add(opacity); |
---|
1619 | 1641 | |
---|
1620 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1642 | + panel.add(new JSeparator()); |
---|
1621 | 1643 | |
---|
1622 | | - ctrlPanel.add(globalSection); |
---|
| 1644 | + panel.add(globalSection); |
---|
1623 | 1645 | |
---|
1624 | 1646 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1625 | 1647 | |
---|
.. | .. |
---|
1661 | 1683 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1662 | 1684 | textureSection.add(opacityPower); |
---|
1663 | 1685 | |
---|
1664 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1686 | + panel.add(new JSeparator()); |
---|
1665 | 1687 | |
---|
1666 | | - ctrlPanel.add(textureSection); |
---|
| 1688 | + panel.add(textureSection); |
---|
1667 | 1689 | |
---|
1668 | 1690 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1669 | 1691 | |
---|
.. | .. |
---|
2482 | 2504 | } |
---|
2483 | 2505 | if (input == null) |
---|
2484 | 2506 | { |
---|
| 2507 | + new Exception().printStackTrace(); |
---|
2485 | 2508 | System.exit(0); |
---|
2486 | 2509 | } |
---|
2487 | 2510 | |
---|
.. | .. |
---|
3179 | 3202 | if (!Globals.ANIMATION) |
---|
3180 | 3203 | { |
---|
3181 | 3204 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3182 | | - browser.show(); |
---|
| 3205 | + browser.setVisible(true); |
---|
3183 | 3206 | String filename = browser.getFile(); |
---|
3184 | 3207 | if (filename != null && filename.length() > 0) |
---|
3185 | 3208 | { |
---|
.. | .. |
---|
3211 | 3234 | callee.refreshContents(); |
---|
3212 | 3235 | } else |
---|
3213 | 3236 | { |
---|
| 3237 | + new Exception().printStackTrace(); |
---|
3214 | 3238 | System.exit(0); |
---|
3215 | 3239 | } |
---|
3216 | 3240 | } |
---|
.. | .. |
---|
3421 | 3445 | || e.getSource() == apertureField |
---|
3422 | 3446 | || e.getSource() == shadowblurField) |
---|
3423 | 3447 | { |
---|
| 3448 | + new Exception().printStackTrace(); |
---|
3424 | 3449 | System.exit(0); |
---|
3425 | 3450 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3426 | 3451 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
4392 | 4417 | //MenuItem normalLensItem; |
---|
4393 | 4418 | MenuItem editCameraItem; |
---|
4394 | 4419 | MenuItem revertCameraItem; |
---|
4395 | | - CheckboxMenuItem toggleLiveItem; |
---|
4396 | 4420 | MenuItem stepItem; |
---|
| 4421 | + CheckboxMenuItem toggleLiveItem; |
---|
4397 | 4422 | CheckboxMenuItem toggleFullScreenItem; |
---|
4398 | 4423 | CheckboxMenuItem toggleTimelineItem; |
---|
4399 | 4424 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4410 | 4435 | JSplitPane mainPanel; |
---|
4411 | 4436 | JScrollPane scrollpane; |
---|
4412 | 4437 | JPanel toolbarPanel; |
---|
4413 | | - JPanel treePanel; |
---|
| 4438 | + cGridBag treePanel; |
---|
4414 | 4439 | JPanel radioPanel; |
---|
4415 | 4440 | ButtonGroup buttonGroup; |
---|
4416 | 4441 | cGridBag ctrlPanel; |
---|