.. | .. |
---|
28 | 28 | iSendInfo |
---|
29 | 29 | //KeyListener |
---|
30 | 30 | { |
---|
| 31 | + boolean timeline; |
---|
| 32 | + boolean wasFullScreen; |
---|
31 | 33 | |
---|
32 | 34 | // SCRIPT |
---|
33 | 35 | |
---|
.. | .. |
---|
158 | 160 | objEditor.ctrlPanel.remove(slowerButton); |
---|
159 | 161 | objEditor.ctrlPanel.remove(fasterButton); |
---|
160 | 162 | objEditor.ctrlPanel.remove(remarkButton); |
---|
| 163 | + |
---|
| 164 | + Remove(normalpushField); |
---|
161 | 165 | } |
---|
162 | 166 | |
---|
163 | 167 | public ObjEditor GetEditor() |
---|
164 | 168 | { |
---|
165 | 169 | return objEditor; //.GetEditor(); |
---|
166 | 170 | } |
---|
| 171 | + |
---|
| 172 | + // Sometimes myself, sometimes my callee's. |
---|
167 | 173 | ObjEditor objEditor; |
---|
168 | 174 | |
---|
169 | 175 | /* |
---|
.. | .. |
---|
238 | 244 | //if (!isDisplayable()) |
---|
239 | 245 | //setUndecorated(true); |
---|
240 | 246 | |
---|
241 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 247 | + //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
242 | 248 | client = inClient; |
---|
243 | 249 | copy = localCopy; |
---|
244 | 250 | copy.editWindow = this; |
---|
.. | .. |
---|
292 | 298 | //normalLensItem.addActionListener(this); |
---|
293 | 299 | cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
294 | 300 | revertCameraItem.addActionListener(this); |
---|
| 301 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 302 | + toggleTimelineItem.addItemListener(this); |
---|
295 | 303 | cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
296 | 304 | toggleFullScreenItem.addItemListener(this); |
---|
297 | 305 | toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
298 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
299 | | - toggleTimelineItem.addItemListener(this); |
---|
300 | 306 | cameraMenu.add("-"); |
---|
301 | 307 | cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
302 | 308 | toggleTextureItem.addItemListener(this); |
---|
.. | .. |
---|
596 | 602 | } |
---|
597 | 603 | } |
---|
598 | 604 | |
---|
| 605 | + void ToggleFullScreen() |
---|
| 606 | + { |
---|
| 607 | + if (CameraPane.FULLSCREEN) |
---|
| 608 | + { |
---|
| 609 | + frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 610 | + framePanel.add(bigThree); |
---|
| 611 | + frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 612 | + } else |
---|
| 613 | + { |
---|
| 614 | + frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 615 | + framePanel.remove(bigThree); |
---|
| 616 | + frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 617 | + } |
---|
| 618 | + cameraView.ToggleFullScreen(); |
---|
| 619 | + } |
---|
| 620 | + |
---|
599 | 621 | private JTextArea createTextPane() |
---|
600 | 622 | { |
---|
601 | 623 | String[] initString = |
---|
.. | .. |
---|
796 | 818 | |
---|
797 | 819 | aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
798 | 820 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
799 | | - aConstraints.gridwidth = 2; |
---|
| 821 | + aConstraints.gridwidth = 1; |
---|
800 | 822 | ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
801 | 823 | aConstraints.gridx += 1; |
---|
802 | 824 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
965 | 987 | |
---|
966 | 988 | Return(); |
---|
967 | 989 | |
---|
| 990 | + normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
| 991 | + Return(); |
---|
| 992 | + |
---|
968 | 993 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
969 | 994 | // ObjEditor.aConstraints.gridx += 1; |
---|
970 | 995 | |
---|
.. | .. |
---|
1428 | 1453 | aConstraints.gridx += 1; |
---|
1429 | 1454 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1430 | 1455 | //aConstraints.weightx = 0; |
---|
1431 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1456 | + ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1432 | 1457 | aConstraints.gridx = 0; |
---|
1433 | 1458 | aConstraints.gridy += 1; |
---|
1434 | 1459 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1438 | 1463 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1439 | 1464 | aConstraints.gridx += 1; |
---|
1440 | 1465 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1441 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1466 | + ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1442 | 1467 | aConstraints.gridx = 0; |
---|
1443 | 1468 | aConstraints.gridy += 1; |
---|
1444 | 1469 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1448 | 1473 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1449 | 1474 | aConstraints.gridx += 1; |
---|
1450 | 1475 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1451 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1476 | + ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1452 | 1477 | aConstraints.gridx = 0; |
---|
1453 | 1478 | aConstraints.gridy += 1; |
---|
1454 | 1479 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1458 | 1483 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1459 | 1484 | aConstraints.gridx += 1; |
---|
1460 | 1485 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1461 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1486 | + ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1462 | 1487 | aConstraints.gridx = 0; |
---|
1463 | 1488 | aConstraints.gridy += 1; |
---|
1464 | 1489 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1468 | 1493 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1469 | 1494 | aConstraints.gridx += 1; |
---|
1470 | 1495 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1471 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1496 | + ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1472 | 1497 | aConstraints.gridx = 0; |
---|
1473 | 1498 | aConstraints.gridy += 1; |
---|
1474 | 1499 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1537 | 1562 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1538 | 1563 | aConstraints.gridx += 1; |
---|
1539 | 1564 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1540 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1565 | + ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1541 | 1566 | aConstraints.gridx = 0; |
---|
1542 | 1567 | aConstraints.gridy += 1; |
---|
1543 | 1568 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1606 | 1631 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1607 | 1632 | aConstraints.gridx += 1; |
---|
1608 | 1633 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1609 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1634 | + ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1610 | 1635 | aConstraints.gridx = 0; |
---|
1611 | 1636 | aConstraints.gridy += 1; |
---|
1612 | 1637 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1677 | 1702 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1678 | 1703 | aConstraints.gridx += 1; |
---|
1679 | 1704 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1680 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1705 | + ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1681 | 1706 | aConstraints.gridx = 0; |
---|
1682 | 1707 | aConstraints.gridy += 1; |
---|
1683 | 1708 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2966 | 2991 | return; |
---|
2967 | 2992 | } else if (event.getSource() == toggleTimelineItem) |
---|
2968 | 2993 | { |
---|
2969 | | - copy.timeline ^= true; |
---|
| 2994 | + timeline ^= true; |
---|
2970 | 2995 | |
---|
2971 | | - if (copy.timeline) |
---|
| 2996 | + if (timeline) |
---|
2972 | 2997 | { |
---|
2973 | 2998 | centralPanel.remove(cameraView); |
---|
2974 | 2999 | centralPanel.add(timelinePanel); |
---|
2975 | 3000 | frame.setJMenuBar(timelineMenubar); |
---|
| 3001 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 3002 | + if (!CameraPane.FULLSCREEN) |
---|
| 3003 | + ToggleFullScreen(); |
---|
| 3004 | + toggleFullScreenItem.setEnabled(false); |
---|
2976 | 3005 | } |
---|
2977 | 3006 | else |
---|
2978 | 3007 | { |
---|
2979 | 3008 | centralPanel.remove(timelinePanel); |
---|
2980 | 3009 | centralPanel.add(cameraView); |
---|
2981 | 3010 | frame.setJMenuBar(null); |
---|
| 3011 | + if (!wasFullScreen) |
---|
| 3012 | + ToggleFullScreen(); |
---|
| 3013 | + toggleFullScreenItem.setEnabled(true); |
---|
2982 | 3014 | } |
---|
2983 | 3015 | |
---|
2984 | 3016 | frame.validate(); |
---|
2985 | 3017 | return; |
---|
2986 | 3018 | } else if (event.getSource() == toggleFullScreenItem) |
---|
2987 | 3019 | { |
---|
2988 | | - if (CameraPane.FULLSCREEN) |
---|
2989 | | - { |
---|
2990 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
2991 | | - framePanel.add(bigThree); |
---|
2992 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
2993 | | - } else |
---|
2994 | | - { |
---|
2995 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
2996 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
2997 | | - } |
---|
| 3020 | + ToggleFullScreen(); |
---|
2998 | 3021 | frame.validate(); |
---|
2999 | | - cameraView.ToggleFullScreen(); |
---|
3000 | 3022 | |
---|
3001 | 3023 | return; |
---|
3002 | 3024 | } else if (event.getSource() == toggleRandomItem) |
---|
.. | .. |
---|
3534 | 3556 | //System.out.println("PARENT = " + parent); |
---|
3535 | 3557 | //if (parent != null) |
---|
3536 | 3558 | // parent.applySelf(); |
---|
3537 | | - refreshContents(); |
---|
| 3559 | + if (e.getSource() == normalpushField) |
---|
| 3560 | + { |
---|
| 3561 | + objEditor.refreshContents(); |
---|
| 3562 | + //Refresh(); |
---|
| 3563 | + } |
---|
| 3564 | + else |
---|
| 3565 | + refreshContents(); |
---|
3538 | 3566 | // ??? client.refreshEditWindow(); |
---|
3539 | 3567 | } |
---|
3540 | 3568 | //else |
---|
.. | .. |
---|
3546 | 3574 | //group.name = nameField.getText(); |
---|
3547 | 3575 | //objEditor.applySelf(); |
---|
3548 | 3576 | |
---|
3549 | | - assert (objEditor == this); |
---|
| 3577 | + // OCT2018: assert (objEditor == this); |
---|
3550 | 3578 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3551 | 3579 | //super.applySelf() |
---|
3552 | 3580 | ; else |
---|
.. | .. |
---|
3570 | 3598 | objEditor.copy = keep; |
---|
3571 | 3599 | } |
---|
3572 | 3600 | } |
---|
| 3601 | + |
---|
| 3602 | + if (normalpushField != null) |
---|
| 3603 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
3573 | 3604 | } |
---|
3574 | 3605 | |
---|
3575 | 3606 | void SnapObject() |
---|
3576 | 3607 | { |
---|
3577 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3578 | | - SnapObject(obj); |
---|
| 3608 | + if (copy.selection.size() > 0) |
---|
| 3609 | + { |
---|
| 3610 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 3611 | + SnapObject(obj); |
---|
| 3612 | + } |
---|
3579 | 3613 | } |
---|
3580 | 3614 | |
---|
3581 | 3615 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
4611 | 4645 | NumberSlider opacityPowerField; |
---|
4612 | 4646 | JTree jTree; |
---|
4613 | 4647 | //ObjectUI parent; |
---|
| 4648 | + |
---|
| 4649 | + NumberSlider normalpushField; |
---|
4614 | 4650 | } |
---|