.. | .. |
---|
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, |
---|
.. | .. |
---|
124 | 126 | void keyPressed(int key, int modifiers) |
---|
125 | 127 | { |
---|
126 | 128 | System.out.println("KEY PRESSED"); |
---|
127 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 129 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
128 | 130 | } |
---|
129 | 131 | */ |
---|
130 | 132 | |
---|
.. | .. |
---|
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); |
---|
| 145 | + |
---|
| 146 | + objEditor.ctrlPanel.remove(namePanel); |
---|
143 | 147 | |
---|
144 | 148 | if (!GroupEditor.allparams) |
---|
145 | 149 | return; |
---|
146 | 150 | |
---|
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); |
---|
| 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); |
---|
165 | 169 | |
---|
166 | | - 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); |
---|
167 | 176 | } |
---|
168 | 177 | |
---|
169 | 178 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
300 | 309 | //normalLensItem.addActionListener(this); |
---|
301 | 310 | cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
302 | 311 | revertCameraItem.addActionListener(this); |
---|
303 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
304 | | - toggleTimelineItem.addItemListener(this); |
---|
| 312 | + |
---|
305 | 313 | cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
306 | 314 | toggleFullScreenItem.addItemListener(this); |
---|
307 | 315 | toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
308 | 316 | cameraMenu.add("-"); |
---|
| 317 | + |
---|
309 | 318 | cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
310 | 319 | toggleTextureItem.addItemListener(this); |
---|
311 | 320 | toggleTextureItem.setState(CameraPane.textureon); |
---|
312 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
313 | | - toggleLiveItem.addItemListener(this); |
---|
314 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
315 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
316 | | - stepItem.addActionListener(this); |
---|
317 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
318 | | -// toggleDLItem.addItemListener(this); |
---|
319 | | -// toggleDLItem.setState(false); |
---|
320 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
321 | | - toggleRenderItem.addItemListener(this); |
---|
322 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
323 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
324 | | - toggleDebugItem.addItemListener(this); |
---|
325 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
326 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
327 | | - toggleFrustumItem.addItemListener(this); |
---|
328 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
329 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
330 | | - toggleFootContactItem.addItemListener(this); |
---|
331 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
332 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
333 | | - toggleRandomItem.addItemListener(this); |
---|
334 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
| 321 | + |
---|
| 322 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 323 | + toggleSwitchItem.addItemListener(this); |
---|
| 324 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 325 | + |
---|
335 | 326 | cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
336 | 327 | toggleHandleItem.addItemListener(this); |
---|
337 | 328 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 329 | + |
---|
338 | 330 | cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
339 | 331 | togglePaintItem.addItemListener(this); |
---|
340 | 332 | togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 333 | + |
---|
| 334 | + if (Globals.ADVANCED) |
---|
| 335 | + { |
---|
| 336 | + cameraMenu.add("-"); |
---|
| 337 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 338 | + toggleLiveItem.addItemListener(this); |
---|
| 339 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 340 | + |
---|
| 341 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 342 | + stepItem.addActionListener(this); |
---|
| 343 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 344 | + // toggleDLItem.addItemListener(this); |
---|
| 345 | + // toggleDLItem.setState(false); |
---|
| 346 | + |
---|
| 347 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 348 | + toggleRenderItem.addItemListener(this); |
---|
| 349 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 350 | + |
---|
| 351 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 352 | + toggleDebugItem.addItemListener(this); |
---|
| 353 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 354 | + |
---|
| 355 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 356 | + toggleFrustumItem.addItemListener(this); |
---|
| 357 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 358 | + |
---|
| 359 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 360 | + toggleFootContactItem.addItemListener(this); |
---|
| 361 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 362 | + |
---|
| 363 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 364 | + toggleTimelineItem.addItemListener(this); |
---|
| 365 | + } |
---|
| 366 | + |
---|
341 | 367 | // cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
342 | 368 | // toggleRootItem.addItemListener(this); |
---|
343 | 369 | // toggleRootItem.setState(false); |
---|
.. | .. |
---|
351 | 377 | objectPanel = new JTabbedPane(); |
---|
352 | 378 | toolbarPanel = new JPanel(); |
---|
353 | 379 | toolbarPanel.setName("Toolbar"); |
---|
354 | | - treePanel = new JPanel(); |
---|
| 380 | + treePanel = new cGridBag(); |
---|
355 | 381 | treePanel.setName("Tree"); |
---|
356 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
| 382 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
357 | 383 | ctrlPanel.setName("Edit"); |
---|
358 | | - materialPanel = new JPanel(); |
---|
| 384 | + materialPanel = new cGridBag().setVertical(true); |
---|
359 | 385 | materialPanel.setName("Material"); |
---|
360 | 386 | /*JTextPane*/ |
---|
361 | 387 | infoarea = createTextPane(); |
---|
| 388 | + doc = infoarea.getStyledDocument(); |
---|
| 389 | + |
---|
362 | 390 | infoarea.setEditable(true); |
---|
363 | 391 | SetText(); |
---|
364 | 392 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
365 | 393 | // infoarea.setOpaque(false); |
---|
366 | 394 | // //infoarea.setForeground(textcolor); |
---|
367 | | - infoarea.setLineWrap(true); |
---|
368 | | - infoarea.setWrapStyleWord(true); |
---|
| 395 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 396 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
369 | 397 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
370 | 398 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
371 | 399 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
376 | 404 | mainPanel.setName("Main"); |
---|
377 | 405 | mainPanel.setContinuousLayout(true); |
---|
378 | 406 | mainPanel.setOneTouchExpandable(true); |
---|
379 | | - mainPanel.setDividerLocation(1.0); |
---|
380 | 407 | mainPanel.setDividerSize(9); |
---|
381 | | - mainPanel.setResizeWeight(0); |
---|
| 408 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 409 | + mainPanel.setResizeWeight(0.5); |
---|
382 | 410 | |
---|
383 | 411 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
384 | 412 | //mainPanel.setLayout(new GridBagLayout()); |
---|
385 | 413 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
386 | | - treePanel.setLayout(new GridBagLayout()); |
---|
387 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
388 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 414 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 415 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 416 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
389 | 417 | |
---|
390 | 418 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
391 | 419 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
424 | 452 | static String newline = "\n"; |
---|
425 | 453 | protected static final String buttonString = "JButton"; |
---|
426 | 454 | StyledDocument doc; |
---|
427 | | - JTextArea infoarea; |
---|
| 455 | + JTextPane infoarea; |
---|
428 | 456 | |
---|
429 | 457 | void ClearInfo() |
---|
430 | 458 | { |
---|
.. | .. |
---|
491 | 519 | } |
---|
492 | 520 | |
---|
493 | 521 | if (full) |
---|
494 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 522 | + { |
---|
| 523 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 524 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 525 | + } |
---|
495 | 526 | |
---|
496 | 527 | if (sel.bRep != null) |
---|
497 | 528 | { |
---|
.. | .. |
---|
589 | 620 | { |
---|
590 | 621 | CameraPane.pointflow = (PointFlow) sel; |
---|
591 | 622 | } |
---|
| 623 | + |
---|
| 624 | + si.SendInfo("_____________________", "regular"); |
---|
| 625 | + si.SendInfo("", "regular"); |
---|
592 | 626 | } |
---|
593 | 627 | } |
---|
594 | 628 | |
---|
.. | .. |
---|
620 | 654 | cameraView.ToggleFullScreen(); |
---|
621 | 655 | } |
---|
622 | 656 | |
---|
623 | | - private JTextArea createTextPane() |
---|
| 657 | + private JTextPane createTextPane() |
---|
624 | 658 | { |
---|
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 | | - }; |
---|
| 659 | +// TEXTAREA String[] initString = |
---|
| 660 | +// { |
---|
| 661 | +// "This is an editable JTextPane, ", //regular |
---|
| 662 | +// "another ", //italic |
---|
| 663 | +// "styled ", //bold |
---|
| 664 | +// "text ", //small |
---|
| 665 | +// "component, ", //large |
---|
| 666 | +// "which supports embedded components..." + newline,//regular |
---|
| 667 | +// " " + newline, //button |
---|
| 668 | +// "...and embedded icons..." + newline, //regular |
---|
| 669 | +// " ", //icon |
---|
| 670 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 671 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 672 | +// + "cover methods for interacting with those objects." |
---|
| 673 | +// }; |
---|
| 674 | +// |
---|
| 675 | +// String[] initStyles = |
---|
| 676 | +// { |
---|
| 677 | +// "regular", "italic", "bold", "small", "large", |
---|
| 678 | +// "regular", "button", "regular", "icon", |
---|
| 679 | +// "regular" |
---|
| 680 | +// }; |
---|
| 681 | +// |
---|
| 682 | +// JTextPane textPane = new JTextPane(); |
---|
| 683 | +// textPane.setEditable(true); |
---|
| 684 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 685 | +// addStylesToDocument(doc); |
---|
| 686 | +// |
---|
| 687 | +// try |
---|
| 688 | +// { |
---|
| 689 | +// for (int j = 0; j < 2; j++) |
---|
| 690 | +// { |
---|
| 691 | +// for (int i = 0; i < initString.length; i++) |
---|
| 692 | +// { |
---|
| 693 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 694 | +// doc.getStyle(initStyles[i])); |
---|
| 695 | +// } |
---|
| 696 | +// } |
---|
| 697 | +// } catch (BadLocationException ble) |
---|
| 698 | +// { |
---|
| 699 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 700 | +// } |
---|
640 | 701 | |
---|
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; |
---|
| 702 | + return new JTextPane(); // textPane; |
---|
669 | 703 | } |
---|
670 | 704 | |
---|
671 | 705 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
765 | 799 | JButton slowerButton; |
---|
766 | 800 | JButton fasterButton; |
---|
767 | 801 | JButton remarkButton; |
---|
| 802 | + |
---|
| 803 | + cGridBag namePanel; |
---|
| 804 | + cGridBag setupPanel; |
---|
| 805 | + cGridBag commandsPanel; |
---|
| 806 | + cGridBag pushPanel; |
---|
| 807 | + cGridBag fillPanel; |
---|
768 | 808 | |
---|
769 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 809 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
770 | 810 | { |
---|
771 | 811 | JCheckBox cb; |
---|
772 | 812 | |
---|
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); |
---|
| 813 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
778 | 814 | cb.addItemListener(this); |
---|
779 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
780 | | - oe.aConstraints.gridwidth = 1; |
---|
781 | | - oe.aConstraints.gridx += 1; |
---|
782 | 815 | |
---|
783 | 816 | return cb; |
---|
784 | 817 | } |
---|
785 | 818 | |
---|
786 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 819 | + cButton AddButton(cGridBag panel, String label) |
---|
787 | 820 | { |
---|
788 | 821 | cButton cb; |
---|
789 | 822 | |
---|
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); |
---|
| 823 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
795 | 824 | cb.addActionListener(this); |
---|
796 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
797 | | - oe.aConstraints.gridwidth = 1; |
---|
798 | | - oe.aConstraints.gridx += 1; |
---|
799 | 825 | |
---|
800 | 826 | return cb; |
---|
801 | 827 | } |
---|
802 | 828 | |
---|
803 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 829 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
804 | 830 | { |
---|
805 | 831 | JComboBox combo; |
---|
806 | 832 | |
---|
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; |
---|
| 833 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
810 | 834 | combo.addActionListener(this); |
---|
811 | 835 | |
---|
812 | 836 | return combo; |
---|
813 | 837 | } |
---|
814 | 838 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 839 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
816 | 840 | { |
---|
817 | | - NumberSlider combo; |
---|
| 841 | + cGridBag control = new cGridBag(); |
---|
| 842 | + |
---|
| 843 | + cNumberSlider combo; |
---|
818 | 844 | |
---|
819 | 845 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 846 | 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 | | - |
---|
| 847 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 848 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 849 | combo.setFloat(current); |
---|
833 | | - |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 850 | + |
---|
| 851 | + panel.add(control); |
---|
| 852 | + |
---|
| 853 | + return control; |
---|
839 | 854 | } |
---|
840 | 855 | |
---|
841 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 856 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
842 | 857 | { |
---|
843 | | - NumberSlider combo; |
---|
| 858 | + cGridBag control = new cGridBag(); |
---|
| 859 | + |
---|
| 860 | + cNumberSlider combo; |
---|
844 | 861 | |
---|
845 | 862 | JLabel jlabel = new JLabel(label); |
---|
846 | | - |
---|
847 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
848 | 863 | 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 | | - |
---|
| 864 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 865 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
858 | 866 | combo.setInteger(current); |
---|
859 | 867 | |
---|
860 | | - combo.label = jlabel; |
---|
861 | | - |
---|
862 | | - combo.addChangeListener(this); |
---|
863 | | - |
---|
864 | | - return combo; |
---|
| 868 | + panel.add(control); |
---|
| 869 | + |
---|
| 870 | + return control; |
---|
865 | 871 | } |
---|
866 | 872 | |
---|
867 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 873 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
868 | 874 | { |
---|
869 | 875 | JTextArea text; |
---|
870 | 876 | |
---|
871 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
872 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
873 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 877 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
874 | 878 | text.addCaretListener(this); |
---|
875 | | - aConstraints.gridx += 1; |
---|
876 | | - aConstraints.gridwidth = 1; |
---|
877 | 879 | |
---|
878 | 880 | return text; |
---|
879 | 881 | } |
---|
.. | .. |
---|
903 | 905 | objEditor.ctrlPanel.remove(j); |
---|
904 | 906 | } |
---|
905 | 907 | |
---|
| 908 | + void Remove(cNumberSlider j) |
---|
| 909 | + { |
---|
| 910 | + j.removeChangeListener(this); |
---|
| 911 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 912 | + objEditor.ctrlPanel.remove(j); |
---|
| 913 | + } |
---|
| 914 | + |
---|
906 | 915 | /* |
---|
907 | 916 | */ |
---|
908 | | - void Return() // ObjEditor oe) |
---|
| 917 | + void Return0() // ObjEditor oe) |
---|
909 | 918 | { |
---|
910 | 919 | aConstraints.gridy += 1; |
---|
911 | 920 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
960 | 969 | |
---|
961 | 970 | void SetupUI2(ObjEditor oe) |
---|
962 | 971 | { |
---|
963 | | -// oe.aConstraints.weightx = 0; |
---|
964 | | -// oe.aConstraints.weighty = 0; |
---|
965 | | -// oe.aConstraints.gridx = 0; |
---|
966 | | -// oe.aConstraints.gridy = 0; |
---|
967 | | - SetupName(oe); |
---|
| 972 | + //SetupName(oe); |
---|
| 973 | + |
---|
| 974 | + namePanel = new cGridBag(); |
---|
| 975 | + |
---|
| 976 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 977 | + namePanel.add(nameField); |
---|
| 978 | + oe.ctrlPanel.add(namePanel); |
---|
| 979 | + |
---|
| 980 | + oe.ctrlPanel.Return(); |
---|
968 | 981 | |
---|
969 | 982 | if (!GroupEditor.allparams) |
---|
970 | 983 | return; |
---|
971 | 984 | |
---|
972 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
973 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
974 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 985 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 986 | + |
---|
| 987 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 988 | + liveCB.setToolTipText("Animate object"); |
---|
| 989 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 990 | + hideCB.setToolTipText("Hide object"); |
---|
975 | 991 | // 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"); |
---|
| 992 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 993 | + markCB.setToolTipText("Set the animation target transform"); |
---|
| 994 | + |
---|
| 995 | + rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 996 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 997 | + |
---|
| 998 | + randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
| 999 | + randomCB.setToolTipText("Option for switch node"); |
---|
| 1000 | + |
---|
| 1001 | + if (Globals.ADVANCED) |
---|
| 1002 | + { |
---|
| 1003 | + link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
| 1004 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1005 | + speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 1006 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1007 | + } |
---|
| 1008 | + |
---|
| 1009 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1010 | + oe.ctrlPanel.Return(); |
---|
| 1011 | + |
---|
| 1012 | + commandsPanel = new cGridBag().setVertical(false); |
---|
| 1013 | + |
---|
| 1014 | + resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 1015 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1016 | + stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1017 | + stepButton.setToolTipText("Step one frame"); |
---|
982 | 1018 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
983 | 1019 | // stepAllButton = AddButton(oe, "Step All"); |
---|
984 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
985 | 1020 | // Return(); |
---|
986 | | - slowerButton = AddButton(oe, "Slow"); |
---|
987 | | - fasterButton = AddButton(oe, "Fast"); |
---|
988 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1021 | + slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 1022 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1023 | + fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 1024 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1025 | + remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1026 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
989 | 1027 | |
---|
990 | | - Return(); |
---|
| 1028 | + oe.ctrlPanel.add(commandsPanel); |
---|
| 1029 | + oe.ctrlPanel.Return(); |
---|
991 | 1030 | |
---|
992 | | - normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
993 | | - Return(); |
---|
| 1031 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1); |
---|
| 1032 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1033 | + //Return(); |
---|
| 1034 | + |
---|
| 1035 | + oe.ctrlPanel.Return(); |
---|
994 | 1036 | |
---|
995 | 1037 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
996 | 1038 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1085 | 1127 | oe.aConstraints.gridwidth = 1; |
---|
1086 | 1128 | /**/ |
---|
1087 | 1129 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1088 | | - Return(); |
---|
| 1130 | + oe.ctrlPanel.Return(); |
---|
1089 | 1131 | |
---|
1090 | 1132 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1091 | 1133 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1187 | 1229 | //JPanel worldPanel = |
---|
1188 | 1230 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1189 | 1231 | //worldPanel.setName("World"); |
---|
1190 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
| 1232 | + centralPanel = new cGridBag(); |
---|
| 1233 | + centralPanel.preferredWidth = 20; |
---|
1191 | 1234 | timelinePanel = new JPanel(new BorderLayout()); |
---|
1192 | 1235 | timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1193 | 1236 | |
---|
.. | .. |
---|
1217 | 1260 | //frontView.object = copy; |
---|
1218 | 1261 | //sideView.object = copy; |
---|
1219 | 1262 | |
---|
1220 | | - XYZPanel = new JPanel(); |
---|
1221 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1263 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1264 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1222 | 1265 | |
---|
1223 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1224 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1225 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1266 | + XYZPanel.preferredWidth = 5; |
---|
| 1267 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1268 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1269 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1226 | 1270 | |
---|
1227 | 1271 | /* |
---|
1228 | 1272 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1260 | 1304 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1261 | 1305 | //tmp.setName("Edit"); |
---|
1262 | 1306 | objectPanel.add(materialPanel); |
---|
1263 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1264 | | - north.setName("Edit"); |
---|
1265 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1266 | | - objectPanel.add(north); |
---|
| 1307 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1308 | +// north.setName("Edit"); |
---|
| 1309 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1310 | +// objectPanel.add(north); |
---|
| 1311 | + objectPanel.add(ctrlPanel); |
---|
1267 | 1312 | objectPanel.add(infoPanel); |
---|
1268 | 1313 | |
---|
1269 | 1314 | /* |
---|
.. | .. |
---|
1284 | 1329 | scrollpane.setWheelScrollingEnabled(true); |
---|
1285 | 1330 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1286 | 1331 | |
---|
1287 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1288 | | - scenePanel.add(scrollpane); |
---|
| 1332 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1333 | + scenePanel.preferredWidth = 6; |
---|
| 1334 | + |
---|
| 1335 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1336 | + tabbedPane.add(scrollpane); |
---|
1289 | 1337 | |
---|
1290 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
| 1338 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1291 | 1339 | |
---|
1292 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1340 | + optionsPanel = new cGridBag().setVertical(true); |
---|
1293 | 1341 | |
---|
1294 | 1342 | optionsPanel.setName("Options"); |
---|
1295 | | - scenePanel.add(optionsPanel); |
---|
1296 | | - |
---|
| 1343 | + |
---|
| 1344 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1345 | + |
---|
| 1346 | + tabbedPane.add(optionsPanel); |
---|
| 1347 | + |
---|
| 1348 | + scenePanel.add(tabbedPane); |
---|
1297 | 1349 | |
---|
1298 | 1350 | /* |
---|
1299 | 1351 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1327 | 1379 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1328 | 1380 | //bigPanel.add(ctrlPanel); |
---|
1329 | 1381 | //bigPanel.add(gridPanel); |
---|
| 1382 | + /** |
---|
1330 | 1383 | bigThree = new JPanel(); |
---|
1331 | 1384 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1332 | 1385 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1350 | 1403 | // aConstraints.gridheight = 3; |
---|
1351 | 1404 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1352 | 1405 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1406 | + /**/ |
---|
1353 | 1407 | |
---|
| 1408 | + bigThree = new cGridBag(); |
---|
| 1409 | + bigThree.addComponent(scenePanel); |
---|
| 1410 | + bigThree.addComponent(centralPanel); |
---|
| 1411 | + bigThree.addComponent(XYZPanel); |
---|
| 1412 | + |
---|
1354 | 1413 | // // SIDE EFFECT!!! |
---|
1355 | 1414 | // aConstraints.gridx = 0; |
---|
1356 | 1415 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1377 | 1436 | |
---|
1378 | 1437 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1379 | 1438 | |
---|
1380 | | - frame.setSize(1024, 768); |
---|
1381 | | - frame.show(); |
---|
| 1439 | + frame.setSize(1280, 860); |
---|
| 1440 | + frame.setVisible(true); |
---|
1382 | 1441 | |
---|
1383 | 1442 | gridPanel.setDividerLocation(1.0); |
---|
1384 | 1443 | |
---|
.. | .. |
---|
1393 | 1452 | }); |
---|
1394 | 1453 | } |
---|
1395 | 1454 | |
---|
| 1455 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1456 | + { |
---|
| 1457 | + } |
---|
| 1458 | + |
---|
1396 | 1459 | JTree GetTree() |
---|
1397 | 1460 | { |
---|
1398 | 1461 | return objEditor.jTree; |
---|
.. | .. |
---|
1404 | 1467 | ctrlPanel.removeAll(); |
---|
1405 | 1468 | } |
---|
1406 | 1469 | |
---|
1407 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1470 | + void SetupMaterial(cGridBag panel) |
---|
1408 | 1471 | { |
---|
1409 | | - aConstraints.weighty = 0; |
---|
1410 | | - //aConstraints.weightx = 1; |
---|
1411 | | - /* |
---|
| 1472 | + /* |
---|
1412 | 1473 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1413 | 1474 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1414 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1415 | | - aConstraints.gridx += 1; |
---|
1416 | 1475 | */ |
---|
1417 | 1476 | |
---|
1418 | | - aConstraints.gridwidth = 1; |
---|
1419 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1420 | | - aConstraints.gridx += 1; |
---|
1421 | | - aConstraints.weighty = 0; |
---|
1422 | | - aConstraints.gridwidth = 1; |
---|
| 1477 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 1478 | + |
---|
| 1479 | + editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1480 | + createMaterialButton.setToolTipText("Create material"); |
---|
1423 | 1481 | |
---|
1424 | 1482 | /* |
---|
1425 | 1483 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1426 | | - aConstraints.gridx += 1; |
---|
1427 | | - aConstraints.weighty = 0; |
---|
1428 | | - aConstraints.gridwidth = 1; |
---|
1429 | 1484 | */ |
---|
1430 | 1485 | |
---|
1431 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1432 | | - aConstraints.gridx += 1; |
---|
| 1486 | + editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1487 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1488 | + |
---|
| 1489 | + if (Globals.ADVANCED) |
---|
| 1490 | + { |
---|
| 1491 | + editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1492 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1493 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1494 | + } |
---|
1433 | 1495 | |
---|
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; |
---|
| 1496 | + editBar.preferredHeight = 15; |
---|
| 1497 | + |
---|
| 1498 | + panel.add(editBar); |
---|
| 1499 | + |
---|
1448 | 1500 | /**/ |
---|
1449 | 1501 | //aConstraints.weighty = 0; |
---|
1450 | 1502 | ////aConstraints.weightx = 1; |
---|
1451 | 1503 | //aConstraints.weighty = 1; |
---|
1452 | 1504 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1453 | 1505 | //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; |
---|
| 1506 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1459 | 1507 | |
---|
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; |
---|
| 1508 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1509 | + |
---|
| 1510 | + cGridBag color = new cGridBag(); |
---|
| 1511 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1512 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1513 | + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1514 | + //colorField.preferredWidth = 200; |
---|
| 1515 | + colorSection.add(color); |
---|
1470 | 1516 | |
---|
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; |
---|
| 1517 | + cGridBag modulation = new cGridBag(); |
---|
| 1518 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 1519 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1520 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1521 | + colorSection.add(modulation); |
---|
1480 | 1522 | |
---|
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; |
---|
| 1523 | + cGridBag texture = new cGridBag(); |
---|
| 1524 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 1525 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1526 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1527 | + colorSection.add(texture); |
---|
1490 | 1528 | |
---|
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; |
---|
| 1529 | + cGridBag anisoU = new cGridBag(); |
---|
| 1530 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1531 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1532 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1533 | + colorSection.add(anisoU); |
---|
1500 | 1534 | |
---|
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; |
---|
| 1535 | + cGridBag anisoV = new cGridBag(); |
---|
| 1536 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1537 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1538 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1539 | + colorSection.add(anisoV); |
---|
1510 | 1540 | |
---|
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; |
---|
| 1541 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1542 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1543 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1544 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1545 | + colorSection.add(shadowbias); |
---|
1520 | 1546 | |
---|
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; |
---|
| 1547 | + panel.add(new JSeparator()); |
---|
| 1548 | + |
---|
| 1549 | + panel.add(colorSection); |
---|
| 1550 | + |
---|
| 1551 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1552 | + |
---|
| 1553 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 1554 | + |
---|
| 1555 | + cGridBag diffuse = new cGridBag(); |
---|
| 1556 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 1557 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1558 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1559 | + diffuseSection.add(diffuse); |
---|
1529 | 1560 | |
---|
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; |
---|
| 1561 | + cGridBag diffuseness = new cGridBag(); |
---|
| 1562 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 1563 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1564 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1565 | + diffuseSection.add(diffuseness); |
---|
1539 | 1566 | |
---|
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; |
---|
| 1567 | + cGridBag selfshadow = new cGridBag(); |
---|
| 1568 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 1569 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1570 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1571 | + diffuseSection.add(selfshadow); |
---|
1549 | 1572 | |
---|
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; |
---|
| 1573 | + cGridBag sheen = new cGridBag(); |
---|
| 1574 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 1575 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1576 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1577 | + diffuseSection.add(sheen); |
---|
1559 | 1578 | |
---|
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; |
---|
| 1579 | + cGridBag subsurface = new cGridBag(); |
---|
| 1580 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 1581 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1582 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1583 | + diffuseSection.add(subsurface); |
---|
1569 | 1584 | |
---|
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; |
---|
| 1585 | + cGridBag shadow = new cGridBag(); |
---|
| 1586 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 1587 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1588 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1589 | + diffuseSection.add(shadow); |
---|
1579 | 1590 | |
---|
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; |
---|
| 1591 | + cGridBag fakedepth = new cGridBag(); |
---|
| 1592 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 1593 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1594 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1595 | + diffuseSection.add(fakedepth); |
---|
1589 | 1596 | |
---|
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; |
---|
| 1597 | + panel.add(new JSeparator()); |
---|
| 1598 | + |
---|
| 1599 | + panel.add(diffuseSection); |
---|
| 1600 | + |
---|
| 1601 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1602 | + |
---|
| 1603 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1599 | 1604 | |
---|
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; |
---|
| 1605 | + cGridBag specular = new cGridBag(); |
---|
| 1606 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 1607 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1608 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1609 | + specularSection.add(specular); |
---|
1608 | 1610 | |
---|
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; |
---|
| 1611 | + cGridBag lightarea = new cGridBag(); |
---|
| 1612 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 1613 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1614 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1615 | + specularSection.add(lightarea); |
---|
1618 | 1616 | |
---|
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; |
---|
| 1617 | + cGridBag shininess = new cGridBag(); |
---|
| 1618 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 1619 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1620 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1621 | + specularSection.add(shininess); |
---|
1628 | 1622 | |
---|
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; |
---|
| 1623 | + cGridBag metalness = new cGridBag(); |
---|
| 1624 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 1625 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1626 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1627 | + specularSection.add(metalness); |
---|
1638 | 1628 | |
---|
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; |
---|
| 1629 | + cGridBag velvet = new cGridBag(); |
---|
| 1630 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 1631 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1632 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1633 | + specularSection.add(velvet); |
---|
1648 | 1634 | |
---|
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(); |
---|
| 1635 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1636 | + //Return(); |
---|
1661 | 1637 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1662 | 1638 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1663 | 1639 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1668 | 1644 | // aConstraints.gridy += 1; |
---|
1669 | 1645 | // aConstraints.gridwidth = 1; |
---|
1670 | 1646 | |
---|
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 | 1647 | |
---|
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; |
---|
| 1648 | + panel.add(new JSeparator()); |
---|
| 1649 | + |
---|
| 1650 | + panel.add(specularSection); |
---|
| 1651 | + |
---|
| 1652 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1653 | + |
---|
| 1654 | + cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1689 | 1655 | |
---|
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; |
---|
| 1656 | + cGridBag camera = new cGridBag(); |
---|
| 1657 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 1658 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1659 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1660 | + globalSection.add(camera); |
---|
1699 | 1661 | |
---|
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; |
---|
| 1662 | + cGridBag ambient = new cGridBag(); |
---|
| 1663 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 1664 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1665 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1666 | + globalSection.add(ambient); |
---|
1709 | 1667 | |
---|
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; |
---|
| 1668 | + cGridBag backlit = new cGridBag(); |
---|
| 1669 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 1670 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1671 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1672 | + globalSection.add(backlit); |
---|
1720 | 1673 | |
---|
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; |
---|
| 1674 | + cGridBag opacity = new cGridBag(); |
---|
| 1675 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1676 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1677 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1678 | + globalSection.add(opacity); |
---|
1730 | 1679 | |
---|
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; |
---|
| 1680 | + panel.add(new JSeparator()); |
---|
| 1681 | + |
---|
| 1682 | + panel.add(globalSection); |
---|
| 1683 | + |
---|
| 1684 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1685 | + |
---|
| 1686 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1740 | 1687 | |
---|
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; |
---|
| 1688 | + cGridBag bump = new cGridBag(); |
---|
| 1689 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 1690 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1691 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1692 | + textureSection.add(bump); |
---|
1750 | 1693 | |
---|
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; |
---|
| 1694 | + cGridBag noise = new cGridBag(); |
---|
| 1695 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 1696 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1697 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 1698 | + textureSection.add(noise); |
---|
1760 | 1699 | |
---|
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; |
---|
| 1700 | + cGridBag power = new cGridBag(); |
---|
| 1701 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 1702 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1703 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 1704 | + textureSection.add(power); |
---|
1770 | 1705 | |
---|
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; |
---|
| 1706 | + cGridBag borderfade = new cGridBag(); |
---|
| 1707 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 1708 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1709 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1710 | + textureSection.add(borderfade); |
---|
1780 | 1711 | |
---|
1781 | | - //aConstraints.weighty = 1; |
---|
1782 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1783 | | - //aConstraints.gridx += 1; |
---|
1784 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1785 | | - aConstraints.weighty = 0; |
---|
| 1712 | + cGridBag fog = new cGridBag(); |
---|
| 1713 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 1714 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1715 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 1716 | + textureSection.add(fog); |
---|
1786 | 1717 | |
---|
1787 | | - aConstraints.gridx = 0; |
---|
1788 | | - aConstraints.gridy = 0; |
---|
1789 | | - aConstraints.gridwidth = 1; |
---|
| 1718 | + cGridBag opacityPower = new cGridBag(); |
---|
| 1719 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 1720 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1721 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 1722 | + textureSection.add(opacityPower); |
---|
| 1723 | + |
---|
| 1724 | + panel.add(new JSeparator()); |
---|
| 1725 | + |
---|
| 1726 | + panel.add(textureSection); |
---|
| 1727 | + |
---|
| 1728 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1790 | 1729 | |
---|
1791 | 1730 | SetMaterial(copy); // .GetMaterial()); |
---|
1792 | 1731 | |
---|
1793 | | - colorField.addChangeListener(this); |
---|
1794 | | - modulationField.addChangeListener(this); |
---|
| 1732 | + //colorField.addChangeListener(this); |
---|
| 1733 | +// modulationField.addChangeListener(this); |
---|
1795 | 1734 | metalnessField.addChangeListener(this); |
---|
1796 | 1735 | diffuseField.addChangeListener(this); |
---|
1797 | 1736 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1821 | 1760 | opacityPowerField.addChangeListener(this); |
---|
1822 | 1761 | /**/ |
---|
1823 | 1762 | |
---|
1824 | | - resetSlidersButton.addActionListener(this); |
---|
1825 | 1763 | clearMaterialButton.addActionListener(this); |
---|
1826 | 1764 | createMaterialButton.addActionListener(this); |
---|
1827 | | - |
---|
1828 | | - propagateToggle.addItemListener(this); |
---|
1829 | | - multiplyToggle.addItemListener(this); |
---|
| 1765 | + |
---|
| 1766 | + if (Globals.ADVANCED) |
---|
| 1767 | + { |
---|
| 1768 | + resetSlidersButton.addActionListener(this); |
---|
| 1769 | + propagateToggle.addItemListener(this); |
---|
| 1770 | + multiplyToggle.addItemListener(this); |
---|
| 1771 | + } |
---|
1830 | 1772 | } |
---|
1831 | 1773 | |
---|
1832 | 1774 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1997 | 1939 | |
---|
1998 | 1940 | //? flashIt = false; |
---|
1999 | 1941 | CameraPane pane = (CameraPane) cameraView; |
---|
2000 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 1942 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
2001 | 1943 | pane.clickEnd(location.x, location.y, 0, true); |
---|
2002 | 1944 | |
---|
2003 | 1945 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2458 | 2400 | { |
---|
2459 | 2401 | /**/ |
---|
2460 | 2402 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2461 | | - browser.show(); |
---|
| 2403 | + browser.setVisible(true); |
---|
2462 | 2404 | String filename = browser.getFile(); |
---|
2463 | 2405 | if (filename != null && filename.length() > 0) |
---|
2464 | 2406 | { |
---|
.. | .. |
---|
2603 | 2545 | } |
---|
2604 | 2546 | if (input == null) |
---|
2605 | 2547 | { |
---|
| 2548 | + new Exception().printStackTrace(); |
---|
2606 | 2549 | System.exit(0); |
---|
2607 | 2550 | } |
---|
2608 | 2551 | |
---|
.. | .. |
---|
2817 | 2760 | return; |
---|
2818 | 2761 | } |
---|
2819 | 2762 | |
---|
2820 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2763 | + if (multiplyToggle != null) |
---|
| 2764 | + multiplyToggle.setSelected(mat.multiply); |
---|
2821 | 2765 | |
---|
2822 | 2766 | assert (object.projectedVertices != null); |
---|
2823 | 2767 | |
---|
.. | .. |
---|
3032 | 2976 | frame.validate(); |
---|
3033 | 2977 | |
---|
3034 | 2978 | return; |
---|
3035 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 2979 | + } else if (event.getSource() == toggleSwitchItem) |
---|
3036 | 2980 | { |
---|
3037 | 2981 | cameraView.ToggleRandom(); |
---|
3038 | 2982 | cameraView.repaint(); |
---|
.. | .. |
---|
3077 | 3021 | if (event.getSource() == randomCB) |
---|
3078 | 3022 | { |
---|
3079 | 3023 | copy.random ^= true; |
---|
| 3024 | + objEditor.refreshContents(); |
---|
3080 | 3025 | return; |
---|
3081 | 3026 | } |
---|
3082 | 3027 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3139 | 3084 | objEditor.refreshContents(); |
---|
3140 | 3085 | } else if (event.getSource() == stepItem) |
---|
3141 | 3086 | { |
---|
3142 | | - cameraView.ONESTEP = true; |
---|
| 3087 | + //cameraView.ONESTEP = true; |
---|
| 3088 | + Globals.ONESTEP = true; |
---|
3143 | 3089 | cameraView.repaint(); |
---|
3144 | 3090 | return; |
---|
3145 | 3091 | } else if (event.getSource() == stepButton) |
---|
.. | .. |
---|
3296 | 3242 | |
---|
3297 | 3243 | void ToggleAnimation() |
---|
3298 | 3244 | { |
---|
3299 | | - if (!CameraPane.ANIMATION) |
---|
| 3245 | + if (!Globals.ANIMATION) |
---|
3300 | 3246 | { |
---|
3301 | 3247 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3302 | | - browser.show(); |
---|
| 3248 | + browser.setVisible(true); |
---|
3303 | 3249 | String filename = browser.getFile(); |
---|
3304 | 3250 | if (filename != null && filename.length() > 0) |
---|
3305 | 3251 | { |
---|
3306 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3252 | + Globals.filename = browser.getDirectory() + filename; |
---|
3307 | 3253 | //CameraPane.framecount = 0; |
---|
3308 | | - CameraPane.imagecount = 0; |
---|
| 3254 | + Globals.imagecount = 0; |
---|
3309 | 3255 | |
---|
3310 | | - CameraPane.ANIMATION ^= true; |
---|
| 3256 | + Globals.ANIMATION ^= true; |
---|
3311 | 3257 | |
---|
3312 | 3258 | GrafreeD.wav.cursor = 0; |
---|
3313 | 3259 | GrafreeD.wav.loop = 0; |
---|
3314 | 3260 | } |
---|
3315 | 3261 | } else |
---|
3316 | 3262 | { |
---|
3317 | | - CameraPane.ANIMATION ^= true; |
---|
| 3263 | + Globals.ANIMATION ^= true; |
---|
3318 | 3264 | } |
---|
3319 | 3265 | } |
---|
3320 | 3266 | |
---|
.. | .. |
---|
3360 | 3306 | void CreateMaterial() |
---|
3361 | 3307 | { |
---|
3362 | 3308 | //copy.ClearMaterial(); // PATCH |
---|
3363 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3309 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3364 | 3310 | if (copy.selection.size() > 0) |
---|
3365 | 3311 | //SetMaterial(copy); |
---|
3366 | 3312 | { |
---|
.. | .. |
---|
3419 | 3365 | { |
---|
3420 | 3366 | copy.ResetBlockLoop(); // temporary problem |
---|
3421 | 3367 | |
---|
3422 | | - boolean random = CameraPane.RANDOM; |
---|
3423 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3368 | + boolean random = CameraPane.SWITCH; |
---|
| 3369 | + CameraPane.SWITCH = false; // parse everything |
---|
3424 | 3370 | copy.ResetDisplayList(); |
---|
3425 | 3371 | copy.HardTouch(); |
---|
3426 | | - CameraPane.RANDOM = random; |
---|
| 3372 | + CameraPane.SWITCH = random; |
---|
3427 | 3373 | } |
---|
3428 | 3374 | |
---|
3429 | 3375 | // public void applySelf() |
---|
.. | .. |
---|
3493 | 3439 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3494 | 3440 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3495 | 3441 | |
---|
3496 | | - if (!NumberSlider.frozen) |
---|
| 3442 | + if (!cNumberSlider.frozen) |
---|
3497 | 3443 | { |
---|
3498 | 3444 | //System.out.println("Propagate = " + propagate); |
---|
3499 | 3445 | copy.UpdateMaterial(anchor, current, propagate); |
---|
.. | .. |
---|
3541 | 3487 | || e.getSource() == apertureField |
---|
3542 | 3488 | || e.getSource() == shadowblurField) |
---|
3543 | 3489 | { |
---|
| 3490 | + new Exception().printStackTrace(); |
---|
3544 | 3491 | System.exit(0); |
---|
3545 | 3492 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3546 | 3493 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3866 | 3813 | |
---|
3867 | 3814 | radioPanel.revalidate(); |
---|
3868 | 3815 | radioPanel.repaint(); |
---|
3869 | | - ctrlPanel.revalidate(); // ? new |
---|
| 3816 | + ctrlPanel.validate(); // ? new |
---|
3870 | 3817 | ctrlPanel.repaint(); |
---|
3871 | 3818 | } |
---|
3872 | 3819 | } |
---|
.. | .. |
---|
4512 | 4459 | //MenuItem normalLensItem; |
---|
4513 | 4460 | MenuItem editCameraItem; |
---|
4514 | 4461 | MenuItem revertCameraItem; |
---|
4515 | | - CheckboxMenuItem toggleLiveItem; |
---|
4516 | 4462 | MenuItem stepItem; |
---|
| 4463 | + CheckboxMenuItem toggleLiveItem; |
---|
4517 | 4464 | CheckboxMenuItem toggleFullScreenItem; |
---|
4518 | 4465 | CheckboxMenuItem toggleTimelineItem; |
---|
4519 | 4466 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4522 | 4469 | CheckboxMenuItem toggleFootContactItem; |
---|
4523 | 4470 | CheckboxMenuItem toggleDLItem; |
---|
4524 | 4471 | CheckboxMenuItem toggleTextureItem; |
---|
4525 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 4472 | + CheckboxMenuItem toggleSwitchItem; |
---|
4526 | 4473 | CheckboxMenuItem toggleRootItem; |
---|
4527 | 4474 | CheckboxMenuItem animationItem; |
---|
4528 | 4475 | CheckboxMenuItem toggleHandleItem; |
---|
.. | .. |
---|
4530 | 4477 | JSplitPane mainPanel; |
---|
4531 | 4478 | JScrollPane scrollpane; |
---|
4532 | 4479 | JPanel toolbarPanel; |
---|
4533 | | - JPanel treePanel; |
---|
| 4480 | + cGridBag treePanel; |
---|
4534 | 4481 | JPanel radioPanel; |
---|
4535 | 4482 | ButtonGroup buttonGroup; |
---|
4536 | | - JPanel ctrlPanel; |
---|
4537 | | - JPanel materialPanel; |
---|
| 4483 | + cGridBag ctrlPanel; |
---|
| 4484 | + cGridBag materialPanel; |
---|
4538 | 4485 | JScrollPane infoPanel; |
---|
4539 | | - JPanel optionsPanel; |
---|
| 4486 | + cGridBag optionsPanel; |
---|
4540 | 4487 | JTabbedPane objectPanel; |
---|
4541 | | - JPanel XYZPanel; |
---|
| 4488 | + cGridBag XYZPanel; |
---|
4542 | 4489 | JSplitPane gridPanel; |
---|
4543 | 4490 | JSplitPane bigPanel; |
---|
4544 | | - JPanel bigThree; |
---|
4545 | | - JTabbedPane scenePanel; |
---|
4546 | | - JPanel centralPanel; |
---|
| 4491 | + cGridBag bigThree; |
---|
| 4492 | + cGridBag scenePanel; |
---|
| 4493 | + cGridBag centralPanel; |
---|
4547 | 4494 | JSplitPane cameraPanel; |
---|
4548 | 4495 | JPanel timelinePanel; |
---|
4549 | 4496 | JMenuBar timelineMenubar; |
---|
.. | .. |
---|
4596 | 4543 | // MATERIAL |
---|
4597 | 4544 | JLabel materialLabel; |
---|
4598 | 4545 | JLabel colorLabel; |
---|
4599 | | - NumberSlider colorField; |
---|
| 4546 | + cNumberSlider colorField; |
---|
4600 | 4547 | JLabel modulationLabel; |
---|
4601 | | - NumberSlider modulationField; |
---|
| 4548 | + cNumberSlider modulationField; |
---|
4602 | 4549 | JLabel metalnessLabel; |
---|
4603 | | - NumberSlider metalnessField; |
---|
| 4550 | + cNumberSlider metalnessField; |
---|
4604 | 4551 | JLabel diffuseLabel; |
---|
4605 | | - NumberSlider diffuseField; |
---|
| 4552 | + cNumberSlider diffuseField; |
---|
4606 | 4553 | JLabel specularLabel; |
---|
4607 | | - NumberSlider specularField; |
---|
| 4554 | + cNumberSlider specularField; |
---|
4608 | 4555 | JLabel shininessLabel; |
---|
4609 | | - NumberSlider shininessField; |
---|
| 4556 | + cNumberSlider shininessField; |
---|
4610 | 4557 | JLabel shiftLabel; |
---|
4611 | | - NumberSlider shiftField; |
---|
| 4558 | + cNumberSlider shiftField; |
---|
4612 | 4559 | JLabel ambientLabel; |
---|
4613 | | - NumberSlider ambientField; |
---|
| 4560 | + cNumberSlider ambientField; |
---|
4614 | 4561 | JLabel lightareaLabel; |
---|
4615 | | - NumberSlider lightareaField; |
---|
| 4562 | + cNumberSlider lightareaField; |
---|
4616 | 4563 | JLabel diffusenessLabel; |
---|
4617 | | - NumberSlider diffusenessField; |
---|
| 4564 | + cNumberSlider diffusenessField; |
---|
4618 | 4565 | JLabel velvetLabel; |
---|
4619 | | - NumberSlider velvetField; |
---|
| 4566 | + cNumberSlider velvetField; |
---|
4620 | 4567 | JLabel sheenLabel; |
---|
4621 | | - NumberSlider sheenField; |
---|
| 4568 | + cNumberSlider sheenField; |
---|
4622 | 4569 | JLabel subsurfaceLabel; |
---|
4623 | | - NumberSlider subsurfaceField; |
---|
| 4570 | + cNumberSlider subsurfaceField; |
---|
4624 | 4571 | //JLabel bumpLabel; |
---|
4625 | 4572 | //NumberSlider bumpField; |
---|
4626 | 4573 | JLabel backlitLabel; |
---|
4627 | | - NumberSlider backlitField; |
---|
| 4574 | + cNumberSlider backlitField; |
---|
4628 | 4575 | JLabel anisoLabel; |
---|
4629 | | - NumberSlider anisoField; |
---|
| 4576 | + cNumberSlider anisoField; |
---|
4630 | 4577 | JLabel anisoVLabel; |
---|
4631 | | - NumberSlider anisoVField; |
---|
| 4578 | + cNumberSlider anisoVField; |
---|
4632 | 4579 | JLabel cameraLabel; |
---|
4633 | | - NumberSlider cameraField; |
---|
| 4580 | + cNumberSlider cameraField; |
---|
4634 | 4581 | JLabel selfshadowLabel; |
---|
4635 | | - NumberSlider selfshadowField; |
---|
| 4582 | + cNumberSlider selfshadowField; |
---|
4636 | 4583 | JLabel shadowLabel; |
---|
4637 | | - NumberSlider shadowField; |
---|
| 4584 | + cNumberSlider shadowField; |
---|
4638 | 4585 | JLabel textureLabel; |
---|
4639 | | - NumberSlider textureField; |
---|
| 4586 | + cNumberSlider textureField; |
---|
4640 | 4587 | JLabel opacityLabel; |
---|
4641 | | - NumberSlider opacityField; |
---|
| 4588 | + cNumberSlider opacityField; |
---|
4642 | 4589 | JLabel fakedepthLabel; |
---|
4643 | | - NumberSlider fakedepthField; |
---|
| 4590 | + cNumberSlider fakedepthField; |
---|
4644 | 4591 | JLabel shadowbiasLabel; |
---|
4645 | | - NumberSlider shadowbiasField; |
---|
| 4592 | + cNumberSlider shadowbiasField; |
---|
4646 | 4593 | JLabel bumpLabel; |
---|
4647 | | - NumberSlider bumpField; |
---|
| 4594 | + cNumberSlider bumpField; |
---|
4648 | 4595 | JLabel noiseLabel; |
---|
4649 | | - NumberSlider noiseField; |
---|
| 4596 | + cNumberSlider noiseField; |
---|
4650 | 4597 | JLabel powerLabel; |
---|
4651 | | - NumberSlider powerField; |
---|
| 4598 | + cNumberSlider powerField; |
---|
4652 | 4599 | JLabel borderfadeLabel; |
---|
4653 | | - NumberSlider borderfadeField; |
---|
| 4600 | + cNumberSlider borderfadeField; |
---|
4654 | 4601 | JLabel fogLabel; |
---|
4655 | | - NumberSlider fogField; |
---|
| 4602 | + cNumberSlider fogField; |
---|
4656 | 4603 | JLabel opacityPowerLabel; |
---|
4657 | | - NumberSlider opacityPowerField; |
---|
| 4604 | + cNumberSlider opacityPowerField; |
---|
4658 | 4605 | JTree jTree; |
---|
4659 | 4606 | //ObjectUI parent; |
---|
4660 | 4607 | |
---|
4661 | | - NumberSlider normalpushField; |
---|
| 4608 | + cNumberSlider normalpushField; |
---|
4662 | 4609 | } |
---|