.. | .. |
---|
28 | 28 | iSendInfo |
---|
29 | 29 | //KeyListener |
---|
30 | 30 | { |
---|
| 31 | + boolean timeline; |
---|
| 32 | + boolean wasFullScreen; |
---|
31 | 33 | |
---|
| 34 | + GroupEditor callee; |
---|
| 35 | + JFrame frame; |
---|
| 36 | + |
---|
32 | 37 | // SCRIPT |
---|
33 | 38 | |
---|
34 | 39 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
125 | 130 | |
---|
126 | 131 | static GridBagConstraints aConstraints; |
---|
127 | 132 | static GridBagConstraints aWindowConstraints; |
---|
128 | | - GroupEditor callee; |
---|
129 | | - JFrame frame; |
---|
| 133 | + |
---|
130 | 134 | static int GRIDWIDTH = 100; // 4; |
---|
131 | 135 | |
---|
132 | 136 | public void closeUI() |
---|
.. | .. |
---|
158 | 162 | objEditor.ctrlPanel.remove(slowerButton); |
---|
159 | 163 | objEditor.ctrlPanel.remove(fasterButton); |
---|
160 | 164 | objEditor.ctrlPanel.remove(remarkButton); |
---|
| 165 | + |
---|
| 166 | + Remove(normalpushField); |
---|
161 | 167 | } |
---|
162 | 168 | |
---|
163 | 169 | public ObjEditor GetEditor() |
---|
164 | 170 | { |
---|
165 | 171 | return objEditor; //.GetEditor(); |
---|
166 | 172 | } |
---|
| 173 | + |
---|
| 174 | + // Sometimes myself, sometimes my callee's. |
---|
167 | 175 | ObjEditor objEditor; |
---|
168 | 176 | |
---|
169 | 177 | /* |
---|
.. | .. |
---|
238 | 246 | //if (!isDisplayable()) |
---|
239 | 247 | //setUndecorated(true); |
---|
240 | 248 | |
---|
241 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 249 | + //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
242 | 250 | client = inClient; |
---|
243 | 251 | copy = localCopy; |
---|
244 | 252 | copy.editWindow = this; |
---|
.. | .. |
---|
292 | 300 | //normalLensItem.addActionListener(this); |
---|
293 | 301 | cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
294 | 302 | revertCameraItem.addActionListener(this); |
---|
| 303 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 304 | + toggleTimelineItem.addItemListener(this); |
---|
295 | 305 | cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
296 | 306 | toggleFullScreenItem.addItemListener(this); |
---|
297 | 307 | toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
298 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
299 | | - toggleTimelineItem.addItemListener(this); |
---|
300 | 308 | cameraMenu.add("-"); |
---|
301 | 309 | cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
302 | 310 | toggleTextureItem.addItemListener(this); |
---|
303 | 311 | toggleTextureItem.setState(CameraPane.textureon); |
---|
304 | 312 | cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
305 | 313 | toggleLiveItem.addItemListener(this); |
---|
306 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
| 314 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
307 | 315 | cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
308 | 316 | stepItem.addActionListener(this); |
---|
309 | 317 | // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
.. | .. |
---|
596 | 604 | } |
---|
597 | 605 | } |
---|
598 | 606 | |
---|
| 607 | + void ToggleFullScreen() |
---|
| 608 | + { |
---|
| 609 | + if (CameraPane.FULLSCREEN) |
---|
| 610 | + { |
---|
| 611 | + frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 612 | + framePanel.add(bigThree); |
---|
| 613 | + frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 614 | + } else |
---|
| 615 | + { |
---|
| 616 | + frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 617 | + framePanel.remove(bigThree); |
---|
| 618 | + frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 619 | + } |
---|
| 620 | + cameraView.ToggleFullScreen(); |
---|
| 621 | + } |
---|
| 622 | + |
---|
599 | 623 | private JTextArea createTextPane() |
---|
600 | 624 | { |
---|
601 | 625 | String[] initString = |
---|
.. | .. |
---|
796 | 820 | |
---|
797 | 821 | aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
798 | 822 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
799 | | - aConstraints.gridwidth = 2; |
---|
| 823 | + aConstraints.gridwidth = 1; |
---|
800 | 824 | ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
801 | 825 | aConstraints.gridx += 1; |
---|
802 | 826 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
965 | 989 | |
---|
966 | 990 | Return(); |
---|
967 | 991 | |
---|
| 992 | + normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
| 993 | + Return(); |
---|
| 994 | + |
---|
968 | 995 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
969 | 996 | // ObjEditor.aConstraints.gridx += 1; |
---|
970 | 997 | |
---|
.. | .. |
---|
1164 | 1191 | timelinePanel = new JPanel(new BorderLayout()); |
---|
1165 | 1192 | timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1166 | 1193 | |
---|
| 1194 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1195 | + cameraPanel.setContinuousLayout(true); |
---|
| 1196 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1197 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1198 | +// cameraPanel.setDividerSize(9); |
---|
| 1199 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1200 | + |
---|
1167 | 1201 | centralPanel.add(cameraView); |
---|
1168 | 1202 | //frame.setJMenuBar(timelineMenubar); |
---|
1169 | 1203 | //centralPanel.add(timelinePanel); |
---|
.. | .. |
---|
1337 | 1371 | //worldPane.add(bigPanel); |
---|
1338 | 1372 | //worldPane.add(worldPanel); |
---|
1339 | 1373 | /**/ |
---|
1340 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1374 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1375 | + frame.add(/*"Center",*/framePanel); |
---|
1341 | 1376 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1342 | 1377 | |
---|
1343 | 1378 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
.. | .. |
---|
1428 | 1463 | aConstraints.gridx += 1; |
---|
1429 | 1464 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1430 | 1465 | //aConstraints.weightx = 0; |
---|
1431 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1466 | + ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1432 | 1467 | aConstraints.gridx = 0; |
---|
1433 | 1468 | aConstraints.gridy += 1; |
---|
1434 | 1469 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1438 | 1473 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1439 | 1474 | aConstraints.gridx += 1; |
---|
1440 | 1475 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1441 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1476 | + ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1442 | 1477 | aConstraints.gridx = 0; |
---|
1443 | 1478 | aConstraints.gridy += 1; |
---|
1444 | 1479 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1448 | 1483 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1449 | 1484 | aConstraints.gridx += 1; |
---|
1450 | 1485 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1451 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1486 | + ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1452 | 1487 | aConstraints.gridx = 0; |
---|
1453 | 1488 | aConstraints.gridy += 1; |
---|
1454 | 1489 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1458 | 1493 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1459 | 1494 | aConstraints.gridx += 1; |
---|
1460 | 1495 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1461 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1496 | + ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1462 | 1497 | aConstraints.gridx = 0; |
---|
1463 | 1498 | aConstraints.gridy += 1; |
---|
1464 | 1499 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1468 | 1503 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1469 | 1504 | aConstraints.gridx += 1; |
---|
1470 | 1505 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1471 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1506 | + ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1472 | 1507 | aConstraints.gridx = 0; |
---|
1473 | 1508 | aConstraints.gridy += 1; |
---|
1474 | 1509 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1537 | 1572 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1538 | 1573 | aConstraints.gridx += 1; |
---|
1539 | 1574 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1540 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1575 | + ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1541 | 1576 | aConstraints.gridx = 0; |
---|
1542 | 1577 | aConstraints.gridy += 1; |
---|
1543 | 1578 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1606 | 1641 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1607 | 1642 | aConstraints.gridx += 1; |
---|
1608 | 1643 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1609 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1644 | + ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1610 | 1645 | aConstraints.gridx = 0; |
---|
1611 | 1646 | aConstraints.gridy += 1; |
---|
1612 | 1647 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1677 | 1712 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1678 | 1713 | aConstraints.gridx += 1; |
---|
1679 | 1714 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1680 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1715 | + ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1681 | 1716 | aConstraints.gridx = 0; |
---|
1682 | 1717 | aConstraints.gridy += 1; |
---|
1683 | 1718 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2966 | 3001 | return; |
---|
2967 | 3002 | } else if (event.getSource() == toggleTimelineItem) |
---|
2968 | 3003 | { |
---|
2969 | | - copy.timeline ^= true; |
---|
| 3004 | + timeline ^= true; |
---|
2970 | 3005 | |
---|
2971 | | - if (copy.timeline) |
---|
| 3006 | + if (timeline) |
---|
2972 | 3007 | { |
---|
2973 | 3008 | centralPanel.remove(cameraView); |
---|
2974 | | - centralPanel.add(timelinePanel); |
---|
| 3009 | + cameraPanel.add(cameraView); |
---|
| 3010 | + centralPanel.add(cameraPanel); |
---|
2975 | 3011 | frame.setJMenuBar(timelineMenubar); |
---|
| 3012 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 3013 | + if (!CameraPane.FULLSCREEN) |
---|
| 3014 | + ToggleFullScreen(); |
---|
| 3015 | + toggleFullScreenItem.setEnabled(false); |
---|
2976 | 3016 | } |
---|
2977 | 3017 | else |
---|
2978 | 3018 | { |
---|
2979 | | - centralPanel.remove(timelinePanel); |
---|
| 3019 | + centralPanel.remove(cameraPanel); |
---|
2980 | 3020 | centralPanel.add(cameraView); |
---|
2981 | 3021 | frame.setJMenuBar(null); |
---|
| 3022 | + if (!wasFullScreen) |
---|
| 3023 | + ToggleFullScreen(); |
---|
| 3024 | + toggleFullScreenItem.setEnabled(true); |
---|
2982 | 3025 | } |
---|
2983 | 3026 | |
---|
2984 | 3027 | frame.validate(); |
---|
2985 | 3028 | return; |
---|
2986 | 3029 | } else if (event.getSource() == toggleFullScreenItem) |
---|
2987 | 3030 | { |
---|
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 | | - } |
---|
| 3031 | + ToggleFullScreen(); |
---|
2998 | 3032 | frame.validate(); |
---|
2999 | | - cameraView.ToggleFullScreen(); |
---|
3000 | 3033 | |
---|
3001 | 3034 | return; |
---|
3002 | 3035 | } else if (event.getSource() == toggleRandomItem) |
---|
.. | .. |
---|
3106 | 3139 | objEditor.refreshContents(); |
---|
3107 | 3140 | } else if (event.getSource() == stepItem) |
---|
3108 | 3141 | { |
---|
3109 | | - cameraView.ONESTEP = true; |
---|
| 3142 | + //cameraView.ONESTEP = true; |
---|
| 3143 | + Globals.ONESTEP = true; |
---|
3110 | 3144 | cameraView.repaint(); |
---|
3111 | 3145 | return; |
---|
3112 | 3146 | } else if (event.getSource() == stepButton) |
---|
.. | .. |
---|
3534 | 3568 | //System.out.println("PARENT = " + parent); |
---|
3535 | 3569 | //if (parent != null) |
---|
3536 | 3570 | // parent.applySelf(); |
---|
3537 | | - refreshContents(); |
---|
| 3571 | + if (e.getSource() == normalpushField) |
---|
| 3572 | + { |
---|
| 3573 | + objEditor.refreshContents(); |
---|
| 3574 | + //Refresh(); |
---|
| 3575 | + } |
---|
| 3576 | + else |
---|
| 3577 | + refreshContents(); |
---|
3538 | 3578 | // ??? client.refreshEditWindow(); |
---|
3539 | 3579 | } |
---|
3540 | 3580 | //else |
---|
.. | .. |
---|
3546 | 3586 | //group.name = nameField.getText(); |
---|
3547 | 3587 | //objEditor.applySelf(); |
---|
3548 | 3588 | |
---|
3549 | | - assert (objEditor == this); |
---|
| 3589 | + // OCT2018: assert (objEditor == this); |
---|
3550 | 3590 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3551 | 3591 | //super.applySelf() |
---|
3552 | 3592 | ; else |
---|
.. | .. |
---|
3570 | 3610 | objEditor.copy = keep; |
---|
3571 | 3611 | } |
---|
3572 | 3612 | } |
---|
| 3613 | + |
---|
| 3614 | + if (normalpushField != null) |
---|
| 3615 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
3573 | 3616 | } |
---|
3574 | 3617 | |
---|
3575 | 3618 | void SnapObject() |
---|
3576 | 3619 | { |
---|
3577 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3578 | | - SnapObject(obj); |
---|
| 3620 | + if (copy.selection.size() > 0) |
---|
| 3621 | + { |
---|
| 3622 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 3623 | + SnapObject(obj); |
---|
| 3624 | + } |
---|
3579 | 3625 | } |
---|
3580 | 3626 | |
---|
3581 | 3627 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
4499 | 4545 | JPanel bigThree; |
---|
4500 | 4546 | JTabbedPane scenePanel; |
---|
4501 | 4547 | JPanel centralPanel; |
---|
| 4548 | + JSplitPane cameraPanel; |
---|
4502 | 4549 | JPanel timelinePanel; |
---|
4503 | 4550 | JMenuBar timelineMenubar; |
---|
4504 | 4551 | JSplitPane framePanel; |
---|
.. | .. |
---|
4611 | 4658 | NumberSlider opacityPowerField; |
---|
4612 | 4659 | JTree jTree; |
---|
4613 | 4660 | //ObjectUI parent; |
---|
| 4661 | + |
---|
| 4662 | + NumberSlider normalpushField; |
---|
4614 | 4663 | } |
---|