.. | .. |
---|
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 | |
---|
.. | .. |
---|
1164 | 1189 | timelinePanel = new JPanel(new BorderLayout()); |
---|
1165 | 1190 | timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1166 | 1191 | |
---|
| 1192 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1193 | + cameraPanel.setContinuousLayout(true); |
---|
| 1194 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1195 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1196 | +// cameraPanel.setDividerSize(9); |
---|
| 1197 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1198 | + |
---|
1167 | 1199 | centralPanel.add(cameraView); |
---|
1168 | 1200 | //frame.setJMenuBar(timelineMenubar); |
---|
1169 | 1201 | //centralPanel.add(timelinePanel); |
---|
.. | .. |
---|
1428 | 1460 | aConstraints.gridx += 1; |
---|
1429 | 1461 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1430 | 1462 | //aConstraints.weightx = 0; |
---|
1431 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1463 | + ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1432 | 1464 | aConstraints.gridx = 0; |
---|
1433 | 1465 | aConstraints.gridy += 1; |
---|
1434 | 1466 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1438 | 1470 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1439 | 1471 | aConstraints.gridx += 1; |
---|
1440 | 1472 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1441 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1473 | + ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1442 | 1474 | aConstraints.gridx = 0; |
---|
1443 | 1475 | aConstraints.gridy += 1; |
---|
1444 | 1476 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1448 | 1480 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1449 | 1481 | aConstraints.gridx += 1; |
---|
1450 | 1482 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1451 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1483 | + ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1452 | 1484 | aConstraints.gridx = 0; |
---|
1453 | 1485 | aConstraints.gridy += 1; |
---|
1454 | 1486 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1458 | 1490 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1459 | 1491 | aConstraints.gridx += 1; |
---|
1460 | 1492 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1461 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1493 | + ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1462 | 1494 | aConstraints.gridx = 0; |
---|
1463 | 1495 | aConstraints.gridy += 1; |
---|
1464 | 1496 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1468 | 1500 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1469 | 1501 | aConstraints.gridx += 1; |
---|
1470 | 1502 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1471 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1503 | + ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1472 | 1504 | aConstraints.gridx = 0; |
---|
1473 | 1505 | aConstraints.gridy += 1; |
---|
1474 | 1506 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1537 | 1569 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1538 | 1570 | aConstraints.gridx += 1; |
---|
1539 | 1571 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1540 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1572 | + ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1541 | 1573 | aConstraints.gridx = 0; |
---|
1542 | 1574 | aConstraints.gridy += 1; |
---|
1543 | 1575 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1606 | 1638 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1607 | 1639 | aConstraints.gridx += 1; |
---|
1608 | 1640 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1609 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1641 | + ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1610 | 1642 | aConstraints.gridx = 0; |
---|
1611 | 1643 | aConstraints.gridy += 1; |
---|
1612 | 1644 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1677 | 1709 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1678 | 1710 | aConstraints.gridx += 1; |
---|
1679 | 1711 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1680 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1712 | + ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1681 | 1713 | aConstraints.gridx = 0; |
---|
1682 | 1714 | aConstraints.gridy += 1; |
---|
1683 | 1715 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2966 | 2998 | return; |
---|
2967 | 2999 | } else if (event.getSource() == toggleTimelineItem) |
---|
2968 | 3000 | { |
---|
2969 | | - copy.timeline ^= true; |
---|
| 3001 | + timeline ^= true; |
---|
2970 | 3002 | |
---|
2971 | | - if (copy.timeline) |
---|
| 3003 | + if (timeline) |
---|
2972 | 3004 | { |
---|
2973 | 3005 | centralPanel.remove(cameraView); |
---|
2974 | | - centralPanel.add(timelinePanel); |
---|
| 3006 | + cameraPanel.add(cameraView); |
---|
| 3007 | + centralPanel.add(cameraPanel); |
---|
2975 | 3008 | frame.setJMenuBar(timelineMenubar); |
---|
| 3009 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 3010 | + if (!CameraPane.FULLSCREEN) |
---|
| 3011 | + ToggleFullScreen(); |
---|
| 3012 | + toggleFullScreenItem.setEnabled(false); |
---|
2976 | 3013 | } |
---|
2977 | 3014 | else |
---|
2978 | 3015 | { |
---|
2979 | | - centralPanel.remove(timelinePanel); |
---|
| 3016 | + centralPanel.remove(cameraPanel); |
---|
2980 | 3017 | centralPanel.add(cameraView); |
---|
2981 | 3018 | frame.setJMenuBar(null); |
---|
| 3019 | + if (!wasFullScreen) |
---|
| 3020 | + ToggleFullScreen(); |
---|
| 3021 | + toggleFullScreenItem.setEnabled(true); |
---|
2982 | 3022 | } |
---|
2983 | 3023 | |
---|
2984 | 3024 | frame.validate(); |
---|
2985 | 3025 | return; |
---|
2986 | 3026 | } else if (event.getSource() == toggleFullScreenItem) |
---|
2987 | 3027 | { |
---|
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 | | - } |
---|
| 3028 | + ToggleFullScreen(); |
---|
2998 | 3029 | frame.validate(); |
---|
2999 | | - cameraView.ToggleFullScreen(); |
---|
3000 | 3030 | |
---|
3001 | 3031 | return; |
---|
3002 | 3032 | } else if (event.getSource() == toggleRandomItem) |
---|
.. | .. |
---|
3534 | 3564 | //System.out.println("PARENT = " + parent); |
---|
3535 | 3565 | //if (parent != null) |
---|
3536 | 3566 | // parent.applySelf(); |
---|
3537 | | - refreshContents(); |
---|
| 3567 | + if (e.getSource() == normalpushField) |
---|
| 3568 | + { |
---|
| 3569 | + objEditor.refreshContents(); |
---|
| 3570 | + //Refresh(); |
---|
| 3571 | + } |
---|
| 3572 | + else |
---|
| 3573 | + refreshContents(); |
---|
3538 | 3574 | // ??? client.refreshEditWindow(); |
---|
3539 | 3575 | } |
---|
3540 | 3576 | //else |
---|
.. | .. |
---|
3546 | 3582 | //group.name = nameField.getText(); |
---|
3547 | 3583 | //objEditor.applySelf(); |
---|
3548 | 3584 | |
---|
3549 | | - assert (objEditor == this); |
---|
| 3585 | + // OCT2018: assert (objEditor == this); |
---|
3550 | 3586 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3551 | 3587 | //super.applySelf() |
---|
3552 | 3588 | ; else |
---|
.. | .. |
---|
3570 | 3606 | objEditor.copy = keep; |
---|
3571 | 3607 | } |
---|
3572 | 3608 | } |
---|
| 3609 | + |
---|
| 3610 | + if (normalpushField != null) |
---|
| 3611 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
3573 | 3612 | } |
---|
3574 | 3613 | |
---|
3575 | 3614 | void SnapObject() |
---|
3576 | 3615 | { |
---|
3577 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3578 | | - SnapObject(obj); |
---|
| 3616 | + if (copy.selection.size() > 0) |
---|
| 3617 | + { |
---|
| 3618 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 3619 | + SnapObject(obj); |
---|
| 3620 | + } |
---|
3579 | 3621 | } |
---|
3580 | 3622 | |
---|
3581 | 3623 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
4499 | 4541 | JPanel bigThree; |
---|
4500 | 4542 | JTabbedPane scenePanel; |
---|
4501 | 4543 | JPanel centralPanel; |
---|
| 4544 | + JSplitPane cameraPanel; |
---|
4502 | 4545 | JPanel timelinePanel; |
---|
4503 | 4546 | JMenuBar timelineMenubar; |
---|
4504 | 4547 | JSplitPane framePanel; |
---|
.. | .. |
---|
4611 | 4654 | NumberSlider opacityPowerField; |
---|
4612 | 4655 | JTree jTree; |
---|
4613 | 4656 | //ObjectUI parent; |
---|
| 4657 | + |
---|
| 4658 | + NumberSlider normalpushField; |
---|
4614 | 4659 | } |
---|