.. | .. |
---|
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; |
---|
.. | .. |
---|
119 | 124 | void keyPressed(int key, int modifiers) |
---|
120 | 125 | { |
---|
121 | 126 | System.out.println("KEY PRESSED"); |
---|
122 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 127 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
123 | 128 | } |
---|
124 | 129 | */ |
---|
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); |
---|
.. | .. |
---|
1258 | 1292 | optionsPanel = new JPanel(new GridBagLayout()); |
---|
1259 | 1293 | |
---|
1260 | 1294 | optionsPanel.setName("Options"); |
---|
| 1295 | + |
---|
| 1296 | + AddOptions(optionsPanel, aConstraints); |
---|
| 1297 | + |
---|
1261 | 1298 | scenePanel.add(optionsPanel); |
---|
1262 | 1299 | |
---|
1263 | 1300 | |
---|
.. | .. |
---|
1337 | 1374 | //worldPane.add(bigPanel); |
---|
1338 | 1375 | //worldPane.add(worldPanel); |
---|
1339 | 1376 | /**/ |
---|
1340 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1377 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1378 | + frame.add(/*"Center",*/framePanel); |
---|
1341 | 1379 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1342 | 1380 | |
---|
1343 | 1381 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
.. | .. |
---|
1358 | 1396 | }); |
---|
1359 | 1397 | } |
---|
1360 | 1398 | |
---|
| 1399 | + void AddOptions(JPanel panel, GridBagConstraints constraints) |
---|
| 1400 | + { |
---|
| 1401 | + } |
---|
| 1402 | + |
---|
1361 | 1403 | JTree GetTree() |
---|
1362 | 1404 | { |
---|
1363 | 1405 | return objEditor.jTree; |
---|
.. | .. |
---|
1428 | 1470 | aConstraints.gridx += 1; |
---|
1429 | 1471 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1430 | 1472 | //aConstraints.weightx = 0; |
---|
1431 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1473 | + ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1432 | 1474 | aConstraints.gridx = 0; |
---|
1433 | 1475 | aConstraints.gridy += 1; |
---|
1434 | 1476 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1438 | 1480 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1439 | 1481 | aConstraints.gridx += 1; |
---|
1440 | 1482 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1441 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1483 | + ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1442 | 1484 | aConstraints.gridx = 0; |
---|
1443 | 1485 | aConstraints.gridy += 1; |
---|
1444 | 1486 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1448 | 1490 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1449 | 1491 | aConstraints.gridx += 1; |
---|
1450 | 1492 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1451 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1493 | + ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1452 | 1494 | aConstraints.gridx = 0; |
---|
1453 | 1495 | aConstraints.gridy += 1; |
---|
1454 | 1496 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1458 | 1500 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1459 | 1501 | aConstraints.gridx += 1; |
---|
1460 | 1502 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1461 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1503 | + ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1462 | 1504 | aConstraints.gridx = 0; |
---|
1463 | 1505 | aConstraints.gridy += 1; |
---|
1464 | 1506 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1468 | 1510 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1469 | 1511 | aConstraints.gridx += 1; |
---|
1470 | 1512 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1471 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1513 | + ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1472 | 1514 | aConstraints.gridx = 0; |
---|
1473 | 1515 | aConstraints.gridy += 1; |
---|
1474 | 1516 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1537 | 1579 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1538 | 1580 | aConstraints.gridx += 1; |
---|
1539 | 1581 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1540 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1582 | + ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1541 | 1583 | aConstraints.gridx = 0; |
---|
1542 | 1584 | aConstraints.gridy += 1; |
---|
1543 | 1585 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1606 | 1648 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1607 | 1649 | aConstraints.gridx += 1; |
---|
1608 | 1650 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1609 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1651 | + ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1610 | 1652 | aConstraints.gridx = 0; |
---|
1611 | 1653 | aConstraints.gridy += 1; |
---|
1612 | 1654 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1677 | 1719 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1678 | 1720 | aConstraints.gridx += 1; |
---|
1679 | 1721 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1680 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1722 | + ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1681 | 1723 | aConstraints.gridx = 0; |
---|
1682 | 1724 | aConstraints.gridy += 1; |
---|
1683 | 1725 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2966 | 3008 | return; |
---|
2967 | 3009 | } else if (event.getSource() == toggleTimelineItem) |
---|
2968 | 3010 | { |
---|
2969 | | - copy.timeline ^= true; |
---|
| 3011 | + timeline ^= true; |
---|
2970 | 3012 | |
---|
2971 | | - if (copy.timeline) |
---|
| 3013 | + if (timeline) |
---|
2972 | 3014 | { |
---|
2973 | 3015 | centralPanel.remove(cameraView); |
---|
2974 | | - centralPanel.add(timelinePanel); |
---|
| 3016 | + cameraPanel.add(cameraView); |
---|
| 3017 | + centralPanel.add(cameraPanel); |
---|
2975 | 3018 | frame.setJMenuBar(timelineMenubar); |
---|
| 3019 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 3020 | + if (!CameraPane.FULLSCREEN) |
---|
| 3021 | + ToggleFullScreen(); |
---|
| 3022 | + toggleFullScreenItem.setEnabled(false); |
---|
2976 | 3023 | } |
---|
2977 | 3024 | else |
---|
2978 | 3025 | { |
---|
2979 | | - centralPanel.remove(timelinePanel); |
---|
| 3026 | + centralPanel.remove(cameraPanel); |
---|
2980 | 3027 | centralPanel.add(cameraView); |
---|
2981 | 3028 | frame.setJMenuBar(null); |
---|
| 3029 | + if (!wasFullScreen) |
---|
| 3030 | + ToggleFullScreen(); |
---|
| 3031 | + toggleFullScreenItem.setEnabled(true); |
---|
2982 | 3032 | } |
---|
2983 | 3033 | |
---|
2984 | 3034 | frame.validate(); |
---|
2985 | 3035 | return; |
---|
2986 | 3036 | } else if (event.getSource() == toggleFullScreenItem) |
---|
2987 | 3037 | { |
---|
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 | | - } |
---|
| 3038 | + ToggleFullScreen(); |
---|
2998 | 3039 | frame.validate(); |
---|
2999 | | - cameraView.ToggleFullScreen(); |
---|
3000 | 3040 | |
---|
3001 | 3041 | return; |
---|
3002 | 3042 | } else if (event.getSource() == toggleRandomItem) |
---|
.. | .. |
---|
3106 | 3146 | objEditor.refreshContents(); |
---|
3107 | 3147 | } else if (event.getSource() == stepItem) |
---|
3108 | 3148 | { |
---|
3109 | | - cameraView.ONESTEP = true; |
---|
| 3149 | + //cameraView.ONESTEP = true; |
---|
| 3150 | + Globals.ONESTEP = true; |
---|
3110 | 3151 | cameraView.repaint(); |
---|
3111 | 3152 | return; |
---|
3112 | 3153 | } else if (event.getSource() == stepButton) |
---|
.. | .. |
---|
3263 | 3304 | |
---|
3264 | 3305 | void ToggleAnimation() |
---|
3265 | 3306 | { |
---|
3266 | | - if (!CameraPane.ANIMATION) |
---|
| 3307 | + if (!Globals.ANIMATION) |
---|
3267 | 3308 | { |
---|
3268 | 3309 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3269 | 3310 | browser.show(); |
---|
3270 | 3311 | String filename = browser.getFile(); |
---|
3271 | 3312 | if (filename != null && filename.length() > 0) |
---|
3272 | 3313 | { |
---|
3273 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3314 | + Globals.filename = browser.getDirectory() + filename; |
---|
3274 | 3315 | //CameraPane.framecount = 0; |
---|
3275 | | - CameraPane.imagecount = 0; |
---|
| 3316 | + Globals.imagecount = 0; |
---|
3276 | 3317 | |
---|
3277 | | - CameraPane.ANIMATION ^= true; |
---|
| 3318 | + Globals.ANIMATION ^= true; |
---|
3278 | 3319 | |
---|
3279 | 3320 | GrafreeD.wav.cursor = 0; |
---|
3280 | 3321 | GrafreeD.wav.loop = 0; |
---|
3281 | 3322 | } |
---|
3282 | 3323 | } else |
---|
3283 | 3324 | { |
---|
3284 | | - CameraPane.ANIMATION ^= true; |
---|
| 3325 | + Globals.ANIMATION ^= true; |
---|
3285 | 3326 | } |
---|
3286 | 3327 | } |
---|
3287 | 3328 | |
---|
.. | .. |
---|
3534 | 3575 | //System.out.println("PARENT = " + parent); |
---|
3535 | 3576 | //if (parent != null) |
---|
3536 | 3577 | // parent.applySelf(); |
---|
3537 | | - refreshContents(); |
---|
| 3578 | + if (e.getSource() == normalpushField) |
---|
| 3579 | + { |
---|
| 3580 | + objEditor.refreshContents(); |
---|
| 3581 | + //Refresh(); |
---|
| 3582 | + } |
---|
| 3583 | + else |
---|
| 3584 | + refreshContents(); |
---|
3538 | 3585 | // ??? client.refreshEditWindow(); |
---|
3539 | 3586 | } |
---|
3540 | 3587 | //else |
---|
.. | .. |
---|
3546 | 3593 | //group.name = nameField.getText(); |
---|
3547 | 3594 | //objEditor.applySelf(); |
---|
3548 | 3595 | |
---|
3549 | | - assert (objEditor == this); |
---|
| 3596 | + // OCT2018: assert (objEditor == this); |
---|
3550 | 3597 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3551 | 3598 | //super.applySelf() |
---|
3552 | 3599 | ; else |
---|
.. | .. |
---|
3570 | 3617 | objEditor.copy = keep; |
---|
3571 | 3618 | } |
---|
3572 | 3619 | } |
---|
| 3620 | + |
---|
| 3621 | + if (normalpushField != null) |
---|
| 3622 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
3573 | 3623 | } |
---|
3574 | 3624 | |
---|
3575 | 3625 | void SnapObject() |
---|
3576 | 3626 | { |
---|
3577 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3578 | | - SnapObject(obj); |
---|
| 3627 | + if (copy.selection.size() > 0) |
---|
| 3628 | + { |
---|
| 3629 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 3630 | + SnapObject(obj); |
---|
| 3631 | + } |
---|
3579 | 3632 | } |
---|
3580 | 3633 | |
---|
3581 | 3634 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
4499 | 4552 | JPanel bigThree; |
---|
4500 | 4553 | JTabbedPane scenePanel; |
---|
4501 | 4554 | JPanel centralPanel; |
---|
| 4555 | + JSplitPane cameraPanel; |
---|
4502 | 4556 | JPanel timelinePanel; |
---|
4503 | 4557 | JMenuBar timelineMenubar; |
---|
4504 | 4558 | JSplitPane framePanel; |
---|
.. | .. |
---|
4611 | 4665 | NumberSlider opacityPowerField; |
---|
4612 | 4666 | JTree jTree; |
---|
4613 | 4667 | //ObjectUI parent; |
---|
| 4668 | + |
---|
| 4669 | + NumberSlider normalpushField; |
---|
4614 | 4670 | } |
---|