.. | .. |
---|
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); |
---|
| 1188 | + centralPanel = new JPanel(new BorderLayout()); |
---|
| 1189 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1190 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1164 | 1191 | |
---|
| 1192 | + centralPanel.add(cameraView); |
---|
| 1193 | + //frame.setJMenuBar(timelineMenubar); |
---|
| 1194 | + //centralPanel.add(timelinePanel); |
---|
| 1195 | + |
---|
1165 | 1196 | //topView.camera = ; |
---|
1166 | 1197 | //frontView.camera = new Camera(2); |
---|
1167 | 1198 | //sideView.camera = new Camera(3); |
---|
.. | .. |
---|
1191 | 1222 | gridPanel.add(cameraView); |
---|
1192 | 1223 | gridPanel.add(XYZPanel); |
---|
1193 | 1224 | */ |
---|
1194 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout()); |
---|
| 1225 | + gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1195 | 1226 | gridPanel.setContinuousLayout(true); |
---|
1196 | 1227 | gridPanel.setOneTouchExpandable(true); |
---|
1197 | 1228 | gridPanel.setDividerLocation(1.0); |
---|
.. | .. |
---|
1244 | 1275 | scrollpane.setWheelScrollingEnabled(true); |
---|
1245 | 1276 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1246 | 1277 | |
---|
1247 | | - /*JTabbedPane*/ jtp = new JTabbedPane(); |
---|
1248 | | - jtp.add(scrollpane); |
---|
| 1278 | + /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
| 1279 | + scenePanel.add(scrollpane); |
---|
1249 | 1280 | |
---|
1250 | | - jtp.add(FSPane = new cFileSystemPane(this)); |
---|
| 1281 | + scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
1251 | 1282 | |
---|
1252 | 1283 | optionsPanel = new JPanel(new GridBagLayout()); |
---|
1253 | 1284 | |
---|
1254 | 1285 | optionsPanel.setName("Options"); |
---|
1255 | | - jtp.add(optionsPanel); |
---|
| 1286 | + scenePanel.add(optionsPanel); |
---|
1256 | 1287 | |
---|
1257 | 1288 | |
---|
1258 | 1289 | /* |
---|
.. | .. |
---|
1275 | 1306 | jtp.add(tree); |
---|
1276 | 1307 | */ |
---|
1277 | 1308 | |
---|
1278 | | - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel); |
---|
| 1309 | + bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel); |
---|
1279 | 1310 | bigPanel.setContinuousLayout(true); |
---|
1280 | 1311 | bigPanel.setOneTouchExpandable(true); |
---|
1281 | 1312 | bigPanel.setDividerLocation(0.8); |
---|
.. | .. |
---|
1297 | 1328 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1298 | 1329 | aWindowConstraints.weightx = 0; |
---|
1299 | 1330 | aWindowConstraints.weighty = 1; |
---|
1300 | | - bigThree.add(jtp, aWindowConstraints); |
---|
| 1331 | + bigThree.add(scenePanel, aWindowConstraints); |
---|
1301 | 1332 | aWindowConstraints.weightx = 1; |
---|
1302 | 1333 | aWindowConstraints.gridwidth = 3; |
---|
1303 | 1334 | // aConstraints.gridheight = 3; |
---|
1304 | 1335 | aWindowConstraints.gridx = 1; |
---|
1305 | 1336 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
1306 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 1337 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
1307 | 1338 | aWindowConstraints.weightx = 0; |
---|
1308 | 1339 | aWindowConstraints.gridx = 4; |
---|
1309 | 1340 | aWindowConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1422 | 1453 | aConstraints.gridx += 1; |
---|
1423 | 1454 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1424 | 1455 | //aConstraints.weightx = 0; |
---|
1425 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1456 | + ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1426 | 1457 | aConstraints.gridx = 0; |
---|
1427 | 1458 | aConstraints.gridy += 1; |
---|
1428 | 1459 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1432 | 1463 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1433 | 1464 | aConstraints.gridx += 1; |
---|
1434 | 1465 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1435 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1466 | + ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1436 | 1467 | aConstraints.gridx = 0; |
---|
1437 | 1468 | aConstraints.gridy += 1; |
---|
1438 | 1469 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1442 | 1473 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1443 | 1474 | aConstraints.gridx += 1; |
---|
1444 | 1475 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1445 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1476 | + ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1446 | 1477 | aConstraints.gridx = 0; |
---|
1447 | 1478 | aConstraints.gridy += 1; |
---|
1448 | 1479 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1452 | 1483 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1453 | 1484 | aConstraints.gridx += 1; |
---|
1454 | 1485 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1455 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1486 | + ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1456 | 1487 | aConstraints.gridx = 0; |
---|
1457 | 1488 | aConstraints.gridy += 1; |
---|
1458 | 1489 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1462 | 1493 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1463 | 1494 | aConstraints.gridx += 1; |
---|
1464 | 1495 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1465 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1496 | + ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1466 | 1497 | aConstraints.gridx = 0; |
---|
1467 | 1498 | aConstraints.gridy += 1; |
---|
1468 | 1499 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1531 | 1562 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1532 | 1563 | aConstraints.gridx += 1; |
---|
1533 | 1564 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1534 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1565 | + ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1535 | 1566 | aConstraints.gridx = 0; |
---|
1536 | 1567 | aConstraints.gridy += 1; |
---|
1537 | 1568 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1600 | 1631 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1601 | 1632 | aConstraints.gridx += 1; |
---|
1602 | 1633 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1603 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1634 | + ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1604 | 1635 | aConstraints.gridx = 0; |
---|
1605 | 1636 | aConstraints.gridy += 1; |
---|
1606 | 1637 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
1671 | 1702 | aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1672 | 1703 | aConstraints.gridx += 1; |
---|
1673 | 1704 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1674 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
| 1705 | + ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1675 | 1706 | aConstraints.gridx = 0; |
---|
1676 | 1707 | aConstraints.gridy += 1; |
---|
1677 | 1708 | aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2958 | 2989 | // june 2013 copy.HardTouch(); |
---|
2959 | 2990 | cameraView.repaint(); |
---|
2960 | 2991 | return; |
---|
2961 | | - } else if (event.getSource() == toggleFullItem) |
---|
| 2992 | + } else if (event.getSource() == toggleTimelineItem) |
---|
2962 | 2993 | { |
---|
2963 | | - if (CameraPane.FULLSCREEN) |
---|
| 2994 | + timeline ^= true; |
---|
| 2995 | + |
---|
| 2996 | + if (timeline) |
---|
2964 | 2997 | { |
---|
2965 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
2966 | | - framePanel.add(bigThree); |
---|
2967 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
2968 | | - } else |
---|
2969 | | - { |
---|
2970 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
2971 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 2998 | + centralPanel.remove(cameraView); |
---|
| 2999 | + centralPanel.add(timelinePanel); |
---|
| 3000 | + frame.setJMenuBar(timelineMenubar); |
---|
| 3001 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 3002 | + if (!CameraPane.FULLSCREEN) |
---|
| 3003 | + ToggleFullScreen(); |
---|
| 3004 | + toggleFullScreenItem.setEnabled(false); |
---|
2972 | 3005 | } |
---|
| 3006 | + else |
---|
| 3007 | + { |
---|
| 3008 | + centralPanel.remove(timelinePanel); |
---|
| 3009 | + centralPanel.add(cameraView); |
---|
| 3010 | + frame.setJMenuBar(null); |
---|
| 3011 | + if (!wasFullScreen) |
---|
| 3012 | + ToggleFullScreen(); |
---|
| 3013 | + toggleFullScreenItem.setEnabled(true); |
---|
| 3014 | + } |
---|
| 3015 | + |
---|
2973 | 3016 | frame.validate(); |
---|
2974 | | - cameraView.ToggleFullScreen(); |
---|
| 3017 | + return; |
---|
| 3018 | + } else if (event.getSource() == toggleFullScreenItem) |
---|
| 3019 | + { |
---|
| 3020 | + ToggleFullScreen(); |
---|
| 3021 | + frame.validate(); |
---|
2975 | 3022 | |
---|
2976 | 3023 | return; |
---|
2977 | 3024 | } else if (event.getSource() == toggleRandomItem) |
---|
.. | .. |
---|
3220 | 3267 | cameraView.RevertCamera(); |
---|
3221 | 3268 | cameraView.repaint(); |
---|
3222 | 3269 | return; |
---|
3223 | | - } else if (event.getSource() == textureButton) |
---|
3224 | | - { |
---|
3225 | | - return; // true; |
---|
| 3270 | +// } else if (event.getSource() == textureButton) |
---|
| 3271 | +// { |
---|
| 3272 | +// return; // true; |
---|
3226 | 3273 | } else // combos... |
---|
3227 | 3274 | if (event.getSource() == texresMenu) |
---|
3228 | 3275 | { |
---|
.. | .. |
---|
3509 | 3556 | //System.out.println("PARENT = " + parent); |
---|
3510 | 3557 | //if (parent != null) |
---|
3511 | 3558 | // parent.applySelf(); |
---|
3512 | | - refreshContents(); |
---|
| 3559 | + if (e.getSource() == normalpushField) |
---|
| 3560 | + { |
---|
| 3561 | + objEditor.refreshContents(); |
---|
| 3562 | + //Refresh(); |
---|
| 3563 | + } |
---|
| 3564 | + else |
---|
| 3565 | + refreshContents(); |
---|
3513 | 3566 | // ??? client.refreshEditWindow(); |
---|
3514 | 3567 | } |
---|
3515 | 3568 | //else |
---|
.. | .. |
---|
3521 | 3574 | //group.name = nameField.getText(); |
---|
3522 | 3575 | //objEditor.applySelf(); |
---|
3523 | 3576 | |
---|
3524 | | - assert (objEditor == this); |
---|
| 3577 | + // OCT2018: assert (objEditor == this); |
---|
3525 | 3578 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3526 | 3579 | //super.applySelf() |
---|
3527 | 3580 | ; else |
---|
.. | .. |
---|
3545 | 3598 | objEditor.copy = keep; |
---|
3546 | 3599 | } |
---|
3547 | 3600 | } |
---|
| 3601 | + |
---|
| 3602 | + if (normalpushField != null) |
---|
| 3603 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
3548 | 3604 | } |
---|
3549 | 3605 | |
---|
3550 | 3606 | void SnapObject() |
---|
3551 | 3607 | { |
---|
3552 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3553 | | - SnapObject(obj); |
---|
| 3608 | + if (copy.selection.size() > 0) |
---|
| 3609 | + { |
---|
| 3610 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 3611 | + SnapObject(obj); |
---|
| 3612 | + } |
---|
3554 | 3613 | } |
---|
3555 | 3614 | |
---|
3556 | 3615 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
4444 | 4503 | MenuItem revertCameraItem; |
---|
4445 | 4504 | CheckboxMenuItem toggleLiveItem; |
---|
4446 | 4505 | MenuItem stepItem; |
---|
4447 | | - CheckboxMenuItem toggleFullItem; |
---|
| 4506 | + CheckboxMenuItem toggleFullScreenItem; |
---|
| 4507 | + CheckboxMenuItem toggleTimelineItem; |
---|
4448 | 4508 | CheckboxMenuItem toggleRenderItem; |
---|
4449 | 4509 | CheckboxMenuItem toggleDebugItem; |
---|
4450 | 4510 | CheckboxMenuItem toggleFrustumItem; |
---|
.. | .. |
---|
4471 | 4531 | JSplitPane gridPanel; |
---|
4472 | 4532 | JSplitPane bigPanel; |
---|
4473 | 4533 | JPanel bigThree; |
---|
4474 | | - JTabbedPane jtp; |
---|
4475 | | - JPanel cameraPanel; |
---|
| 4534 | + JTabbedPane scenePanel; |
---|
| 4535 | + JPanel centralPanel; |
---|
| 4536 | + JPanel timelinePanel; |
---|
| 4537 | + JMenuBar timelineMenubar; |
---|
4476 | 4538 | JSplitPane framePanel; |
---|
4477 | 4539 | JTextArea/*Field*/ nameField; |
---|
4478 | | - cButton textureButton; |
---|
| 4540 | + //cButton textureButton; |
---|
4479 | 4541 | cButton okButton; |
---|
4480 | 4542 | cButton applyButton; |
---|
4481 | 4543 | cButton cancelButton; |
---|
.. | .. |
---|
4583 | 4645 | NumberSlider opacityPowerField; |
---|
4584 | 4646 | JTree jTree; |
---|
4585 | 4647 | //ObjectUI parent; |
---|
| 4648 | + |
---|
| 4649 | + NumberSlider normalpushField; |
---|
4586 | 4650 | } |
---|