.. | .. |
---|
19 | 19 | import //weka.core. |
---|
20 | 20 | matrix.Matrix; |
---|
21 | 21 | |
---|
| 22 | +import grafeme.ui.*; |
---|
| 23 | + |
---|
22 | 24 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 25 | ActionListener, ChangeListener, |
---|
24 | 26 | InputMethodListener, |
---|
.. | .. |
---|
28 | 30 | iSendInfo |
---|
29 | 31 | //KeyListener |
---|
30 | 32 | { |
---|
| 33 | + boolean timeline; |
---|
| 34 | + boolean wasFullScreen; |
---|
31 | 35 | |
---|
| 36 | + GroupEditor callee; |
---|
| 37 | + JFrame frame; |
---|
| 38 | + |
---|
32 | 39 | // SCRIPT |
---|
33 | 40 | |
---|
34 | 41 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
119 | 126 | void keyPressed(int key, int modifiers) |
---|
120 | 127 | { |
---|
121 | 128 | System.out.println("KEY PRESSED"); |
---|
122 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 129 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
123 | 130 | } |
---|
124 | 131 | */ |
---|
125 | 132 | |
---|
126 | 133 | static GridBagConstraints aConstraints; |
---|
127 | 134 | static GridBagConstraints aWindowConstraints; |
---|
128 | | - GroupEditor callee; |
---|
129 | | - JFrame frame; |
---|
| 135 | + |
---|
130 | 136 | static int GRIDWIDTH = 100; // 4; |
---|
131 | 137 | |
---|
132 | 138 | public void closeUI() |
---|
133 | 139 | { |
---|
134 | 140 | //new Exception().printStackTrace(); |
---|
135 | | - System.out.println("this = " + this); |
---|
136 | | - System.out.println("objEditor = " + objEditor); |
---|
| 141 | +// System.out.println("this = " + this); |
---|
| 142 | +// System.out.println("objEditor = " + objEditor); |
---|
137 | 143 | //nameField.removeActionListener(this); |
---|
138 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 144 | +// objEditor.ctrlPanel.remove(nameField); |
---|
| 145 | + |
---|
| 146 | + objEditor.ctrlPanel.remove(namePanel); |
---|
139 | 147 | |
---|
140 | 148 | if (!GroupEditor.allparams) |
---|
141 | 149 | return; |
---|
142 | 150 | |
---|
143 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
144 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
145 | | - objEditor.ctrlPanel.remove(markCB); |
---|
146 | | - |
---|
147 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
148 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
149 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
150 | | - |
---|
151 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
152 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
153 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
154 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
155 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
156 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
157 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
158 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
159 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
160 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 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); |
---|
| 169 | + |
---|
| 170 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 171 | + objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 172 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 173 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 174 | + |
---|
| 175 | + //Remove(normalpushField); |
---|
161 | 176 | } |
---|
162 | 177 | |
---|
163 | 178 | public ObjEditor GetEditor() |
---|
164 | 179 | { |
---|
165 | 180 | return objEditor; //.GetEditor(); |
---|
166 | 181 | } |
---|
| 182 | + |
---|
| 183 | + // Sometimes myself, sometimes my callee's. |
---|
167 | 184 | ObjEditor objEditor; |
---|
168 | 185 | |
---|
169 | 186 | /* |
---|
.. | .. |
---|
238 | 255 | //if (!isDisplayable()) |
---|
239 | 256 | //setUndecorated(true); |
---|
240 | 257 | |
---|
241 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 258 | + //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
242 | 259 | client = inClient; |
---|
243 | 260 | copy = localCopy; |
---|
244 | 261 | copy.editWindow = this; |
---|
.. | .. |
---|
292 | 309 | //normalLensItem.addActionListener(this); |
---|
293 | 310 | cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
294 | 311 | revertCameraItem.addActionListener(this); |
---|
295 | | - cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen")); |
---|
296 | | - toggleFullItem.addItemListener(this); |
---|
297 | | - toggleFullItem.setState(CameraPane.FULLSCREEN); |
---|
| 312 | + |
---|
| 313 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 314 | + toggleFullScreenItem.addItemListener(this); |
---|
| 315 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
298 | 316 | cameraMenu.add("-"); |
---|
| 317 | + |
---|
299 | 318 | cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
300 | 319 | toggleTextureItem.addItemListener(this); |
---|
301 | 320 | toggleTextureItem.setState(CameraPane.textureon); |
---|
302 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
303 | | - toggleLiveItem.addItemListener(this); |
---|
304 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
305 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
306 | | - stepItem.addActionListener(this); |
---|
307 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
308 | | -// toggleDLItem.addItemListener(this); |
---|
309 | | -// toggleDLItem.setState(false); |
---|
310 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
311 | | - toggleRenderItem.addItemListener(this); |
---|
312 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
313 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
314 | | - toggleDebugItem.addItemListener(this); |
---|
315 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
316 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
317 | | - toggleFrustumItem.addItemListener(this); |
---|
318 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
319 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
320 | | - toggleFootContactItem.addItemListener(this); |
---|
321 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
322 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
323 | | - toggleRandomItem.addItemListener(this); |
---|
324 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
| 321 | + |
---|
| 322 | + if (Globals.ADVANCED) |
---|
| 323 | + { |
---|
| 324 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 325 | + toggleLiveItem.addItemListener(this); |
---|
| 326 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 327 | + |
---|
| 328 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 329 | + stepItem.addActionListener(this); |
---|
| 330 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 331 | + // toggleDLItem.addItemListener(this); |
---|
| 332 | + // toggleDLItem.setState(false); |
---|
| 333 | + |
---|
| 334 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 335 | + toggleRenderItem.addItemListener(this); |
---|
| 336 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 337 | + |
---|
| 338 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 339 | + toggleDebugItem.addItemListener(this); |
---|
| 340 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 341 | + |
---|
| 342 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 343 | + toggleFrustumItem.addItemListener(this); |
---|
| 344 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 345 | + |
---|
| 346 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 347 | + toggleFootContactItem.addItemListener(this); |
---|
| 348 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 349 | + |
---|
| 350 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 351 | + toggleTimelineItem.addItemListener(this); |
---|
| 352 | + } |
---|
| 353 | + |
---|
| 354 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 355 | + toggleSwitchItem.addItemListener(this); |
---|
| 356 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 357 | + |
---|
325 | 358 | cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
326 | 359 | toggleHandleItem.addItemListener(this); |
---|
327 | 360 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 361 | + |
---|
328 | 362 | cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
329 | 363 | togglePaintItem.addItemListener(this); |
---|
330 | 364 | togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 365 | + |
---|
331 | 366 | // cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
332 | 367 | // toggleRootItem.addItemListener(this); |
---|
333 | 368 | // toggleRootItem.setState(false); |
---|
.. | .. |
---|
341 | 376 | objectPanel = new JTabbedPane(); |
---|
342 | 377 | toolbarPanel = new JPanel(); |
---|
343 | 378 | toolbarPanel.setName("Toolbar"); |
---|
344 | | - treePanel = new JPanel(); |
---|
| 379 | + treePanel = new cGridBag(); |
---|
345 | 380 | treePanel.setName("Tree"); |
---|
346 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
| 381 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
347 | 382 | ctrlPanel.setName("Edit"); |
---|
348 | | - materialPanel = new JPanel(); |
---|
| 383 | + materialPanel = new cGridBag().setVertical(true); |
---|
349 | 384 | materialPanel.setName("Material"); |
---|
350 | 385 | /*JTextPane*/ |
---|
351 | 386 | infoarea = createTextPane(); |
---|
| 387 | + doc = infoarea.getStyledDocument(); |
---|
| 388 | + |
---|
352 | 389 | infoarea.setEditable(true); |
---|
353 | 390 | SetText(); |
---|
354 | 391 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
355 | 392 | // infoarea.setOpaque(false); |
---|
356 | 393 | // //infoarea.setForeground(textcolor); |
---|
357 | | - infoarea.setLineWrap(true); |
---|
358 | | - infoarea.setWrapStyleWord(true); |
---|
| 394 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 395 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
359 | 396 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
360 | 397 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
361 | 398 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
366 | 403 | mainPanel.setName("Main"); |
---|
367 | 404 | mainPanel.setContinuousLayout(true); |
---|
368 | 405 | mainPanel.setOneTouchExpandable(true); |
---|
369 | | - mainPanel.setDividerLocation(1.0); |
---|
370 | 406 | mainPanel.setDividerSize(9); |
---|
371 | | - mainPanel.setResizeWeight(0); |
---|
| 407 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 408 | + mainPanel.setResizeWeight(0.5); |
---|
372 | 409 | |
---|
373 | 410 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
374 | 411 | //mainPanel.setLayout(new GridBagLayout()); |
---|
375 | 412 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
376 | | - treePanel.setLayout(new GridBagLayout()); |
---|
377 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
378 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 413 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 414 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 415 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
379 | 416 | |
---|
380 | 417 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
381 | 418 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
414 | 451 | static String newline = "\n"; |
---|
415 | 452 | protected static final String buttonString = "JButton"; |
---|
416 | 453 | StyledDocument doc; |
---|
417 | | - JTextArea infoarea; |
---|
| 454 | + JTextPane infoarea; |
---|
418 | 455 | |
---|
419 | 456 | void ClearInfo() |
---|
420 | 457 | { |
---|
.. | .. |
---|
481 | 518 | } |
---|
482 | 519 | |
---|
483 | 520 | if (full) |
---|
484 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 521 | + { |
---|
| 522 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 523 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 524 | + } |
---|
485 | 525 | |
---|
486 | 526 | if (sel.bRep != null) |
---|
487 | 527 | { |
---|
.. | .. |
---|
579 | 619 | { |
---|
580 | 620 | CameraPane.pointflow = (PointFlow) sel; |
---|
581 | 621 | } |
---|
| 622 | + |
---|
| 623 | + si.SendInfo("_____________________", "regular"); |
---|
| 624 | + si.SendInfo("", "regular"); |
---|
582 | 625 | } |
---|
583 | 626 | } |
---|
584 | 627 | |
---|
.. | .. |
---|
594 | 637 | } |
---|
595 | 638 | } |
---|
596 | 639 | |
---|
597 | | - private JTextArea createTextPane() |
---|
598 | | - { |
---|
599 | | - String[] initString = |
---|
| 640 | + void ToggleFullScreen() |
---|
600 | 641 | { |
---|
601 | | - "This is an editable JTextPane, ", //regular |
---|
602 | | - "another ", //italic |
---|
603 | | - "styled ", //bold |
---|
604 | | - "text ", //small |
---|
605 | | - "component, ", //large |
---|
606 | | - "which supports embedded components..." + newline,//regular |
---|
607 | | - " " + newline, //button |
---|
608 | | - "...and embedded icons..." + newline, //regular |
---|
609 | | - " ", //icon |
---|
610 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
611 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
612 | | - + "cover methods for interacting with those objects." |
---|
613 | | - }; |
---|
614 | | - |
---|
615 | | - String[] initStyles = |
---|
616 | | - { |
---|
617 | | - "regular", "italic", "bold", "small", "large", |
---|
618 | | - "regular", "button", "regular", "icon", |
---|
619 | | - "regular" |
---|
620 | | - }; |
---|
621 | | - |
---|
622 | | - JTextPane textPane = new JTextPane(); |
---|
623 | | - textPane.setEditable(true); |
---|
624 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
625 | | - addStylesToDocument(doc); |
---|
626 | | - |
---|
627 | | - try |
---|
628 | | - { |
---|
629 | | - for (int j = 0; j < 2; j++) |
---|
630 | | - { |
---|
631 | | - for (int i = 0; i < initString.length; i++) |
---|
| 642 | + if (CameraPane.FULLSCREEN) |
---|
632 | 643 | { |
---|
633 | | - doc.insertString(doc.getLength(), initString[i], |
---|
634 | | - doc.getStyle(initStyles[i])); |
---|
| 644 | + frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 645 | + framePanel.add(bigThree); |
---|
| 646 | + frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 647 | + } else |
---|
| 648 | + { |
---|
| 649 | + frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 650 | + framePanel.remove(bigThree); |
---|
| 651 | + frame.getContentPane().add(/*"Center",*/bigThree); |
---|
635 | 652 | } |
---|
636 | | - } |
---|
637 | | - } catch (BadLocationException ble) |
---|
638 | | - { |
---|
639 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
| 653 | + cameraView.ToggleFullScreen(); |
---|
640 | 654 | } |
---|
641 | 655 | |
---|
642 | | - return new JTextArea(); // textPane; |
---|
| 656 | + private JTextPane createTextPane() |
---|
| 657 | + { |
---|
| 658 | +// TEXTAREA String[] initString = |
---|
| 659 | +// { |
---|
| 660 | +// "This is an editable JTextPane, ", //regular |
---|
| 661 | +// "another ", //italic |
---|
| 662 | +// "styled ", //bold |
---|
| 663 | +// "text ", //small |
---|
| 664 | +// "component, ", //large |
---|
| 665 | +// "which supports embedded components..." + newline,//regular |
---|
| 666 | +// " " + newline, //button |
---|
| 667 | +// "...and embedded icons..." + newline, //regular |
---|
| 668 | +// " ", //icon |
---|
| 669 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 670 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 671 | +// + "cover methods for interacting with those objects." |
---|
| 672 | +// }; |
---|
| 673 | +// |
---|
| 674 | +// String[] initStyles = |
---|
| 675 | +// { |
---|
| 676 | +// "regular", "italic", "bold", "small", "large", |
---|
| 677 | +// "regular", "button", "regular", "icon", |
---|
| 678 | +// "regular" |
---|
| 679 | +// }; |
---|
| 680 | +// |
---|
| 681 | +// JTextPane textPane = new JTextPane(); |
---|
| 682 | +// textPane.setEditable(true); |
---|
| 683 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 684 | +// addStylesToDocument(doc); |
---|
| 685 | +// |
---|
| 686 | +// try |
---|
| 687 | +// { |
---|
| 688 | +// for (int j = 0; j < 2; j++) |
---|
| 689 | +// { |
---|
| 690 | +// for (int i = 0; i < initString.length; i++) |
---|
| 691 | +// { |
---|
| 692 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 693 | +// doc.getStyle(initStyles[i])); |
---|
| 694 | +// } |
---|
| 695 | +// } |
---|
| 696 | +// } catch (BadLocationException ble) |
---|
| 697 | +// { |
---|
| 698 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 699 | +// } |
---|
| 700 | + |
---|
| 701 | + return new JTextPane(); // textPane; |
---|
643 | 702 | } |
---|
644 | 703 | |
---|
645 | 704 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
739 | 798 | JButton slowerButton; |
---|
740 | 799 | JButton fasterButton; |
---|
741 | 800 | JButton remarkButton; |
---|
| 801 | + |
---|
| 802 | + cGridBag namePanel; |
---|
| 803 | + cGridBag setupPanel; |
---|
| 804 | + cGridBag commandsPanel; |
---|
| 805 | + cGridBag pushPanel; |
---|
| 806 | + cGridBag fillPanel; |
---|
742 | 807 | |
---|
743 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 808 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
744 | 809 | { |
---|
745 | 810 | JCheckBox cb; |
---|
746 | 811 | |
---|
747 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
748 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
749 | | -// oe.aConstraints.weightx = 1; |
---|
750 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
751 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 812 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
752 | 813 | cb.addItemListener(this); |
---|
753 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
754 | | - oe.aConstraints.gridwidth = 1; |
---|
755 | | - oe.aConstraints.gridx += 1; |
---|
756 | 814 | |
---|
757 | 815 | return cb; |
---|
758 | 816 | } |
---|
759 | 817 | |
---|
760 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 818 | + cButton AddButton(cGridBag panel, String label) |
---|
761 | 819 | { |
---|
762 | 820 | cButton cb; |
---|
763 | 821 | |
---|
764 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
765 | | - oe.aConstraints.gridwidth = 1; |
---|
766 | | -// oe.aConstraints.weightx = 1; |
---|
767 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
768 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 822 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
769 | 823 | cb.addActionListener(this); |
---|
770 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
771 | | - oe.aConstraints.gridwidth = 1; |
---|
772 | | - oe.aConstraints.gridx += 1; |
---|
773 | 824 | |
---|
774 | 825 | return cb; |
---|
775 | 826 | } |
---|
776 | 827 | |
---|
777 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 828 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
778 | 829 | { |
---|
779 | 830 | JComboBox combo; |
---|
780 | 831 | |
---|
781 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
782 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
783 | | - oe.aConstraints.gridx += 1; |
---|
| 832 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
784 | 833 | combo.addActionListener(this); |
---|
785 | 834 | |
---|
786 | 835 | return combo; |
---|
787 | 836 | } |
---|
788 | 837 | |
---|
789 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 838 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
790 | 839 | { |
---|
791 | | - NumberSlider combo; |
---|
| 840 | + cGridBag control = new cGridBag(); |
---|
| 841 | + |
---|
| 842 | + cNumberSlider combo; |
---|
792 | 843 | |
---|
793 | 844 | JLabel jlabel = new JLabel(label); |
---|
794 | | - |
---|
795 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
796 | 845 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
797 | | - aConstraints.gridwidth = 2; |
---|
798 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
799 | | - aConstraints.gridx += 1; |
---|
800 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
801 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
802 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
803 | | - aConstraints.gridx += 1; |
---|
804 | | - aConstraints.gridwidth = 1; |
---|
805 | | - |
---|
| 846 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 847 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
806 | 848 | combo.setFloat(current); |
---|
807 | | - |
---|
808 | | - combo.label = jlabel; |
---|
809 | | - |
---|
810 | | - combo.addChangeListener(this); |
---|
811 | | - |
---|
812 | | - return combo; |
---|
| 849 | + |
---|
| 850 | + panel.add(control); |
---|
| 851 | + |
---|
| 852 | + return control; |
---|
813 | 853 | } |
---|
814 | 854 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 855 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
816 | 856 | { |
---|
817 | | - NumberSlider combo; |
---|
| 857 | + cGridBag control = new cGridBag(); |
---|
| 858 | + |
---|
| 859 | + cNumberSlider combo; |
---|
818 | 860 | |
---|
819 | 861 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 862 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
823 | | - aConstraints.gridwidth = 2; |
---|
824 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
825 | | - aConstraints.gridx += 1; |
---|
826 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
827 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
828 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
829 | | - aConstraints.gridx += 1; |
---|
830 | | - aConstraints.gridwidth = 1; |
---|
831 | | - |
---|
| 863 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 864 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 865 | combo.setInteger(current); |
---|
833 | 866 | |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 867 | + panel.add(control); |
---|
| 868 | + |
---|
| 869 | + return control; |
---|
839 | 870 | } |
---|
840 | 871 | |
---|
841 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 872 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
842 | 873 | { |
---|
843 | 874 | JTextArea text; |
---|
844 | 875 | |
---|
845 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
846 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
847 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 876 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
848 | 877 | text.addCaretListener(this); |
---|
849 | | - aConstraints.gridx += 1; |
---|
850 | | - aConstraints.gridwidth = 1; |
---|
851 | 878 | |
---|
852 | 879 | return text; |
---|
853 | 880 | } |
---|
.. | .. |
---|
877 | 904 | objEditor.ctrlPanel.remove(j); |
---|
878 | 905 | } |
---|
879 | 906 | |
---|
| 907 | + void Remove(cNumberSlider j) |
---|
| 908 | + { |
---|
| 909 | + j.removeChangeListener(this); |
---|
| 910 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 911 | + objEditor.ctrlPanel.remove(j); |
---|
| 912 | + } |
---|
| 913 | + |
---|
880 | 914 | /* |
---|
881 | 915 | */ |
---|
882 | | - void Return() // ObjEditor oe) |
---|
| 916 | + void Return0() // ObjEditor oe) |
---|
883 | 917 | { |
---|
884 | 918 | aConstraints.gridy += 1; |
---|
885 | 919 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
934 | 968 | |
---|
935 | 969 | void SetupUI2(ObjEditor oe) |
---|
936 | 970 | { |
---|
937 | | -// oe.aConstraints.weightx = 0; |
---|
938 | | -// oe.aConstraints.weighty = 0; |
---|
939 | | -// oe.aConstraints.gridx = 0; |
---|
940 | | -// oe.aConstraints.gridy = 0; |
---|
941 | | - SetupName(oe); |
---|
| 971 | + //SetupName(oe); |
---|
| 972 | + |
---|
| 973 | + namePanel = new cGridBag(); |
---|
| 974 | + |
---|
| 975 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 976 | + namePanel.add(nameField); |
---|
| 977 | + oe.ctrlPanel.add(namePanel); |
---|
| 978 | + |
---|
| 979 | + oe.ctrlPanel.Return(); |
---|
942 | 980 | |
---|
943 | 981 | if (!GroupEditor.allparams) |
---|
944 | 982 | return; |
---|
945 | 983 | |
---|
946 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
947 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
948 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 984 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 985 | + |
---|
| 986 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 987 | + liveCB.setToolTipText("Animate object"); |
---|
| 988 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 989 | + hideCB.setToolTipText("Hide object"); |
---|
949 | 990 | // Return(); |
---|
950 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
951 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
952 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
953 | | - Return(); |
---|
954 | | - resetButton = AddButton(oe, "Reset"); |
---|
955 | | - stepButton = AddButton(oe, "Step"); |
---|
| 991 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 992 | + markCB.setToolTipText("Set the animation target transform"); |
---|
| 993 | + |
---|
| 994 | + rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 995 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 996 | + |
---|
| 997 | + randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
| 998 | + randomCB.setToolTipText("Option for switch node"); |
---|
| 999 | + |
---|
| 1000 | + if (Globals.ADVANCED) |
---|
| 1001 | + { |
---|
| 1002 | + link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
| 1003 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1004 | + speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 1005 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1006 | + } |
---|
| 1007 | + |
---|
| 1008 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1009 | + oe.ctrlPanel.Return(); |
---|
| 1010 | + |
---|
| 1011 | + commandsPanel = new cGridBag().setVertical(false); |
---|
| 1012 | + |
---|
| 1013 | + resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 1014 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1015 | + stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1016 | + stepButton.setToolTipText("Step one frame"); |
---|
956 | 1017 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
957 | 1018 | // stepAllButton = AddButton(oe, "Step All"); |
---|
958 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
959 | 1019 | // Return(); |
---|
960 | | - slowerButton = AddButton(oe, "Slow"); |
---|
961 | | - fasterButton = AddButton(oe, "Fast"); |
---|
962 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1020 | + slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 1021 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1022 | + fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 1023 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1024 | + remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1025 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
963 | 1026 | |
---|
964 | | - Return(); |
---|
| 1027 | + oe.ctrlPanel.add(commandsPanel); |
---|
| 1028 | + oe.ctrlPanel.Return(); |
---|
965 | 1029 | |
---|
| 1030 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1); |
---|
| 1031 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1032 | + //Return(); |
---|
| 1033 | + |
---|
| 1034 | + oe.ctrlPanel.Return(); |
---|
| 1035 | + |
---|
966 | 1036 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
967 | 1037 | // ObjEditor.aConstraints.gridx += 1; |
---|
968 | 1038 | |
---|
.. | .. |
---|
1056 | 1126 | oe.aConstraints.gridwidth = 1; |
---|
1057 | 1127 | /**/ |
---|
1058 | 1128 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1059 | | - Return(); |
---|
| 1129 | + oe.ctrlPanel.Return(); |
---|
1060 | 1130 | |
---|
1061 | 1131 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1062 | 1132 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1158 | 1228 | //JPanel worldPanel = |
---|
1159 | 1229 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1160 | 1230 | //worldPanel.setName("World"); |
---|
1161 | | - /*JPanel*/ cameraPanel = |
---|
1162 | | - new JPanel(new BorderLayout()); |
---|
1163 | | - cameraPanel.add(cameraView); |
---|
| 1231 | + centralPanel = new cGridBag(); |
---|
| 1232 | + centralPanel.preferredWidth = 20; |
---|
| 1233 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1234 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1164 | 1235 | |
---|
| 1236 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1237 | + cameraPanel.setContinuousLayout(true); |
---|
| 1238 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1239 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1240 | +// cameraPanel.setDividerSize(9); |
---|
| 1241 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1242 | + |
---|
| 1243 | + centralPanel.add(cameraView); |
---|
| 1244 | + //frame.setJMenuBar(timelineMenubar); |
---|
| 1245 | + //centralPanel.add(timelinePanel); |
---|
| 1246 | + |
---|
1165 | 1247 | //topView.camera = ; |
---|
1166 | 1248 | //frontView.camera = new Camera(2); |
---|
1167 | 1249 | //sideView.camera = new Camera(3); |
---|
.. | .. |
---|
1177 | 1259 | //frontView.object = copy; |
---|
1178 | 1260 | //sideView.object = copy; |
---|
1179 | 1261 | |
---|
1180 | | - XYZPanel = new JPanel(); |
---|
1181 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1262 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1263 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1182 | 1264 | |
---|
1183 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1184 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1185 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1265 | + XYZPanel.preferredWidth = 5; |
---|
| 1266 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1267 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1268 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1186 | 1269 | |
---|
1187 | 1270 | /* |
---|
1188 | 1271 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1191 | 1274 | gridPanel.add(cameraView); |
---|
1192 | 1275 | gridPanel.add(XYZPanel); |
---|
1193 | 1276 | */ |
---|
1194 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout()); |
---|
| 1277 | + gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1195 | 1278 | gridPanel.setContinuousLayout(true); |
---|
1196 | 1279 | gridPanel.setOneTouchExpandable(true); |
---|
1197 | 1280 | gridPanel.setDividerLocation(1.0); |
---|
.. | .. |
---|
1220 | 1303 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1221 | 1304 | //tmp.setName("Edit"); |
---|
1222 | 1305 | objectPanel.add(materialPanel); |
---|
1223 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1224 | | - north.setName("Edit"); |
---|
1225 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1226 | | - objectPanel.add(north); |
---|
| 1306 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1307 | +// north.setName("Edit"); |
---|
| 1308 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1309 | +// objectPanel.add(north); |
---|
| 1310 | + objectPanel.add(ctrlPanel); |
---|
1227 | 1311 | objectPanel.add(infoPanel); |
---|
1228 | 1312 | |
---|
1229 | 1313 | /* |
---|
.. | .. |
---|
1244 | 1328 | scrollpane.setWheelScrollingEnabled(true); |
---|
1245 | 1329 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1246 | 1330 | |
---|
1247 | | - /*JTabbedPane*/ jtp = new JTabbedPane(); |
---|
1248 | | - jtp.add(scrollpane); |
---|
| 1331 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1332 | + scenePanel.preferredWidth = 7; |
---|
| 1333 | + |
---|
| 1334 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1335 | + tabbedPane.add(scrollpane); |
---|
1249 | 1336 | |
---|
1250 | | - jtp.add(FSPane = new cFileSystemPane(this)); |
---|
| 1337 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1251 | 1338 | |
---|
1252 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1339 | + optionsPanel = new cGridBag().setVertical(true); |
---|
1253 | 1340 | |
---|
1254 | 1341 | optionsPanel.setName("Options"); |
---|
1255 | | - jtp.add(optionsPanel); |
---|
1256 | | - |
---|
| 1342 | + |
---|
| 1343 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1344 | + |
---|
| 1345 | + tabbedPane.add(optionsPanel); |
---|
| 1346 | + |
---|
| 1347 | + scenePanel.add(tabbedPane); |
---|
1257 | 1348 | |
---|
1258 | 1349 | /* |
---|
1259 | 1350 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1275 | 1366 | jtp.add(tree); |
---|
1276 | 1367 | */ |
---|
1277 | 1368 | |
---|
1278 | | - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel); |
---|
| 1369 | + bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
1279 | 1370 | bigPanel.setContinuousLayout(true); |
---|
1280 | 1371 | bigPanel.setOneTouchExpandable(true); |
---|
1281 | 1372 | bigPanel.setDividerLocation(0.8); |
---|
.. | .. |
---|
1287 | 1378 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1288 | 1379 | //bigPanel.add(ctrlPanel); |
---|
1289 | 1380 | //bigPanel.add(gridPanel); |
---|
| 1381 | + /** |
---|
1290 | 1382 | bigThree = new JPanel(); |
---|
1291 | 1383 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1292 | 1384 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1297 | 1389 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1298 | 1390 | aWindowConstraints.weightx = 0; |
---|
1299 | 1391 | aWindowConstraints.weighty = 1; |
---|
1300 | | - bigThree.add(jtp, aWindowConstraints); |
---|
| 1392 | + bigThree.add(scenePanel, aWindowConstraints); |
---|
1301 | 1393 | aWindowConstraints.weightx = 1; |
---|
1302 | 1394 | aWindowConstraints.gridwidth = 3; |
---|
1303 | 1395 | // aConstraints.gridheight = 3; |
---|
1304 | 1396 | aWindowConstraints.gridx = 1; |
---|
1305 | 1397 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
1306 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 1398 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
1307 | 1399 | aWindowConstraints.weightx = 0; |
---|
1308 | 1400 | aWindowConstraints.gridx = 4; |
---|
1309 | 1401 | aWindowConstraints.gridwidth = 1; |
---|
1310 | 1402 | // aConstraints.gridheight = 3; |
---|
1311 | 1403 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1312 | 1404 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1405 | + /**/ |
---|
1313 | 1406 | |
---|
| 1407 | + bigThree = new cGridBag(); |
---|
| 1408 | + bigThree.addComponent(scenePanel); |
---|
| 1409 | + bigThree.addComponent(centralPanel); |
---|
| 1410 | + bigThree.addComponent(XYZPanel); |
---|
| 1411 | + |
---|
1314 | 1412 | // // SIDE EFFECT!!! |
---|
1315 | 1413 | // aConstraints.gridx = 0; |
---|
1316 | 1414 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1331 | 1429 | //worldPane.add(bigPanel); |
---|
1332 | 1430 | //worldPane.add(worldPanel); |
---|
1333 | 1431 | /**/ |
---|
1334 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1432 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1433 | + frame.add(/*"Center",*/framePanel); |
---|
1335 | 1434 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1336 | 1435 | |
---|
1337 | 1436 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
.. | .. |
---|
1352 | 1451 | }); |
---|
1353 | 1452 | } |
---|
1354 | 1453 | |
---|
| 1454 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1455 | + { |
---|
| 1456 | + } |
---|
| 1457 | + |
---|
1355 | 1458 | JTree GetTree() |
---|
1356 | 1459 | { |
---|
1357 | 1460 | return objEditor.jTree; |
---|
.. | .. |
---|
1363 | 1466 | ctrlPanel.removeAll(); |
---|
1364 | 1467 | } |
---|
1365 | 1468 | |
---|
1366 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1469 | + void SetupMaterial(cGridBag panel) |
---|
1367 | 1470 | { |
---|
1368 | | - aConstraints.weighty = 0; |
---|
1369 | | - //aConstraints.weightx = 1; |
---|
1370 | | - /* |
---|
| 1471 | + /* |
---|
1371 | 1472 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1372 | 1473 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1373 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1374 | | - aConstraints.gridx += 1; |
---|
1375 | 1474 | */ |
---|
1376 | 1475 | |
---|
1377 | | - aConstraints.gridwidth = 1; |
---|
1378 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1379 | | - aConstraints.gridx += 1; |
---|
1380 | | - aConstraints.weighty = 0; |
---|
1381 | | - aConstraints.gridwidth = 1; |
---|
| 1476 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 1477 | + |
---|
| 1478 | + editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1479 | + createMaterialButton.setToolTipText("Create material"); |
---|
1382 | 1480 | |
---|
1383 | 1481 | /* |
---|
1384 | 1482 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1385 | | - aConstraints.gridx += 1; |
---|
1386 | | - aConstraints.weighty = 0; |
---|
1387 | | - aConstraints.gridwidth = 1; |
---|
1388 | 1483 | */ |
---|
1389 | 1484 | |
---|
1390 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1391 | | - aConstraints.gridx += 1; |
---|
| 1485 | + editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1486 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1487 | + |
---|
| 1488 | + if (Globals.ADVANCED) |
---|
| 1489 | + { |
---|
| 1490 | + editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints); |
---|
| 1491 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1492 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1493 | + } |
---|
1392 | 1494 | |
---|
1393 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1394 | | - |
---|
1395 | | - aConstraints.gridx += 1; |
---|
1396 | | - |
---|
1397 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1398 | | - |
---|
1399 | | - aConstraints.gridx += 1; |
---|
1400 | | - |
---|
1401 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1402 | | - |
---|
1403 | | - aConstraints.gridx = 0; |
---|
1404 | | - aConstraints.gridy += 1; |
---|
1405 | | - aConstraints.weighty = 0; |
---|
1406 | | - aConstraints.gridwidth = 1; |
---|
| 1495 | + editBar.preferredHeight = 15; |
---|
| 1496 | + |
---|
| 1497 | + panel.add(editBar); |
---|
| 1498 | + |
---|
1407 | 1499 | /**/ |
---|
1408 | 1500 | //aConstraints.weighty = 0; |
---|
1409 | 1501 | ////aConstraints.weightx = 1; |
---|
1410 | 1502 | //aConstraints.weighty = 1; |
---|
1411 | 1503 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1412 | 1504 | //aConstraints.gridx += 1; |
---|
1413 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1414 | | - aConstraints.weighty = 0; |
---|
1415 | | - aConstraints.gridx = 0; |
---|
1416 | | - aConstraints.gridy += 1; |
---|
1417 | | - aConstraints.gridwidth = 1; |
---|
| 1505 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1418 | 1506 | |
---|
1419 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1420 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1421 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1422 | | - aConstraints.gridx += 1; |
---|
1423 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1424 | | - //aConstraints.weightx = 0; |
---|
1425 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1426 | | - aConstraints.gridx = 0; |
---|
1427 | | - aConstraints.gridy += 1; |
---|
1428 | | - aConstraints.gridwidth = 1; |
---|
| 1507 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1508 | + |
---|
| 1509 | + cGridBag color = new cGridBag(); |
---|
| 1510 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1511 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1512 | + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1513 | + //colorField.preferredWidth = 200; |
---|
| 1514 | + colorSection.add(color); |
---|
1429 | 1515 | |
---|
1430 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1431 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1432 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1433 | | - aConstraints.gridx += 1; |
---|
1434 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1435 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1436 | | - aConstraints.gridx = 0; |
---|
1437 | | - aConstraints.gridy += 1; |
---|
1438 | | - aConstraints.gridwidth = 1; |
---|
| 1516 | + cGridBag modulation = new cGridBag(); |
---|
| 1517 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 1518 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1519 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1520 | + colorSection.add(modulation); |
---|
1439 | 1521 | |
---|
1440 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1441 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1442 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1443 | | - aConstraints.gridx += 1; |
---|
1444 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1445 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1446 | | - aConstraints.gridx = 0; |
---|
1447 | | - aConstraints.gridy += 1; |
---|
1448 | | - aConstraints.gridwidth = 1; |
---|
| 1522 | + cGridBag texture = new cGridBag(); |
---|
| 1523 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 1524 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1525 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1526 | + colorSection.add(texture); |
---|
1449 | 1527 | |
---|
1450 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1451 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1452 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1453 | | - aConstraints.gridx += 1; |
---|
1454 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1455 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1456 | | - aConstraints.gridx = 0; |
---|
1457 | | - aConstraints.gridy += 1; |
---|
1458 | | - aConstraints.gridwidth = 1; |
---|
| 1528 | + cGridBag anisoU = new cGridBag(); |
---|
| 1529 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1530 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1531 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1532 | + colorSection.add(anisoU); |
---|
1459 | 1533 | |
---|
1460 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1461 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1462 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1463 | | - aConstraints.gridx += 1; |
---|
1464 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1465 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1466 | | - aConstraints.gridx = 0; |
---|
1467 | | - aConstraints.gridy += 1; |
---|
1468 | | - aConstraints.gridwidth = 1; |
---|
| 1534 | + cGridBag anisoV = new cGridBag(); |
---|
| 1535 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1536 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1537 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1538 | + colorSection.add(anisoV); |
---|
1469 | 1539 | |
---|
1470 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1471 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1472 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1473 | | - aConstraints.gridx += 1; |
---|
1474 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1475 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1476 | | - aConstraints.gridx = 0; |
---|
1477 | | - aConstraints.gridy += 1; |
---|
1478 | | - aConstraints.gridwidth = 1; |
---|
| 1540 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1541 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1542 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1543 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1544 | + colorSection.add(shadowbias); |
---|
1479 | 1545 | |
---|
1480 | | - //aConstraints.weighty = 1; |
---|
1481 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1482 | | - //aConstraints.gridx += 1; |
---|
1483 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1484 | | - aConstraints.weighty = 0; |
---|
1485 | | - aConstraints.gridx = 0; |
---|
1486 | | - aConstraints.gridy += 1; |
---|
1487 | | - aConstraints.gridwidth = 1; |
---|
| 1546 | + panel.add(new JSeparator()); |
---|
| 1547 | + |
---|
| 1548 | + panel.add(colorSection); |
---|
| 1549 | + |
---|
| 1550 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1551 | + |
---|
| 1552 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 1553 | + |
---|
| 1554 | + cGridBag diffuse = new cGridBag(); |
---|
| 1555 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 1556 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1557 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1558 | + diffuseSection.add(diffuse); |
---|
1488 | 1559 | |
---|
1489 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1490 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1491 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1492 | | - aConstraints.gridx += 1; |
---|
1493 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1494 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1495 | | - aConstraints.gridx = 0; |
---|
1496 | | - aConstraints.gridy += 1; |
---|
1497 | | - aConstraints.gridwidth = 1; |
---|
| 1560 | + cGridBag diffuseness = new cGridBag(); |
---|
| 1561 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 1562 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1563 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1564 | + diffuseSection.add(diffuseness); |
---|
1498 | 1565 | |
---|
1499 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1500 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1501 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1502 | | - aConstraints.gridx += 1; |
---|
1503 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1504 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1505 | | - aConstraints.gridx = 0; |
---|
1506 | | - aConstraints.gridy += 1; |
---|
1507 | | - aConstraints.gridwidth = 1; |
---|
| 1566 | + cGridBag selfshadow = new cGridBag(); |
---|
| 1567 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 1568 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1569 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1570 | + diffuseSection.add(selfshadow); |
---|
1508 | 1571 | |
---|
1509 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1510 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1511 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1512 | | - aConstraints.gridx += 1; |
---|
1513 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1514 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1515 | | - aConstraints.gridx = 0; |
---|
1516 | | - aConstraints.gridy += 1; |
---|
1517 | | - aConstraints.gridwidth = 1; |
---|
| 1572 | + cGridBag sheen = new cGridBag(); |
---|
| 1573 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 1574 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1575 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1576 | + diffuseSection.add(sheen); |
---|
1518 | 1577 | |
---|
1519 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1520 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1521 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1522 | | - aConstraints.gridx += 1; |
---|
1523 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1524 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1525 | | - aConstraints.gridx = 0; |
---|
1526 | | - aConstraints.gridy += 1; |
---|
1527 | | - aConstraints.gridwidth = 1; |
---|
| 1578 | + cGridBag subsurface = new cGridBag(); |
---|
| 1579 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 1580 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1581 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1582 | + diffuseSection.add(subsurface); |
---|
1528 | 1583 | |
---|
1529 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1530 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1531 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1532 | | - aConstraints.gridx += 1; |
---|
1533 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1534 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1535 | | - aConstraints.gridx = 0; |
---|
1536 | | - aConstraints.gridy += 1; |
---|
1537 | | - aConstraints.gridwidth = 1; |
---|
| 1584 | + cGridBag shadow = new cGridBag(); |
---|
| 1585 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 1586 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1587 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1588 | + diffuseSection.add(shadow); |
---|
1538 | 1589 | |
---|
1539 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1540 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1541 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1542 | | - aConstraints.gridx += 1; |
---|
1543 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1544 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1545 | | - aConstraints.gridx = 0; |
---|
1546 | | - aConstraints.gridy += 1; |
---|
1547 | | - aConstraints.gridwidth = 1; |
---|
| 1590 | + cGridBag fakedepth = new cGridBag(); |
---|
| 1591 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 1592 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1593 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1594 | + diffuseSection.add(fakedepth); |
---|
1548 | 1595 | |
---|
1549 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1550 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1551 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1552 | | - aConstraints.gridx += 1; |
---|
1553 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1554 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1555 | | - aConstraints.gridx = 0; |
---|
1556 | | - aConstraints.gridy += 1; |
---|
1557 | | - aConstraints.gridwidth = 1; |
---|
| 1596 | + panel.add(new JSeparator()); |
---|
| 1597 | + |
---|
| 1598 | + panel.add(diffuseSection); |
---|
| 1599 | + |
---|
| 1600 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1601 | + |
---|
| 1602 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1558 | 1603 | |
---|
1559 | | - //aConstraints.weighty = 1; |
---|
1560 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1561 | | - //aConstraints.gridx += 1; |
---|
1562 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1563 | | - aConstraints.weighty = 0; |
---|
1564 | | - aConstraints.gridx = 0; |
---|
1565 | | - aConstraints.gridy += 1; |
---|
1566 | | - aConstraints.gridwidth = 1; |
---|
| 1604 | + cGridBag specular = new cGridBag(); |
---|
| 1605 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 1606 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1607 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1608 | + specularSection.add(specular); |
---|
1567 | 1609 | |
---|
1568 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1569 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1570 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1571 | | - aConstraints.gridx += 1; |
---|
1572 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1573 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1574 | | - aConstraints.gridx = 0; |
---|
1575 | | - aConstraints.gridy += 1; |
---|
1576 | | - aConstraints.gridwidth = 1; |
---|
| 1610 | + cGridBag lightarea = new cGridBag(); |
---|
| 1611 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 1612 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1613 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1614 | + specularSection.add(lightarea); |
---|
1577 | 1615 | |
---|
1578 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1579 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1580 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1581 | | - aConstraints.gridx += 1; |
---|
1582 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1583 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1584 | | - aConstraints.gridx = 0; |
---|
1585 | | - aConstraints.gridy += 1; |
---|
1586 | | - aConstraints.gridwidth = 1; |
---|
| 1616 | + cGridBag shininess = new cGridBag(); |
---|
| 1617 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 1618 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1619 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1620 | + specularSection.add(shininess); |
---|
1587 | 1621 | |
---|
1588 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1589 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1590 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1591 | | - aConstraints.gridx += 1; |
---|
1592 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1593 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1594 | | - aConstraints.gridx = 0; |
---|
1595 | | - aConstraints.gridy += 1; |
---|
1596 | | - aConstraints.gridwidth = 1; |
---|
| 1622 | + cGridBag metalness = new cGridBag(); |
---|
| 1623 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 1624 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1625 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1626 | + specularSection.add(metalness); |
---|
1597 | 1627 | |
---|
1598 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1599 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1600 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1601 | | - aConstraints.gridx += 1; |
---|
1602 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1603 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1604 | | - aConstraints.gridx = 0; |
---|
1605 | | - aConstraints.gridy += 1; |
---|
1606 | | - aConstraints.gridwidth = 1; |
---|
| 1628 | + cGridBag velvet = new cGridBag(); |
---|
| 1629 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 1630 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1631 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1632 | + specularSection.add(velvet); |
---|
1607 | 1633 | |
---|
1608 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1609 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1610 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1611 | | - aConstraints.gridx += 1; |
---|
1612 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1613 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1614 | | - aConstraints.gridx = 0; |
---|
1615 | | - aConstraints.gridy += 1; |
---|
1616 | | - aConstraints.gridwidth = 1; |
---|
1617 | | - |
---|
1618 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1619 | | - Return(); |
---|
| 1634 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1635 | + //Return(); |
---|
1620 | 1636 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1621 | 1637 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1622 | 1638 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1627 | 1643 | // aConstraints.gridy += 1; |
---|
1628 | 1644 | // aConstraints.gridwidth = 1; |
---|
1629 | 1645 | |
---|
1630 | | - //aConstraints.weighty = 1; |
---|
1631 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1632 | | - //aConstraints.gridx += 1; |
---|
1633 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1634 | | - aConstraints.weighty = 0; |
---|
1635 | | - aConstraints.gridx = 0; |
---|
1636 | | - aConstraints.gridy += 1; |
---|
1637 | | - aConstraints.gridwidth = 1; |
---|
1638 | 1646 | |
---|
1639 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1640 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1641 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1642 | | - aConstraints.gridx += 1; |
---|
1643 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1644 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1645 | | - aConstraints.gridx = 0; |
---|
1646 | | - aConstraints.gridy += 1; |
---|
1647 | | - aConstraints.gridwidth = 1; |
---|
| 1647 | + panel.add(new JSeparator()); |
---|
| 1648 | + |
---|
| 1649 | + panel.add(specularSection); |
---|
| 1650 | + |
---|
| 1651 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1652 | + |
---|
| 1653 | + cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1648 | 1654 | |
---|
1649 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1650 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1651 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1652 | | - aConstraints.gridx += 1; |
---|
1653 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1654 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1655 | | - aConstraints.gridx = 0; |
---|
1656 | | - aConstraints.gridy += 1; |
---|
1657 | | - aConstraints.gridwidth = 1; |
---|
| 1655 | + cGridBag camera = new cGridBag(); |
---|
| 1656 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 1657 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1658 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1659 | + globalSection.add(camera); |
---|
1658 | 1660 | |
---|
1659 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1660 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1661 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1662 | | - aConstraints.gridx += 1; |
---|
1663 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1664 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1665 | | - aConstraints.gridx = 0; |
---|
1666 | | - aConstraints.gridy += 1; |
---|
1667 | | - aConstraints.gridwidth = 1; |
---|
| 1661 | + cGridBag ambient = new cGridBag(); |
---|
| 1662 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 1663 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1664 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1665 | + globalSection.add(ambient); |
---|
1668 | 1666 | |
---|
1669 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1670 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1671 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1672 | | - aConstraints.gridx += 1; |
---|
1673 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1674 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1675 | | - aConstraints.gridx = 0; |
---|
1676 | | - aConstraints.gridy += 1; |
---|
1677 | | - aConstraints.gridwidth = 1; |
---|
1678 | | - aConstraints.weighty = 0; |
---|
| 1667 | + cGridBag backlit = new cGridBag(); |
---|
| 1668 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 1669 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1670 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1671 | + globalSection.add(backlit); |
---|
1679 | 1672 | |
---|
1680 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1681 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1682 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1683 | | - aConstraints.gridx += 1; |
---|
1684 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1685 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1686 | | - aConstraints.gridx = 0; |
---|
1687 | | - aConstraints.gridy += 1; |
---|
1688 | | - aConstraints.gridwidth = 1; |
---|
| 1673 | + cGridBag opacity = new cGridBag(); |
---|
| 1674 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1675 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1676 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1677 | + globalSection.add(opacity); |
---|
1689 | 1678 | |
---|
1690 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1691 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1692 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1693 | | - aConstraints.gridx += 1; |
---|
1694 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1695 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1696 | | - aConstraints.gridx = 0; |
---|
1697 | | - aConstraints.gridy += 1; |
---|
1698 | | - aConstraints.gridwidth = 1; |
---|
| 1679 | + panel.add(new JSeparator()); |
---|
| 1680 | + |
---|
| 1681 | + panel.add(globalSection); |
---|
| 1682 | + |
---|
| 1683 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1684 | + |
---|
| 1685 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1699 | 1686 | |
---|
1700 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1701 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1702 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1703 | | - aConstraints.gridx += 1; |
---|
1704 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1705 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1706 | | - aConstraints.gridx = 0; |
---|
1707 | | - aConstraints.gridy += 1; |
---|
1708 | | - aConstraints.gridwidth = 1; |
---|
| 1687 | + cGridBag bump = new cGridBag(); |
---|
| 1688 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 1689 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1690 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1691 | + textureSection.add(bump); |
---|
1709 | 1692 | |
---|
1710 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1711 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1712 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1713 | | - aConstraints.gridx += 1; |
---|
1714 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1715 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1716 | | - aConstraints.gridx = 0; |
---|
1717 | | - aConstraints.gridy += 1; |
---|
1718 | | - aConstraints.gridwidth = 1; |
---|
| 1693 | + cGridBag noise = new cGridBag(); |
---|
| 1694 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 1695 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1696 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 1697 | + textureSection.add(noise); |
---|
1719 | 1698 | |
---|
1720 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1721 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1722 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1723 | | - aConstraints.gridx += 1; |
---|
1724 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1725 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1726 | | - aConstraints.gridx = 0; |
---|
1727 | | - aConstraints.gridy += 1; |
---|
1728 | | - aConstraints.gridwidth = 1; |
---|
| 1699 | + cGridBag power = new cGridBag(); |
---|
| 1700 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 1701 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1702 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 1703 | + textureSection.add(power); |
---|
1729 | 1704 | |
---|
1730 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1731 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1732 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1733 | | - aConstraints.gridx += 1; |
---|
1734 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1735 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1736 | | - aConstraints.gridx = 0; |
---|
1737 | | - aConstraints.gridy += 1; |
---|
1738 | | - aConstraints.gridwidth = 1; |
---|
| 1705 | + cGridBag borderfade = new cGridBag(); |
---|
| 1706 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 1707 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1708 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1709 | + textureSection.add(borderfade); |
---|
1739 | 1710 | |
---|
1740 | | - //aConstraints.weighty = 1; |
---|
1741 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1742 | | - //aConstraints.gridx += 1; |
---|
1743 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1744 | | - aConstraints.weighty = 0; |
---|
| 1711 | + cGridBag fog = new cGridBag(); |
---|
| 1712 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 1713 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1714 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 1715 | + textureSection.add(fog); |
---|
1745 | 1716 | |
---|
1746 | | - aConstraints.gridx = 0; |
---|
1747 | | - aConstraints.gridy = 0; |
---|
1748 | | - aConstraints.gridwidth = 1; |
---|
| 1717 | + cGridBag opacityPower = new cGridBag(); |
---|
| 1718 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 1719 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1720 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 1721 | + textureSection.add(opacityPower); |
---|
| 1722 | + |
---|
| 1723 | + panel.add(new JSeparator()); |
---|
| 1724 | + |
---|
| 1725 | + panel.add(textureSection); |
---|
| 1726 | + |
---|
| 1727 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1749 | 1728 | |
---|
1750 | 1729 | SetMaterial(copy); // .GetMaterial()); |
---|
1751 | 1730 | |
---|
1752 | | - colorField.addChangeListener(this); |
---|
1753 | | - modulationField.addChangeListener(this); |
---|
| 1731 | + //colorField.addChangeListener(this); |
---|
| 1732 | +// modulationField.addChangeListener(this); |
---|
1754 | 1733 | metalnessField.addChangeListener(this); |
---|
1755 | 1734 | diffuseField.addChangeListener(this); |
---|
1756 | 1735 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1780 | 1759 | opacityPowerField.addChangeListener(this); |
---|
1781 | 1760 | /**/ |
---|
1782 | 1761 | |
---|
1783 | | - resetSlidersButton.addActionListener(this); |
---|
1784 | 1762 | clearMaterialButton.addActionListener(this); |
---|
1785 | 1763 | createMaterialButton.addActionListener(this); |
---|
1786 | | - |
---|
1787 | | - propagateToggle.addItemListener(this); |
---|
1788 | | - multiplyToggle.addItemListener(this); |
---|
| 1764 | + |
---|
| 1765 | + if (Globals.ADVANCED) |
---|
| 1766 | + { |
---|
| 1767 | + resetSlidersButton.addActionListener(this); |
---|
| 1768 | + propagateToggle.addItemListener(this); |
---|
| 1769 | + multiplyToggle.addItemListener(this); |
---|
| 1770 | + } |
---|
1789 | 1771 | } |
---|
1790 | 1772 | |
---|
1791 | 1773 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
2562 | 2544 | } |
---|
2563 | 2545 | if (input == null) |
---|
2564 | 2546 | { |
---|
| 2547 | + new Exception().printStackTrace(); |
---|
2565 | 2548 | System.exit(0); |
---|
2566 | 2549 | } |
---|
2567 | 2550 | |
---|
.. | .. |
---|
2776 | 2759 | return; |
---|
2777 | 2760 | } |
---|
2778 | 2761 | |
---|
2779 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2762 | + if (multiplyToggle != null) |
---|
| 2763 | + multiplyToggle.setSelected(mat.multiply); |
---|
2780 | 2764 | |
---|
2781 | 2765 | assert (object.projectedVertices != null); |
---|
2782 | 2766 | |
---|
.. | .. |
---|
2958 | 2942 | // june 2013 copy.HardTouch(); |
---|
2959 | 2943 | cameraView.repaint(); |
---|
2960 | 2944 | return; |
---|
2961 | | - } else if (event.getSource() == toggleFullItem) |
---|
| 2945 | + } else if (event.getSource() == toggleTimelineItem) |
---|
2962 | 2946 | { |
---|
2963 | | - if (CameraPane.FULLSCREEN) |
---|
| 2947 | + timeline ^= true; |
---|
| 2948 | + |
---|
| 2949 | + if (timeline) |
---|
2964 | 2950 | { |
---|
2965 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
2966 | | - framePanel.add(bigThree); |
---|
2967 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
2968 | | - } else |
---|
2969 | | - { |
---|
2970 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
2971 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 2951 | + centralPanel.remove(cameraView); |
---|
| 2952 | + cameraPanel.add(cameraView); |
---|
| 2953 | + centralPanel.add(cameraPanel); |
---|
| 2954 | + frame.setJMenuBar(timelineMenubar); |
---|
| 2955 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 2956 | + if (!CameraPane.FULLSCREEN) |
---|
| 2957 | + ToggleFullScreen(); |
---|
| 2958 | + toggleFullScreenItem.setEnabled(false); |
---|
2972 | 2959 | } |
---|
| 2960 | + else |
---|
| 2961 | + { |
---|
| 2962 | + centralPanel.remove(cameraPanel); |
---|
| 2963 | + centralPanel.add(cameraView); |
---|
| 2964 | + frame.setJMenuBar(null); |
---|
| 2965 | + if (!wasFullScreen) |
---|
| 2966 | + ToggleFullScreen(); |
---|
| 2967 | + toggleFullScreenItem.setEnabled(true); |
---|
| 2968 | + } |
---|
| 2969 | + |
---|
2973 | 2970 | frame.validate(); |
---|
2974 | | - cameraView.ToggleFullScreen(); |
---|
| 2971 | + return; |
---|
| 2972 | + } else if (event.getSource() == toggleFullScreenItem) |
---|
| 2973 | + { |
---|
| 2974 | + ToggleFullScreen(); |
---|
| 2975 | + frame.validate(); |
---|
2975 | 2976 | |
---|
2976 | 2977 | return; |
---|
2977 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 2978 | + } else if (event.getSource() == toggleSwitchItem) |
---|
2978 | 2979 | { |
---|
2979 | 2980 | cameraView.ToggleRandom(); |
---|
2980 | 2981 | cameraView.repaint(); |
---|
.. | .. |
---|
3019 | 3020 | if (event.getSource() == randomCB) |
---|
3020 | 3021 | { |
---|
3021 | 3022 | copy.random ^= true; |
---|
| 3023 | + objEditor.refreshContents(); |
---|
3022 | 3024 | return; |
---|
3023 | 3025 | } |
---|
3024 | 3026 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3081 | 3083 | objEditor.refreshContents(); |
---|
3082 | 3084 | } else if (event.getSource() == stepItem) |
---|
3083 | 3085 | { |
---|
3084 | | - cameraView.ONESTEP = true; |
---|
| 3086 | + //cameraView.ONESTEP = true; |
---|
| 3087 | + Globals.ONESTEP = true; |
---|
3085 | 3088 | cameraView.repaint(); |
---|
3086 | 3089 | return; |
---|
3087 | 3090 | } else if (event.getSource() == stepButton) |
---|
.. | .. |
---|
3220 | 3223 | cameraView.RevertCamera(); |
---|
3221 | 3224 | cameraView.repaint(); |
---|
3222 | 3225 | return; |
---|
3223 | | - } else if (event.getSource() == textureButton) |
---|
3224 | | - { |
---|
3225 | | - return; // true; |
---|
| 3226 | +// } else if (event.getSource() == textureButton) |
---|
| 3227 | +// { |
---|
| 3228 | +// return; // true; |
---|
3226 | 3229 | } else // combos... |
---|
3227 | 3230 | if (event.getSource() == texresMenu) |
---|
3228 | 3231 | { |
---|
.. | .. |
---|
3238 | 3241 | |
---|
3239 | 3242 | void ToggleAnimation() |
---|
3240 | 3243 | { |
---|
3241 | | - if (!CameraPane.ANIMATION) |
---|
| 3244 | + if (!Globals.ANIMATION) |
---|
3242 | 3245 | { |
---|
3243 | 3246 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3244 | | - browser.show(); |
---|
| 3247 | + browser.setVisible(true); |
---|
3245 | 3248 | String filename = browser.getFile(); |
---|
3246 | 3249 | if (filename != null && filename.length() > 0) |
---|
3247 | 3250 | { |
---|
3248 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3251 | + Globals.filename = browser.getDirectory() + filename; |
---|
3249 | 3252 | //CameraPane.framecount = 0; |
---|
3250 | | - CameraPane.imagecount = 0; |
---|
| 3253 | + Globals.imagecount = 0; |
---|
3251 | 3254 | |
---|
3252 | | - CameraPane.ANIMATION ^= true; |
---|
| 3255 | + Globals.ANIMATION ^= true; |
---|
3253 | 3256 | |
---|
3254 | 3257 | GrafreeD.wav.cursor = 0; |
---|
3255 | 3258 | GrafreeD.wav.loop = 0; |
---|
3256 | 3259 | } |
---|
3257 | 3260 | } else |
---|
3258 | 3261 | { |
---|
3259 | | - CameraPane.ANIMATION ^= true; |
---|
| 3262 | + Globals.ANIMATION ^= true; |
---|
3260 | 3263 | } |
---|
3261 | 3264 | } |
---|
3262 | 3265 | |
---|
.. | .. |
---|
3273 | 3276 | callee.refreshContents(); |
---|
3274 | 3277 | } else |
---|
3275 | 3278 | { |
---|
| 3279 | + new Exception().printStackTrace(); |
---|
3276 | 3280 | System.exit(0); |
---|
3277 | 3281 | } |
---|
3278 | 3282 | } |
---|
.. | .. |
---|
3302 | 3306 | void CreateMaterial() |
---|
3303 | 3307 | { |
---|
3304 | 3308 | //copy.ClearMaterial(); // PATCH |
---|
3305 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3309 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3306 | 3310 | if (copy.selection.size() > 0) |
---|
3307 | 3311 | //SetMaterial(copy); |
---|
3308 | 3312 | { |
---|
.. | .. |
---|
3361 | 3365 | { |
---|
3362 | 3366 | copy.ResetBlockLoop(); // temporary problem |
---|
3363 | 3367 | |
---|
3364 | | - boolean random = CameraPane.RANDOM; |
---|
3365 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3368 | + boolean random = CameraPane.SWITCH; |
---|
| 3369 | + CameraPane.SWITCH = false; // parse everything |
---|
3366 | 3370 | copy.ResetDisplayList(); |
---|
3367 | 3371 | copy.HardTouch(); |
---|
3368 | | - CameraPane.RANDOM = random; |
---|
| 3372 | + CameraPane.SWITCH = random; |
---|
3369 | 3373 | } |
---|
3370 | 3374 | |
---|
3371 | 3375 | // public void applySelf() |
---|
.. | .. |
---|
3435 | 3439 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3436 | 3440 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3437 | 3441 | |
---|
3438 | | - if (!NumberSlider.frozen) |
---|
| 3442 | + if (!cNumberSlider.frozen) |
---|
3439 | 3443 | { |
---|
3440 | 3444 | //System.out.println("Propagate = " + propagate); |
---|
3441 | 3445 | copy.UpdateMaterial(anchor, current, propagate); |
---|
.. | .. |
---|
3483 | 3487 | || e.getSource() == apertureField |
---|
3484 | 3488 | || e.getSource() == shadowblurField) |
---|
3485 | 3489 | { |
---|
| 3490 | + new Exception().printStackTrace(); |
---|
3486 | 3491 | System.exit(0); |
---|
3487 | 3492 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3488 | 3493 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3509 | 3514 | //System.out.println("PARENT = " + parent); |
---|
3510 | 3515 | //if (parent != null) |
---|
3511 | 3516 | // parent.applySelf(); |
---|
3512 | | - refreshContents(); |
---|
| 3517 | + if (e.getSource() == normalpushField) |
---|
| 3518 | + { |
---|
| 3519 | + objEditor.refreshContents(); |
---|
| 3520 | + //Refresh(); |
---|
| 3521 | + } |
---|
| 3522 | + else |
---|
| 3523 | + refreshContents(); |
---|
3513 | 3524 | // ??? client.refreshEditWindow(); |
---|
3514 | 3525 | } |
---|
3515 | 3526 | //else |
---|
.. | .. |
---|
3521 | 3532 | //group.name = nameField.getText(); |
---|
3522 | 3533 | //objEditor.applySelf(); |
---|
3523 | 3534 | |
---|
3524 | | - assert (objEditor == this); |
---|
| 3535 | + // OCT2018: assert (objEditor == this); |
---|
3525 | 3536 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3526 | 3537 | //super.applySelf() |
---|
3527 | 3538 | ; else |
---|
.. | .. |
---|
3545 | 3556 | objEditor.copy = keep; |
---|
3546 | 3557 | } |
---|
3547 | 3558 | } |
---|
| 3559 | + |
---|
| 3560 | + if (normalpushField != null) |
---|
| 3561 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
3548 | 3562 | } |
---|
3549 | 3563 | |
---|
3550 | 3564 | void SnapObject() |
---|
3551 | 3565 | { |
---|
3552 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3553 | | - SnapObject(obj); |
---|
| 3566 | + if (copy.selection.size() > 0) |
---|
| 3567 | + { |
---|
| 3568 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 3569 | + SnapObject(obj); |
---|
| 3570 | + } |
---|
3554 | 3571 | } |
---|
3555 | 3572 | |
---|
3556 | 3573 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
3796 | 3813 | |
---|
3797 | 3814 | radioPanel.revalidate(); |
---|
3798 | 3815 | radioPanel.repaint(); |
---|
3799 | | - ctrlPanel.revalidate(); // ? new |
---|
| 3816 | + ctrlPanel.validate(); // ? new |
---|
3800 | 3817 | ctrlPanel.repaint(); |
---|
3801 | 3818 | } |
---|
3802 | 3819 | } |
---|
.. | .. |
---|
4442 | 4459 | //MenuItem normalLensItem; |
---|
4443 | 4460 | MenuItem editCameraItem; |
---|
4444 | 4461 | MenuItem revertCameraItem; |
---|
4445 | | - CheckboxMenuItem toggleLiveItem; |
---|
4446 | 4462 | MenuItem stepItem; |
---|
4447 | | - CheckboxMenuItem toggleFullItem; |
---|
| 4463 | + CheckboxMenuItem toggleLiveItem; |
---|
| 4464 | + CheckboxMenuItem toggleFullScreenItem; |
---|
| 4465 | + CheckboxMenuItem toggleTimelineItem; |
---|
4448 | 4466 | CheckboxMenuItem toggleRenderItem; |
---|
4449 | 4467 | CheckboxMenuItem toggleDebugItem; |
---|
4450 | 4468 | CheckboxMenuItem toggleFrustumItem; |
---|
4451 | 4469 | CheckboxMenuItem toggleFootContactItem; |
---|
4452 | 4470 | CheckboxMenuItem toggleDLItem; |
---|
4453 | 4471 | CheckboxMenuItem toggleTextureItem; |
---|
4454 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 4472 | + CheckboxMenuItem toggleSwitchItem; |
---|
4455 | 4473 | CheckboxMenuItem toggleRootItem; |
---|
4456 | 4474 | CheckboxMenuItem animationItem; |
---|
4457 | 4475 | CheckboxMenuItem toggleHandleItem; |
---|
.. | .. |
---|
4459 | 4477 | JSplitPane mainPanel; |
---|
4460 | 4478 | JScrollPane scrollpane; |
---|
4461 | 4479 | JPanel toolbarPanel; |
---|
4462 | | - JPanel treePanel; |
---|
| 4480 | + cGridBag treePanel; |
---|
4463 | 4481 | JPanel radioPanel; |
---|
4464 | 4482 | ButtonGroup buttonGroup; |
---|
4465 | | - JPanel ctrlPanel; |
---|
4466 | | - JPanel materialPanel; |
---|
| 4483 | + cGridBag ctrlPanel; |
---|
| 4484 | + cGridBag materialPanel; |
---|
4467 | 4485 | JScrollPane infoPanel; |
---|
4468 | | - JPanel optionsPanel; |
---|
| 4486 | + cGridBag optionsPanel; |
---|
4469 | 4487 | JTabbedPane objectPanel; |
---|
4470 | | - JPanel XYZPanel; |
---|
| 4488 | + cGridBag XYZPanel; |
---|
4471 | 4489 | JSplitPane gridPanel; |
---|
4472 | 4490 | JSplitPane bigPanel; |
---|
4473 | | - JPanel bigThree; |
---|
4474 | | - JTabbedPane jtp; |
---|
4475 | | - JPanel cameraPanel; |
---|
| 4491 | + cGridBag bigThree; |
---|
| 4492 | + cGridBag scenePanel; |
---|
| 4493 | + cGridBag centralPanel; |
---|
| 4494 | + JSplitPane cameraPanel; |
---|
| 4495 | + JPanel timelinePanel; |
---|
| 4496 | + JMenuBar timelineMenubar; |
---|
4476 | 4497 | JSplitPane framePanel; |
---|
4477 | 4498 | JTextArea/*Field*/ nameField; |
---|
4478 | | - cButton textureButton; |
---|
| 4499 | + //cButton textureButton; |
---|
4479 | 4500 | cButton okButton; |
---|
4480 | 4501 | cButton applyButton; |
---|
4481 | 4502 | cButton cancelButton; |
---|
.. | .. |
---|
4522 | 4543 | // MATERIAL |
---|
4523 | 4544 | JLabel materialLabel; |
---|
4524 | 4545 | JLabel colorLabel; |
---|
4525 | | - NumberSlider colorField; |
---|
| 4546 | + cNumberSlider colorField; |
---|
4526 | 4547 | JLabel modulationLabel; |
---|
4527 | | - NumberSlider modulationField; |
---|
| 4548 | + cNumberSlider modulationField; |
---|
4528 | 4549 | JLabel metalnessLabel; |
---|
4529 | | - NumberSlider metalnessField; |
---|
| 4550 | + cNumberSlider metalnessField; |
---|
4530 | 4551 | JLabel diffuseLabel; |
---|
4531 | | - NumberSlider diffuseField; |
---|
| 4552 | + cNumberSlider diffuseField; |
---|
4532 | 4553 | JLabel specularLabel; |
---|
4533 | | - NumberSlider specularField; |
---|
| 4554 | + cNumberSlider specularField; |
---|
4534 | 4555 | JLabel shininessLabel; |
---|
4535 | | - NumberSlider shininessField; |
---|
| 4556 | + cNumberSlider shininessField; |
---|
4536 | 4557 | JLabel shiftLabel; |
---|
4537 | | - NumberSlider shiftField; |
---|
| 4558 | + cNumberSlider shiftField; |
---|
4538 | 4559 | JLabel ambientLabel; |
---|
4539 | | - NumberSlider ambientField; |
---|
| 4560 | + cNumberSlider ambientField; |
---|
4540 | 4561 | JLabel lightareaLabel; |
---|
4541 | | - NumberSlider lightareaField; |
---|
| 4562 | + cNumberSlider lightareaField; |
---|
4542 | 4563 | JLabel diffusenessLabel; |
---|
4543 | | - NumberSlider diffusenessField; |
---|
| 4564 | + cNumberSlider diffusenessField; |
---|
4544 | 4565 | JLabel velvetLabel; |
---|
4545 | | - NumberSlider velvetField; |
---|
| 4566 | + cNumberSlider velvetField; |
---|
4546 | 4567 | JLabel sheenLabel; |
---|
4547 | | - NumberSlider sheenField; |
---|
| 4568 | + cNumberSlider sheenField; |
---|
4548 | 4569 | JLabel subsurfaceLabel; |
---|
4549 | | - NumberSlider subsurfaceField; |
---|
| 4570 | + cNumberSlider subsurfaceField; |
---|
4550 | 4571 | //JLabel bumpLabel; |
---|
4551 | 4572 | //NumberSlider bumpField; |
---|
4552 | 4573 | JLabel backlitLabel; |
---|
4553 | | - NumberSlider backlitField; |
---|
| 4574 | + cNumberSlider backlitField; |
---|
4554 | 4575 | JLabel anisoLabel; |
---|
4555 | | - NumberSlider anisoField; |
---|
| 4576 | + cNumberSlider anisoField; |
---|
4556 | 4577 | JLabel anisoVLabel; |
---|
4557 | | - NumberSlider anisoVField; |
---|
| 4578 | + cNumberSlider anisoVField; |
---|
4558 | 4579 | JLabel cameraLabel; |
---|
4559 | | - NumberSlider cameraField; |
---|
| 4580 | + cNumberSlider cameraField; |
---|
4560 | 4581 | JLabel selfshadowLabel; |
---|
4561 | | - NumberSlider selfshadowField; |
---|
| 4582 | + cNumberSlider selfshadowField; |
---|
4562 | 4583 | JLabel shadowLabel; |
---|
4563 | | - NumberSlider shadowField; |
---|
| 4584 | + cNumberSlider shadowField; |
---|
4564 | 4585 | JLabel textureLabel; |
---|
4565 | | - NumberSlider textureField; |
---|
| 4586 | + cNumberSlider textureField; |
---|
4566 | 4587 | JLabel opacityLabel; |
---|
4567 | | - NumberSlider opacityField; |
---|
| 4588 | + cNumberSlider opacityField; |
---|
4568 | 4589 | JLabel fakedepthLabel; |
---|
4569 | | - NumberSlider fakedepthField; |
---|
| 4590 | + cNumberSlider fakedepthField; |
---|
4570 | 4591 | JLabel shadowbiasLabel; |
---|
4571 | | - NumberSlider shadowbiasField; |
---|
| 4592 | + cNumberSlider shadowbiasField; |
---|
4572 | 4593 | JLabel bumpLabel; |
---|
4573 | | - NumberSlider bumpField; |
---|
| 4594 | + cNumberSlider bumpField; |
---|
4574 | 4595 | JLabel noiseLabel; |
---|
4575 | | - NumberSlider noiseField; |
---|
| 4596 | + cNumberSlider noiseField; |
---|
4576 | 4597 | JLabel powerLabel; |
---|
4577 | | - NumberSlider powerField; |
---|
| 4598 | + cNumberSlider powerField; |
---|
4578 | 4599 | JLabel borderfadeLabel; |
---|
4579 | | - NumberSlider borderfadeField; |
---|
| 4600 | + cNumberSlider borderfadeField; |
---|
4580 | 4601 | JLabel fogLabel; |
---|
4581 | | - NumberSlider fogField; |
---|
| 4602 | + cNumberSlider fogField; |
---|
4582 | 4603 | JLabel opacityPowerLabel; |
---|
4583 | | - NumberSlider opacityPowerField; |
---|
| 4604 | + cNumberSlider opacityPowerField; |
---|
4584 | 4605 | JTree jTree; |
---|
4585 | 4606 | //ObjectUI parent; |
---|
| 4607 | + |
---|
| 4608 | + cNumberSlider normalpushField; |
---|
4586 | 4609 | } |
---|