.. | .. |
---|
31 | 31 | boolean timeline; |
---|
32 | 32 | boolean wasFullScreen; |
---|
33 | 33 | |
---|
| 34 | + GroupEditor callee; |
---|
| 35 | + JFrame frame; |
---|
| 36 | + |
---|
34 | 37 | // SCRIPT |
---|
35 | 38 | |
---|
36 | 39 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
121 | 124 | void keyPressed(int key, int modifiers) |
---|
122 | 125 | { |
---|
123 | 126 | System.out.println("KEY PRESSED"); |
---|
124 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 127 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
125 | 128 | } |
---|
126 | 129 | */ |
---|
127 | 130 | |
---|
128 | 131 | static GridBagConstraints aConstraints; |
---|
129 | 132 | static GridBagConstraints aWindowConstraints; |
---|
130 | | - GroupEditor callee; |
---|
131 | | - JFrame frame; |
---|
| 133 | + |
---|
132 | 134 | static int GRIDWIDTH = 100; // 4; |
---|
133 | 135 | |
---|
134 | 136 | public void closeUI() |
---|
.. | .. |
---|
160 | 162 | objEditor.ctrlPanel.remove(slowerButton); |
---|
161 | 163 | objEditor.ctrlPanel.remove(fasterButton); |
---|
162 | 164 | objEditor.ctrlPanel.remove(remarkButton); |
---|
| 165 | + |
---|
| 166 | + Remove(normalpushField); |
---|
163 | 167 | } |
---|
164 | 168 | |
---|
165 | 169 | public ObjEditor GetEditor() |
---|
166 | 170 | { |
---|
167 | 171 | return objEditor; //.GetEditor(); |
---|
168 | 172 | } |
---|
| 173 | + |
---|
| 174 | + // Sometimes myself, sometimes my callee's. |
---|
169 | 175 | ObjEditor objEditor; |
---|
170 | 176 | |
---|
171 | 177 | /* |
---|
.. | .. |
---|
305 | 311 | toggleTextureItem.setState(CameraPane.textureon); |
---|
306 | 312 | cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
307 | 313 | toggleLiveItem.addItemListener(this); |
---|
308 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
| 314 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
309 | 315 | cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
310 | 316 | stepItem.addActionListener(this); |
---|
311 | 317 | // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
.. | .. |
---|
814 | 820 | |
---|
815 | 821 | aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
816 | 822 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
817 | | - aConstraints.gridwidth = 2; |
---|
| 823 | + aConstraints.gridwidth = 1; |
---|
818 | 824 | ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
819 | 825 | aConstraints.gridx += 1; |
---|
820 | 826 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
983 | 989 | |
---|
984 | 990 | Return(); |
---|
985 | 991 | |
---|
| 992 | + normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
| 993 | + Return(); |
---|
| 994 | + |
---|
986 | 995 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
987 | 996 | // ObjEditor.aConstraints.gridx += 1; |
---|
988 | 997 | |
---|
.. | .. |
---|
1182 | 1191 | timelinePanel = new JPanel(new BorderLayout()); |
---|
1183 | 1192 | timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1184 | 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 | + |
---|
1185 | 1201 | centralPanel.add(cameraView); |
---|
1186 | 1202 | //frame.setJMenuBar(timelineMenubar); |
---|
1187 | 1203 | //centralPanel.add(timelinePanel); |
---|
.. | .. |
---|
1276 | 1292 | optionsPanel = new JPanel(new GridBagLayout()); |
---|
1277 | 1293 | |
---|
1278 | 1294 | optionsPanel.setName("Options"); |
---|
| 1295 | + |
---|
| 1296 | + AddOptions(optionsPanel, aConstraints); |
---|
| 1297 | + |
---|
1279 | 1298 | scenePanel.add(optionsPanel); |
---|
1280 | 1299 | |
---|
1281 | 1300 | |
---|
.. | .. |
---|
1355 | 1374 | //worldPane.add(bigPanel); |
---|
1356 | 1375 | //worldPane.add(worldPanel); |
---|
1357 | 1376 | /**/ |
---|
1358 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1377 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1378 | + frame.add(/*"Center",*/framePanel); |
---|
1359 | 1379 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1360 | 1380 | |
---|
1361 | 1381 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
.. | .. |
---|
1376 | 1396 | }); |
---|
1377 | 1397 | } |
---|
1378 | 1398 | |
---|
| 1399 | + void AddOptions(JPanel panel, GridBagConstraints constraints) |
---|
| 1400 | + { |
---|
| 1401 | + } |
---|
| 1402 | + |
---|
1379 | 1403 | JTree GetTree() |
---|
1380 | 1404 | { |
---|
1381 | 1405 | return objEditor.jTree; |
---|
.. | .. |
---|
1446 | 1470 | aConstraints.gridx += 1; |
---|
1447 | 1471 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1448 | 1472 | //aConstraints.weightx = 0; |
---|
1449 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1473 | + ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1450 | 1474 | aConstraints.gridx = 0; |
---|
1451 | 1475 | aConstraints.gridy += 1; |
---|
1452 | 1476 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1456 | 1480 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1457 | 1481 | aConstraints.gridx += 1; |
---|
1458 | 1482 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1459 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1483 | + ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1460 | 1484 | aConstraints.gridx = 0; |
---|
1461 | 1485 | aConstraints.gridy += 1; |
---|
1462 | 1486 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1466 | 1490 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1467 | 1491 | aConstraints.gridx += 1; |
---|
1468 | 1492 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1469 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1493 | + ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1470 | 1494 | aConstraints.gridx = 0; |
---|
1471 | 1495 | aConstraints.gridy += 1; |
---|
1472 | 1496 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1476 | 1500 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1477 | 1501 | aConstraints.gridx += 1; |
---|
1478 | 1502 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1479 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1503 | + ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1480 | 1504 | aConstraints.gridx = 0; |
---|
1481 | 1505 | aConstraints.gridy += 1; |
---|
1482 | 1506 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1486 | 1510 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1487 | 1511 | aConstraints.gridx += 1; |
---|
1488 | 1512 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1489 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1513 | + ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1490 | 1514 | aConstraints.gridx = 0; |
---|
1491 | 1515 | aConstraints.gridy += 1; |
---|
1492 | 1516 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1555 | 1579 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1556 | 1580 | aConstraints.gridx += 1; |
---|
1557 | 1581 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1558 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1582 | + ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1559 | 1583 | aConstraints.gridx = 0; |
---|
1560 | 1584 | aConstraints.gridy += 1; |
---|
1561 | 1585 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1624 | 1648 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1625 | 1649 | aConstraints.gridx += 1; |
---|
1626 | 1650 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1627 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1651 | + ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1628 | 1652 | aConstraints.gridx = 0; |
---|
1629 | 1653 | aConstraints.gridy += 1; |
---|
1630 | 1654 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1695 | 1719 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1696 | 1720 | aConstraints.gridx += 1; |
---|
1697 | 1721 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1698 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1722 | + ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1699 | 1723 | aConstraints.gridx = 0; |
---|
1700 | 1724 | aConstraints.gridy += 1; |
---|
1701 | 1725 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2989 | 3013 | if (timeline) |
---|
2990 | 3014 | { |
---|
2991 | 3015 | centralPanel.remove(cameraView); |
---|
2992 | | - centralPanel.add(timelinePanel); |
---|
| 3016 | + cameraPanel.add(cameraView); |
---|
| 3017 | + centralPanel.add(cameraPanel); |
---|
2993 | 3018 | frame.setJMenuBar(timelineMenubar); |
---|
2994 | 3019 | wasFullScreen = CameraPane.FULLSCREEN; |
---|
2995 | 3020 | if (!CameraPane.FULLSCREEN) |
---|
.. | .. |
---|
2998 | 3023 | } |
---|
2999 | 3024 | else |
---|
3000 | 3025 | { |
---|
3001 | | - centralPanel.remove(timelinePanel); |
---|
| 3026 | + centralPanel.remove(cameraPanel); |
---|
3002 | 3027 | centralPanel.add(cameraView); |
---|
3003 | 3028 | frame.setJMenuBar(null); |
---|
3004 | 3029 | if (!wasFullScreen) |
---|
.. | .. |
---|
3121 | 3146 | objEditor.refreshContents(); |
---|
3122 | 3147 | } else if (event.getSource() == stepItem) |
---|
3123 | 3148 | { |
---|
3124 | | - cameraView.ONESTEP = true; |
---|
| 3149 | + //cameraView.ONESTEP = true; |
---|
| 3150 | + Globals.ONESTEP = true; |
---|
3125 | 3151 | cameraView.repaint(); |
---|
3126 | 3152 | return; |
---|
3127 | 3153 | } else if (event.getSource() == stepButton) |
---|
.. | .. |
---|
3278 | 3304 | |
---|
3279 | 3305 | void ToggleAnimation() |
---|
3280 | 3306 | { |
---|
3281 | | - if (!CameraPane.ANIMATION) |
---|
| 3307 | + if (!Globals.ANIMATION) |
---|
3282 | 3308 | { |
---|
3283 | 3309 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3284 | 3310 | browser.show(); |
---|
3285 | 3311 | String filename = browser.getFile(); |
---|
3286 | 3312 | if (filename != null && filename.length() > 0) |
---|
3287 | 3313 | { |
---|
3288 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3314 | + Globals.filename = browser.getDirectory() + filename; |
---|
3289 | 3315 | //CameraPane.framecount = 0; |
---|
3290 | | - CameraPane.imagecount = 0; |
---|
| 3316 | + Globals.imagecount = 0; |
---|
3291 | 3317 | |
---|
3292 | | - CameraPane.ANIMATION ^= true; |
---|
| 3318 | + Globals.ANIMATION ^= true; |
---|
3293 | 3319 | |
---|
3294 | 3320 | GrafreeD.wav.cursor = 0; |
---|
3295 | 3321 | GrafreeD.wav.loop = 0; |
---|
3296 | 3322 | } |
---|
3297 | 3323 | } else |
---|
3298 | 3324 | { |
---|
3299 | | - CameraPane.ANIMATION ^= true; |
---|
| 3325 | + Globals.ANIMATION ^= true; |
---|
3300 | 3326 | } |
---|
3301 | 3327 | } |
---|
3302 | 3328 | |
---|
.. | .. |
---|
3549 | 3575 | //System.out.println("PARENT = " + parent); |
---|
3550 | 3576 | //if (parent != null) |
---|
3551 | 3577 | // parent.applySelf(); |
---|
3552 | | - refreshContents(); |
---|
| 3578 | + if (e.getSource() == normalpushField) |
---|
| 3579 | + { |
---|
| 3580 | + objEditor.refreshContents(); |
---|
| 3581 | + //Refresh(); |
---|
| 3582 | + } |
---|
| 3583 | + else |
---|
| 3584 | + refreshContents(); |
---|
3553 | 3585 | // ??? client.refreshEditWindow(); |
---|
3554 | 3586 | } |
---|
3555 | 3587 | //else |
---|
.. | .. |
---|
3561 | 3593 | //group.name = nameField.getText(); |
---|
3562 | 3594 | //objEditor.applySelf(); |
---|
3563 | 3595 | |
---|
3564 | | - assert (objEditor == this); |
---|
| 3596 | + // OCT2018: assert (objEditor == this); |
---|
3565 | 3597 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3566 | 3598 | //super.applySelf() |
---|
3567 | 3599 | ; else |
---|
.. | .. |
---|
3585 | 3617 | objEditor.copy = keep; |
---|
3586 | 3618 | } |
---|
3587 | 3619 | } |
---|
| 3620 | + |
---|
| 3621 | + if (normalpushField != null) |
---|
| 3622 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
3588 | 3623 | } |
---|
3589 | 3624 | |
---|
3590 | 3625 | void SnapObject() |
---|
.. | .. |
---|
4517 | 4552 | JPanel bigThree; |
---|
4518 | 4553 | JTabbedPane scenePanel; |
---|
4519 | 4554 | JPanel centralPanel; |
---|
| 4555 | + JSplitPane cameraPanel; |
---|
4520 | 4556 | JPanel timelinePanel; |
---|
4521 | 4557 | JMenuBar timelineMenubar; |
---|
4522 | 4558 | JSplitPane framePanel; |
---|
.. | .. |
---|
4629 | 4665 | NumberSlider opacityPowerField; |
---|
4630 | 4666 | JTree jTree; |
---|
4631 | 4667 | //ObjectUI parent; |
---|
| 4668 | + |
---|
| 4669 | + NumberSlider normalpushField; |
---|
4632 | 4670 | } |
---|