.. | .. |
---|
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); |
---|
295 | | - cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen")); |
---|
296 | | - toggleFullItem.addItemListener(this); |
---|
297 | | - toggleFullItem.setState(CameraPane.FULLSCREEN); |
---|
| 301 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 302 | + toggleTimelineItem.addItemListener(this); |
---|
| 303 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 304 | + toggleFullScreenItem.addItemListener(this); |
---|
| 305 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
298 | 306 | cameraMenu.add("-"); |
---|
299 | 307 | cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
300 | 308 | toggleTextureItem.addItemListener(this); |
---|
.. | .. |
---|
594 | 602 | } |
---|
595 | 603 | } |
---|
596 | 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 | + |
---|
597 | 621 | private JTextArea createTextPane() |
---|
598 | 622 | { |
---|
599 | 623 | String[] initString = |
---|
.. | .. |
---|
794 | 818 | |
---|
795 | 819 | aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
796 | 820 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
797 | | - aConstraints.gridwidth = 2; |
---|
| 821 | + aConstraints.gridwidth = 1; |
---|
798 | 822 | ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
799 | 823 | aConstraints.gridx += 1; |
---|
800 | 824 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
963 | 987 | |
---|
964 | 988 | Return(); |
---|
965 | 989 | |
---|
| 990 | + normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
| 991 | + Return(); |
---|
| 992 | + |
---|
966 | 993 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
967 | 994 | // ObjEditor.aConstraints.gridx += 1; |
---|
968 | 995 | |
---|
.. | .. |
---|
1158 | 1185 | //JPanel worldPanel = |
---|
1159 | 1186 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1160 | 1187 | //worldPanel.setName("World"); |
---|
1161 | | - /*JPanel*/ cameraPanel = |
---|
1162 | | - new JPanel(new BorderLayout()); |
---|
1163 | | - cameraPanel.add(cameraView); |
---|
1164 | | - //new timeflow.app.TimeflowApp().TimeFlowWindow(cameraPanel, frame); |
---|
| 1188 | + centralPanel = new JPanel(new BorderLayout()); |
---|
| 1189 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1190 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1165 | 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 | + |
---|
| 1199 | + centralPanel.add(cameraView); |
---|
| 1200 | + //frame.setJMenuBar(timelineMenubar); |
---|
| 1201 | + //centralPanel.add(timelinePanel); |
---|
| 1202 | + |
---|
1166 | 1203 | //topView.camera = ; |
---|
1167 | 1204 | //frontView.camera = new Camera(2); |
---|
1168 | 1205 | //sideView.camera = new Camera(3); |
---|
.. | .. |
---|
1192 | 1229 | gridPanel.add(cameraView); |
---|
1193 | 1230 | gridPanel.add(XYZPanel); |
---|
1194 | 1231 | */ |
---|
1195 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout()); |
---|
| 1232 | + gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1196 | 1233 | gridPanel.setContinuousLayout(true); |
---|
1197 | 1234 | gridPanel.setOneTouchExpandable(true); |
---|
1198 | 1235 | gridPanel.setDividerLocation(1.0); |
---|
.. | .. |
---|
1304 | 1341 | // aConstraints.gridheight = 3; |
---|
1305 | 1342 | aWindowConstraints.gridx = 1; |
---|
1306 | 1343 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
1307 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 1344 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
1308 | 1345 | aWindowConstraints.weightx = 0; |
---|
1309 | 1346 | aWindowConstraints.gridx = 4; |
---|
1310 | 1347 | aWindowConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1423 | 1460 | aConstraints.gridx += 1; |
---|
1424 | 1461 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1425 | 1462 | //aConstraints.weightx = 0; |
---|
1426 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1463 | + ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1427 | 1464 | aConstraints.gridx = 0; |
---|
1428 | 1465 | aConstraints.gridy += 1; |
---|
1429 | 1466 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1433 | 1470 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1434 | 1471 | aConstraints.gridx += 1; |
---|
1435 | 1472 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1436 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1473 | + ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1437 | 1474 | aConstraints.gridx = 0; |
---|
1438 | 1475 | aConstraints.gridy += 1; |
---|
1439 | 1476 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1443 | 1480 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1444 | 1481 | aConstraints.gridx += 1; |
---|
1445 | 1482 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1446 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1483 | + ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1447 | 1484 | aConstraints.gridx = 0; |
---|
1448 | 1485 | aConstraints.gridy += 1; |
---|
1449 | 1486 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1453 | 1490 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1454 | 1491 | aConstraints.gridx += 1; |
---|
1455 | 1492 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1456 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1493 | + ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1457 | 1494 | aConstraints.gridx = 0; |
---|
1458 | 1495 | aConstraints.gridy += 1; |
---|
1459 | 1496 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1463 | 1500 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1464 | 1501 | aConstraints.gridx += 1; |
---|
1465 | 1502 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1466 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1503 | + ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1467 | 1504 | aConstraints.gridx = 0; |
---|
1468 | 1505 | aConstraints.gridy += 1; |
---|
1469 | 1506 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1532 | 1569 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1533 | 1570 | aConstraints.gridx += 1; |
---|
1534 | 1571 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1535 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1572 | + ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1536 | 1573 | aConstraints.gridx = 0; |
---|
1537 | 1574 | aConstraints.gridy += 1; |
---|
1538 | 1575 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1601 | 1638 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1602 | 1639 | aConstraints.gridx += 1; |
---|
1603 | 1640 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1604 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1641 | + ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1605 | 1642 | aConstraints.gridx = 0; |
---|
1606 | 1643 | aConstraints.gridy += 1; |
---|
1607 | 1644 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1672 | 1709 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1673 | 1710 | aConstraints.gridx += 1; |
---|
1674 | 1711 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1675 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1712 | + ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1676 | 1713 | aConstraints.gridx = 0; |
---|
1677 | 1714 | aConstraints.gridy += 1; |
---|
1678 | 1715 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2959 | 2996 | // june 2013 copy.HardTouch(); |
---|
2960 | 2997 | cameraView.repaint(); |
---|
2961 | 2998 | return; |
---|
2962 | | - } else if (event.getSource() == toggleFullItem) |
---|
| 2999 | + } else if (event.getSource() == toggleTimelineItem) |
---|
2963 | 3000 | { |
---|
2964 | | - if (CameraPane.FULLSCREEN) |
---|
| 3001 | + timeline ^= true; |
---|
| 3002 | + |
---|
| 3003 | + if (timeline) |
---|
2965 | 3004 | { |
---|
2966 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
2967 | | - framePanel.add(bigThree); |
---|
2968 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
2969 | | - } else |
---|
2970 | | - { |
---|
2971 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
2972 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 3005 | + centralPanel.remove(cameraView); |
---|
| 3006 | + cameraPanel.add(cameraView); |
---|
| 3007 | + centralPanel.add(cameraPanel); |
---|
| 3008 | + frame.setJMenuBar(timelineMenubar); |
---|
| 3009 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 3010 | + if (!CameraPane.FULLSCREEN) |
---|
| 3011 | + ToggleFullScreen(); |
---|
| 3012 | + toggleFullScreenItem.setEnabled(false); |
---|
2973 | 3013 | } |
---|
| 3014 | + else |
---|
| 3015 | + { |
---|
| 3016 | + centralPanel.remove(cameraPanel); |
---|
| 3017 | + centralPanel.add(cameraView); |
---|
| 3018 | + frame.setJMenuBar(null); |
---|
| 3019 | + if (!wasFullScreen) |
---|
| 3020 | + ToggleFullScreen(); |
---|
| 3021 | + toggleFullScreenItem.setEnabled(true); |
---|
| 3022 | + } |
---|
| 3023 | + |
---|
2974 | 3024 | frame.validate(); |
---|
2975 | | - cameraView.ToggleFullScreen(); |
---|
| 3025 | + return; |
---|
| 3026 | + } else if (event.getSource() == toggleFullScreenItem) |
---|
| 3027 | + { |
---|
| 3028 | + ToggleFullScreen(); |
---|
| 3029 | + frame.validate(); |
---|
2976 | 3030 | |
---|
2977 | 3031 | return; |
---|
2978 | 3032 | } else if (event.getSource() == toggleRandomItem) |
---|
.. | .. |
---|
3221 | 3275 | cameraView.RevertCamera(); |
---|
3222 | 3276 | cameraView.repaint(); |
---|
3223 | 3277 | return; |
---|
3224 | | - } else if (event.getSource() == textureButton) |
---|
3225 | | - { |
---|
3226 | | - return; // true; |
---|
| 3278 | +// } else if (event.getSource() == textureButton) |
---|
| 3279 | +// { |
---|
| 3280 | +// return; // true; |
---|
3227 | 3281 | } else // combos... |
---|
3228 | 3282 | if (event.getSource() == texresMenu) |
---|
3229 | 3283 | { |
---|
.. | .. |
---|
3510 | 3564 | //System.out.println("PARENT = " + parent); |
---|
3511 | 3565 | //if (parent != null) |
---|
3512 | 3566 | // parent.applySelf(); |
---|
3513 | | - refreshContents(); |
---|
| 3567 | + if (e.getSource() == normalpushField) |
---|
| 3568 | + { |
---|
| 3569 | + objEditor.refreshContents(); |
---|
| 3570 | + //Refresh(); |
---|
| 3571 | + } |
---|
| 3572 | + else |
---|
| 3573 | + refreshContents(); |
---|
3514 | 3574 | // ??? client.refreshEditWindow(); |
---|
3515 | 3575 | } |
---|
3516 | 3576 | //else |
---|
.. | .. |
---|
3522 | 3582 | //group.name = nameField.getText(); |
---|
3523 | 3583 | //objEditor.applySelf(); |
---|
3524 | 3584 | |
---|
3525 | | - assert (objEditor == this); |
---|
| 3585 | + // OCT2018: assert (objEditor == this); |
---|
3526 | 3586 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3527 | 3587 | //super.applySelf() |
---|
3528 | 3588 | ; else |
---|
.. | .. |
---|
3546 | 3606 | objEditor.copy = keep; |
---|
3547 | 3607 | } |
---|
3548 | 3608 | } |
---|
| 3609 | + |
---|
| 3610 | + if (normalpushField != null) |
---|
| 3611 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
3549 | 3612 | } |
---|
3550 | 3613 | |
---|
3551 | 3614 | void SnapObject() |
---|
3552 | 3615 | { |
---|
3553 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3554 | | - SnapObject(obj); |
---|
| 3616 | + if (copy.selection.size() > 0) |
---|
| 3617 | + { |
---|
| 3618 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 3619 | + SnapObject(obj); |
---|
| 3620 | + } |
---|
3555 | 3621 | } |
---|
3556 | 3622 | |
---|
3557 | 3623 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
4445 | 4511 | MenuItem revertCameraItem; |
---|
4446 | 4512 | CheckboxMenuItem toggleLiveItem; |
---|
4447 | 4513 | MenuItem stepItem; |
---|
4448 | | - CheckboxMenuItem toggleFullItem; |
---|
| 4514 | + CheckboxMenuItem toggleFullScreenItem; |
---|
| 4515 | + CheckboxMenuItem toggleTimelineItem; |
---|
4449 | 4516 | CheckboxMenuItem toggleRenderItem; |
---|
4450 | 4517 | CheckboxMenuItem toggleDebugItem; |
---|
4451 | 4518 | CheckboxMenuItem toggleFrustumItem; |
---|
.. | .. |
---|
4473 | 4540 | JSplitPane bigPanel; |
---|
4474 | 4541 | JPanel bigThree; |
---|
4475 | 4542 | JTabbedPane scenePanel; |
---|
4476 | | - JPanel cameraPanel; |
---|
| 4543 | + JPanel centralPanel; |
---|
| 4544 | + JSplitPane cameraPanel; |
---|
| 4545 | + JPanel timelinePanel; |
---|
| 4546 | + JMenuBar timelineMenubar; |
---|
4477 | 4547 | JSplitPane framePanel; |
---|
4478 | 4548 | JTextArea/*Field*/ nameField; |
---|
4479 | | - cButton textureButton; |
---|
| 4549 | + //cButton textureButton; |
---|
4480 | 4550 | cButton okButton; |
---|
4481 | 4551 | cButton applyButton; |
---|
4482 | 4552 | cButton cancelButton; |
---|
.. | .. |
---|
4584 | 4654 | NumberSlider opacityPowerField; |
---|
4585 | 4655 | JTree jTree; |
---|
4586 | 4656 | //ObjectUI parent; |
---|
| 4657 | + |
---|
| 4658 | + NumberSlider normalpushField; |
---|
4587 | 4659 | } |
---|