.. | .. |
---|
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 | + |
---|
| 146 | + objEditor.ctrlPanel.remove(namePanel); |
---|
145 | 147 | |
---|
146 | 148 | if (!GroupEditor.allparams) |
---|
147 | 149 | return; |
---|
148 | 150 | |
---|
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); |
---|
| 151 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 152 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 153 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 154 | +// |
---|
| 155 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 156 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 157 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 158 | +// |
---|
| 159 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 160 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 161 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 162 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 163 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 164 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 165 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 166 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 167 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 168 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
167 | 169 | |
---|
168 | | - Remove(normalpushField); |
---|
| 170 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 171 | + objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 172 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 173 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 174 | + |
---|
| 175 | + //Remove(normalpushField); |
---|
169 | 176 | } |
---|
170 | 177 | |
---|
171 | 178 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
353 | 360 | objectPanel = new JTabbedPane(); |
---|
354 | 361 | toolbarPanel = new JPanel(); |
---|
355 | 362 | toolbarPanel.setName("Toolbar"); |
---|
356 | | - treePanel = new JPanel(); |
---|
| 363 | + treePanel = new cGridBag(); |
---|
357 | 364 | treePanel.setName("Tree"); |
---|
358 | | - ctrlPanel = new cGridBag(); // new GridBagLayout()); |
---|
| 365 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
359 | 366 | ctrlPanel.setName("Edit"); |
---|
360 | 367 | materialPanel = new cGridBag().setVertical(true); |
---|
361 | 368 | materialPanel.setName("Material"); |
---|
362 | 369 | /*JTextPane*/ |
---|
363 | 370 | infoarea = createTextPane(); |
---|
| 371 | + doc = infoarea.getStyledDocument(); |
---|
| 372 | + |
---|
364 | 373 | infoarea.setEditable(true); |
---|
365 | 374 | SetText(); |
---|
366 | 375 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
367 | 376 | // infoarea.setOpaque(false); |
---|
368 | 377 | // //infoarea.setForeground(textcolor); |
---|
369 | | - infoarea.setLineWrap(true); |
---|
370 | | - infoarea.setWrapStyleWord(true); |
---|
| 378 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 379 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
371 | 380 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
372 | 381 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
373 | 382 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
378 | 387 | mainPanel.setName("Main"); |
---|
379 | 388 | mainPanel.setContinuousLayout(true); |
---|
380 | 389 | mainPanel.setOneTouchExpandable(true); |
---|
381 | | - mainPanel.setDividerLocation(1.0); |
---|
382 | 390 | mainPanel.setDividerSize(9); |
---|
383 | | - mainPanel.setResizeWeight(0); |
---|
| 391 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 392 | + mainPanel.setResizeWeight(0.5); |
---|
384 | 393 | |
---|
385 | 394 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
386 | 395 | //mainPanel.setLayout(new GridBagLayout()); |
---|
387 | 396 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
388 | | - treePanel.setLayout(new GridBagLayout()); |
---|
389 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 397 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 398 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
390 | 399 | //materialPanel.setLayout(new GridBagLayout()); |
---|
391 | 400 | |
---|
392 | 401 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
.. | .. |
---|
426 | 435 | static String newline = "\n"; |
---|
427 | 436 | protected static final String buttonString = "JButton"; |
---|
428 | 437 | StyledDocument doc; |
---|
429 | | - JTextArea infoarea; |
---|
| 438 | + JTextPane infoarea; |
---|
430 | 439 | |
---|
431 | 440 | void ClearInfo() |
---|
432 | 441 | { |
---|
.. | .. |
---|
493 | 502 | } |
---|
494 | 503 | |
---|
495 | 504 | if (full) |
---|
496 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 505 | + { |
---|
| 506 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 507 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 508 | + } |
---|
497 | 509 | |
---|
498 | 510 | if (sel.bRep != null) |
---|
499 | 511 | { |
---|
.. | .. |
---|
591 | 603 | { |
---|
592 | 604 | CameraPane.pointflow = (PointFlow) sel; |
---|
593 | 605 | } |
---|
| 606 | + |
---|
| 607 | + si.SendInfo("_____________________", "regular"); |
---|
| 608 | + si.SendInfo("", "regular"); |
---|
594 | 609 | } |
---|
595 | 610 | } |
---|
596 | 611 | |
---|
.. | .. |
---|
622 | 637 | cameraView.ToggleFullScreen(); |
---|
623 | 638 | } |
---|
624 | 639 | |
---|
625 | | - private JTextArea createTextPane() |
---|
| 640 | + private JTextPane createTextPane() |
---|
626 | 641 | { |
---|
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 | | - }; |
---|
| 642 | +// TEXTAREA String[] initString = |
---|
| 643 | +// { |
---|
| 644 | +// "This is an editable JTextPane, ", //regular |
---|
| 645 | +// "another ", //italic |
---|
| 646 | +// "styled ", //bold |
---|
| 647 | +// "text ", //small |
---|
| 648 | +// "component, ", //large |
---|
| 649 | +// "which supports embedded components..." + newline,//regular |
---|
| 650 | +// " " + newline, //button |
---|
| 651 | +// "...and embedded icons..." + newline, //regular |
---|
| 652 | +// " ", //icon |
---|
| 653 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 654 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 655 | +// + "cover methods for interacting with those objects." |
---|
| 656 | +// }; |
---|
| 657 | +// |
---|
| 658 | +// String[] initStyles = |
---|
| 659 | +// { |
---|
| 660 | +// "regular", "italic", "bold", "small", "large", |
---|
| 661 | +// "regular", "button", "regular", "icon", |
---|
| 662 | +// "regular" |
---|
| 663 | +// }; |
---|
| 664 | +// |
---|
| 665 | +// JTextPane textPane = new JTextPane(); |
---|
| 666 | +// textPane.setEditable(true); |
---|
| 667 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 668 | +// addStylesToDocument(doc); |
---|
| 669 | +// |
---|
| 670 | +// try |
---|
| 671 | +// { |
---|
| 672 | +// for (int j = 0; j < 2; j++) |
---|
| 673 | +// { |
---|
| 674 | +// for (int i = 0; i < initString.length; i++) |
---|
| 675 | +// { |
---|
| 676 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 677 | +// doc.getStyle(initStyles[i])); |
---|
| 678 | +// } |
---|
| 679 | +// } |
---|
| 680 | +// } catch (BadLocationException ble) |
---|
| 681 | +// { |
---|
| 682 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 683 | +// } |
---|
642 | 684 | |
---|
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; |
---|
| 685 | + return new JTextPane(); // textPane; |
---|
671 | 686 | } |
---|
672 | 687 | |
---|
673 | 688 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
767 | 782 | JButton slowerButton; |
---|
768 | 783 | JButton fasterButton; |
---|
769 | 784 | JButton remarkButton; |
---|
| 785 | + |
---|
| 786 | + cGridBag namePanel; |
---|
| 787 | + cGridBag setupPanel; |
---|
| 788 | + cGridBag commandsPanel; |
---|
| 789 | + cGridBag pushPanel; |
---|
| 790 | + cGridBag fillPanel; |
---|
770 | 791 | |
---|
771 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 792 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
772 | 793 | { |
---|
773 | 794 | JCheckBox cb; |
---|
774 | 795 | |
---|
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); |
---|
| 796 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
780 | 797 | cb.addItemListener(this); |
---|
781 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
782 | | - oe.aConstraints.gridwidth = 1; |
---|
783 | | - oe.aConstraints.gridx += 1; |
---|
784 | 798 | |
---|
785 | 799 | return cb; |
---|
786 | 800 | } |
---|
787 | 801 | |
---|
788 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 802 | + cButton AddButton(cGridBag panel, String label) |
---|
789 | 803 | { |
---|
790 | 804 | cButton cb; |
---|
791 | 805 | |
---|
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); |
---|
| 806 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
797 | 807 | cb.addActionListener(this); |
---|
798 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
799 | | - oe.aConstraints.gridwidth = 1; |
---|
800 | | - oe.aConstraints.gridx += 1; |
---|
801 | 808 | |
---|
802 | 809 | return cb; |
---|
803 | 810 | } |
---|
804 | 811 | |
---|
805 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 812 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
806 | 813 | { |
---|
807 | 814 | JComboBox combo; |
---|
808 | 815 | |
---|
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; |
---|
| 816 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
812 | 817 | combo.addActionListener(this); |
---|
813 | 818 | |
---|
814 | 819 | return combo; |
---|
815 | 820 | } |
---|
816 | 821 | |
---|
817 | | - cNumberSlider AddSlider(cGridBag ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 822 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
818 | 823 | { |
---|
819 | 824 | cGridBag control = new cGridBag(); |
---|
820 | 825 | |
---|
.. | .. |
---|
826 | 831 | control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
827 | 832 | combo.setFloat(current); |
---|
828 | 833 | |
---|
829 | | - ctrlPanel.add(control); |
---|
| 834 | + panel.add(control); |
---|
830 | 835 | |
---|
831 | | - return combo; |
---|
| 836 | + return control; |
---|
832 | 837 | } |
---|
833 | 838 | |
---|
834 | | - cNumberSlider AddSlider(cGridBag ctrlPanel, String label, int min, int max, int current) |
---|
| 839 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
835 | 840 | { |
---|
836 | 841 | cGridBag control = new cGridBag(); |
---|
837 | 842 | |
---|
.. | .. |
---|
839 | 844 | |
---|
840 | 845 | JLabel jlabel = new JLabel(label); |
---|
841 | 846 | 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); |
---|
| 847 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 848 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
844 | 849 | combo.setInteger(current); |
---|
845 | 850 | |
---|
846 | | - ctrlPanel.add(control); |
---|
| 851 | + panel.add(control); |
---|
847 | 852 | |
---|
848 | | - return combo; |
---|
| 853 | + return control; |
---|
849 | 854 | } |
---|
850 | 855 | |
---|
851 | 856 | JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
852 | 857 | { |
---|
853 | 858 | JTextArea text; |
---|
854 | 859 | |
---|
855 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
856 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
857 | 860 | ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
858 | 861 | text.addCaretListener(this); |
---|
859 | | - aConstraints.gridx += 1; |
---|
860 | | - aConstraints.gridwidth = 1; |
---|
861 | 862 | |
---|
862 | 863 | return text; |
---|
863 | 864 | } |
---|
.. | .. |
---|
896 | 897 | |
---|
897 | 898 | /* |
---|
898 | 899 | */ |
---|
899 | | - void Return() // ObjEditor oe) |
---|
| 900 | + void Return0() // ObjEditor oe) |
---|
900 | 901 | { |
---|
901 | 902 | aConstraints.gridy += 1; |
---|
902 | 903 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
951 | 952 | |
---|
952 | 953 | void SetupUI2(ObjEditor oe) |
---|
953 | 954 | { |
---|
954 | | -// oe.aConstraints.weightx = 0; |
---|
955 | | -// oe.aConstraints.weighty = 0; |
---|
956 | | -// oe.aConstraints.gridx = 0; |
---|
957 | | -// oe.aConstraints.gridy = 0; |
---|
958 | | - SetupName(oe); |
---|
| 955 | + //SetupName(oe); |
---|
| 956 | + |
---|
| 957 | + namePanel = new cGridBag(); |
---|
| 958 | + |
---|
| 959 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 960 | + namePanel.add(nameField); |
---|
| 961 | + oe.ctrlPanel.add(namePanel); |
---|
| 962 | + |
---|
| 963 | + oe.ctrlPanel.Return(); |
---|
959 | 964 | |
---|
960 | 965 | if (!GroupEditor.allparams) |
---|
961 | 966 | return; |
---|
962 | 967 | |
---|
963 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
964 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
965 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 968 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 969 | + |
---|
| 970 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 971 | + liveCB.setToolTipText("Animate object"); |
---|
| 972 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 973 | + hideCB.setToolTipText("Hide object"); |
---|
966 | 974 | // 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"); |
---|
| 975 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 976 | + markCB.setToolTipText("Set the animation target transform"); |
---|
| 977 | + |
---|
| 978 | + rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 979 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 980 | + |
---|
| 981 | + randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
| 982 | + randomCB.setToolTipText("Option for switch node"); |
---|
| 983 | + |
---|
| 984 | + if (Globals.ADVANCED) |
---|
| 985 | + { |
---|
| 986 | + link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
| 987 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 988 | + speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 989 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 990 | + } |
---|
| 991 | + |
---|
| 992 | + oe.ctrlPanel.add(setupPanel); |
---|
| 993 | + oe.ctrlPanel.Return(); |
---|
| 994 | + |
---|
| 995 | + commandsPanel = new cGridBag().setVertical(false); |
---|
| 996 | + |
---|
| 997 | + resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 998 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 999 | + stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1000 | + stepButton.setToolTipText("Step one frame"); |
---|
973 | 1001 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
974 | 1002 | // stepAllButton = AddButton(oe, "Step All"); |
---|
975 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
976 | 1003 | // Return(); |
---|
977 | | - slowerButton = AddButton(oe, "Slow"); |
---|
978 | | - fasterButton = AddButton(oe, "Fast"); |
---|
979 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1004 | + slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 1005 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1006 | + fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 1007 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1008 | + remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1009 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
980 | 1010 | |
---|
981 | | - //Return(); |
---|
| 1011 | + oe.ctrlPanel.add(commandsPanel); |
---|
| 1012 | + oe.ctrlPanel.Return(); |
---|
982 | 1013 | |
---|
983 | | - //normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
| 1014 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1); |
---|
| 1015 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
984 | 1016 | //Return(); |
---|
| 1017 | + |
---|
| 1018 | + oe.ctrlPanel.Return(); |
---|
985 | 1019 | |
---|
986 | 1020 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
987 | 1021 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1076 | 1110 | oe.aConstraints.gridwidth = 1; |
---|
1077 | 1111 | /**/ |
---|
1078 | 1112 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1079 | | - Return(); |
---|
| 1113 | + oe.ctrlPanel.Return(); |
---|
1080 | 1114 | |
---|
1081 | 1115 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1082 | 1116 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1253 | 1287 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1254 | 1288 | //tmp.setName("Edit"); |
---|
1255 | 1289 | objectPanel.add(materialPanel); |
---|
1256 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1257 | | - north.setName("Edit"); |
---|
1258 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1259 | | - objectPanel.add(north); |
---|
| 1290 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1291 | +// north.setName("Edit"); |
---|
| 1292 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1293 | +// objectPanel.add(north); |
---|
| 1294 | + objectPanel.add(ctrlPanel); |
---|
1260 | 1295 | objectPanel.add(infoPanel); |
---|
1261 | 1296 | |
---|
1262 | 1297 | /* |
---|
.. | .. |
---|
1415 | 1450 | ctrlPanel.removeAll(); |
---|
1416 | 1451 | } |
---|
1417 | 1452 | |
---|
1418 | | - void SetupMaterial(cGridBag ctrlPanel) |
---|
| 1453 | + void SetupMaterial(cGridBag panel) |
---|
1419 | 1454 | { |
---|
1420 | 1455 | /* |
---|
1421 | 1456 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
.. | .. |
---|
1424 | 1459 | |
---|
1425 | 1460 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
1426 | 1461 | |
---|
1427 | | - editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints); |
---|
| 1462 | + editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1463 | + createMaterialButton.setToolTipText("Create material"); |
---|
1428 | 1464 | |
---|
1429 | 1465 | /* |
---|
1430 | 1466 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1431 | 1467 | */ |
---|
1432 | 1468 | |
---|
1433 | | - editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints); |
---|
1434 | | - editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints); |
---|
| 1469 | + editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1470 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1471 | + |
---|
| 1472 | + editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
1435 | 1473 | editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
1436 | 1474 | editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
1437 | 1475 | |
---|
1438 | | - ctrlPanel.add(editBar); |
---|
| 1476 | + editBar.preferredHeight = 15; |
---|
| 1477 | + |
---|
| 1478 | + panel.add(editBar); |
---|
1439 | 1479 | |
---|
1440 | 1480 | /**/ |
---|
1441 | 1481 | //aConstraints.weighty = 0; |
---|
.. | .. |
---|
1484 | 1524 | shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1485 | 1525 | colorSection.add(shadowbias); |
---|
1486 | 1526 | |
---|
1487 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1527 | + panel.add(new JSeparator()); |
---|
1488 | 1528 | |
---|
1489 | | - ctrlPanel.add(colorSection); |
---|
| 1529 | + panel.add(colorSection); |
---|
1490 | 1530 | |
---|
1491 | 1531 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1492 | 1532 | |
---|
.. | .. |
---|
1534 | 1574 | fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1535 | 1575 | diffuseSection.add(fakedepth); |
---|
1536 | 1576 | |
---|
1537 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1577 | + panel.add(new JSeparator()); |
---|
1538 | 1578 | |
---|
1539 | | - ctrlPanel.add(diffuseSection); |
---|
| 1579 | + panel.add(diffuseSection); |
---|
1540 | 1580 | |
---|
1541 | 1581 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1542 | 1582 | |
---|
.. | .. |
---|
1572 | 1612 | velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
1573 | 1613 | specularSection.add(velvet); |
---|
1574 | 1614 | |
---|
1575 | | - shiftField = AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
| 1615 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
1576 | 1616 | //Return(); |
---|
1577 | 1617 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1578 | 1618 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
.. | .. |
---|
1585 | 1625 | // aConstraints.gridwidth = 1; |
---|
1586 | 1626 | |
---|
1587 | 1627 | |
---|
1588 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1628 | + panel.add(new JSeparator()); |
---|
1589 | 1629 | |
---|
1590 | | - ctrlPanel.add(specularSection); |
---|
| 1630 | + panel.add(specularSection); |
---|
1591 | 1631 | |
---|
1592 | 1632 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1593 | 1633 | |
---|
.. | .. |
---|
1617 | 1657 | opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
1618 | 1658 | globalSection.add(opacity); |
---|
1619 | 1659 | |
---|
1620 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1660 | + panel.add(new JSeparator()); |
---|
1621 | 1661 | |
---|
1622 | | - ctrlPanel.add(globalSection); |
---|
| 1662 | + panel.add(globalSection); |
---|
1623 | 1663 | |
---|
1624 | 1664 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1625 | 1665 | |
---|
.. | .. |
---|
1661 | 1701 | opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
1662 | 1702 | textureSection.add(opacityPower); |
---|
1663 | 1703 | |
---|
1664 | | - ctrlPanel.add(new JSeparator()); |
---|
| 1704 | + panel.add(new JSeparator()); |
---|
1665 | 1705 | |
---|
1666 | | - ctrlPanel.add(textureSection); |
---|
| 1706 | + panel.add(textureSection); |
---|
1667 | 1707 | |
---|
1668 | 1708 | //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1669 | 1709 | |
---|
.. | .. |
---|
2482 | 2522 | } |
---|
2483 | 2523 | if (input == null) |
---|
2484 | 2524 | { |
---|
| 2525 | + new Exception().printStackTrace(); |
---|
2485 | 2526 | System.exit(0); |
---|
2486 | 2527 | } |
---|
2487 | 2528 | |
---|
.. | .. |
---|
2956 | 2997 | if (event.getSource() == randomCB) |
---|
2957 | 2998 | { |
---|
2958 | 2999 | copy.random ^= true; |
---|
| 3000 | + objEditor.refreshContents(); |
---|
2959 | 3001 | return; |
---|
2960 | 3002 | } |
---|
2961 | 3003 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3179 | 3221 | if (!Globals.ANIMATION) |
---|
3180 | 3222 | { |
---|
3181 | 3223 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3182 | | - browser.show(); |
---|
| 3224 | + browser.setVisible(true); |
---|
3183 | 3225 | String filename = browser.getFile(); |
---|
3184 | 3226 | if (filename != null && filename.length() > 0) |
---|
3185 | 3227 | { |
---|
.. | .. |
---|
3211 | 3253 | callee.refreshContents(); |
---|
3212 | 3254 | } else |
---|
3213 | 3255 | { |
---|
| 3256 | + new Exception().printStackTrace(); |
---|
3214 | 3257 | System.exit(0); |
---|
3215 | 3258 | } |
---|
3216 | 3259 | } |
---|
.. | .. |
---|
3421 | 3464 | || e.getSource() == apertureField |
---|
3422 | 3465 | || e.getSource() == shadowblurField) |
---|
3423 | 3466 | { |
---|
| 3467 | + new Exception().printStackTrace(); |
---|
3424 | 3468 | System.exit(0); |
---|
3425 | 3469 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3426 | 3470 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
4392 | 4436 | //MenuItem normalLensItem; |
---|
4393 | 4437 | MenuItem editCameraItem; |
---|
4394 | 4438 | MenuItem revertCameraItem; |
---|
4395 | | - CheckboxMenuItem toggleLiveItem; |
---|
4396 | 4439 | MenuItem stepItem; |
---|
| 4440 | + CheckboxMenuItem toggleLiveItem; |
---|
4397 | 4441 | CheckboxMenuItem toggleFullScreenItem; |
---|
4398 | 4442 | CheckboxMenuItem toggleTimelineItem; |
---|
4399 | 4443 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4410 | 4454 | JSplitPane mainPanel; |
---|
4411 | 4455 | JScrollPane scrollpane; |
---|
4412 | 4456 | JPanel toolbarPanel; |
---|
4413 | | - JPanel treePanel; |
---|
| 4457 | + cGridBag treePanel; |
---|
4414 | 4458 | JPanel radioPanel; |
---|
4415 | 4459 | ButtonGroup buttonGroup; |
---|
4416 | 4460 | cGridBag ctrlPanel; |
---|