Normand Briere
2018-07-08 f4160780a4d8278920b99ada1050f320d6e30a73
Timeline activated
5 files modified
105 ■■■■ changed files
GroupEditor.java 24 ●●●● patch | view | raw | blame | history
ObjEditor.java 59 ●●●● patch | view | raw | blame | history
Object3D.java 1 ●●●● patch | view | raw | blame | history
cButton.java 10 ●●●●● patch | view | raw | blame | history
timeflow/app/TimeflowApp.java 11 ●●●●● patch | view | raw | blame | history
GroupEditor.java
....@@ -520,6 +520,9 @@
520520
521521 oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
522522 flashSelectionButton.addActionListener(this);
523
+
524
+ oe.toolbarPanel.add(new cButton(" ", false));
525
+
523526 oe.aConstraints.gridx += 1;
524527 oe.aConstraints.weighty = 0;
525528 oe.aConstraints.gridwidth = 1;
....@@ -715,8 +718,7 @@
715718 dropAttributes |= Object3D.TEXTURE;
716719 else
717720 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
721
+ } else if(e.getSource() == liveCB)
720722 {
721723 cameraView.ToggleLive();
722724 }
....@@ -2639,7 +2641,7 @@
26392641 //gridPanel.setDividerLocation(1.0);
26402642 //bigPanel.setDividerLocation(0.0);
26412643 bigThree.remove(scenePanel);
2642
- bigThree.remove(cameraPanel);
2644
+ bigThree.remove(centralPanel);
26432645 bigThree.remove(XYZPanel);
26442646 aWindowConstraints.gridx = 0;
26452647 aWindowConstraints.gridy = 0;
....@@ -2654,7 +2656,7 @@
26542656 // aConstraints.gridheight = 3;
26552657 aWindowConstraints.gridx = 1;
26562658 aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2659
+ bigThree.add(centralPanel, aWindowConstraints);
26582660 aWindowConstraints.weightx = 0;
26592661 aWindowConstraints.gridx = 4;
26602662 aWindowConstraints.gridwidth = 1;
....@@ -2667,7 +2669,7 @@
26672669 {
26682670 radio.layout = threeButton;
26692671 bigThree.remove(scenePanel);
2670
- bigThree.remove(cameraPanel);
2672
+ bigThree.remove(centralPanel);
26712673 bigThree.remove(XYZPanel);
26722674 aWindowConstraints.gridx = 0;
26732675 aWindowConstraints.gridy = 0;
....@@ -2682,7 +2684,7 @@
26822684 // aConstraints.gridheight = 3;
26832685 aWindowConstraints.gridx = 1;
26842686 aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2687
+ bigThree.add(centralPanel, aWindowConstraints);
26862688 aWindowConstraints.weightx = 0;
26872689 aWindowConstraints.gridx = 4;
26882690 aWindowConstraints.gridwidth = 1;
....@@ -2695,7 +2697,7 @@
26952697 {
26962698 radio.layout = fourButton;
26972699 bigThree.remove(scenePanel);
2698
- bigThree.remove(cameraPanel);
2700
+ bigThree.remove(centralPanel);
26992701 bigThree.remove(XYZPanel);
27002702 aWindowConstraints.gridx = 0;
27012703 aWindowConstraints.gridy = 0;
....@@ -2723,7 +2725,7 @@
27232725 {
27242726 radio.layout = sixButton;
27252727 bigThree.remove(scenePanel);
2726
- bigThree.remove(cameraPanel);
2728
+ bigThree.remove(centralPanel);
27272729 bigThree.remove(XYZPanel);
27282730 aWindowConstraints.gridx = 0;
27292731 aWindowConstraints.gridy = 0;
....@@ -2738,7 +2740,7 @@
27382740 // aWindowConstraints.gridheight = 3;
27392741 aWindowConstraints.gridx = 1;
27402742 aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2743
+ bigThree.add(centralPanel, aWindowConstraints);
27422744 aWindowConstraints.weightx = 0;
27432745 aWindowConstraints.gridx = 4;
27442746 aWindowConstraints.gridwidth = 1;
....@@ -2751,7 +2753,7 @@
27512753 {
27522754 radio.layout = sevenButton;
27532755 bigThree.remove(scenePanel);
2754
- bigThree.remove(cameraPanel);
2756
+ bigThree.remove(centralPanel);
27552757 bigThree.remove(XYZPanel);
27562758 aWindowConstraints.gridx = 0;
27572759 aWindowConstraints.gridy = 0;
....@@ -2766,7 +2768,7 @@
27662768 // aWindowConstraints.gridheight = 3;
27672769 aWindowConstraints.gridx = 1;
27682770 aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2771
+ bigThree.add(centralPanel, aWindowConstraints);
27702772 aWindowConstraints.weightx = 0;
27712773 aWindowConstraints.gridx = 4;
27722774 aWindowConstraints.gridwidth = 1;
ObjEditor.java
....@@ -292,9 +292,11 @@
292292 //normalLensItem.addActionListener(this);
293293 cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
294294 revertCameraItem.addActionListener(this);
295
- cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen"));
296
- toggleFullItem.addItemListener(this);
297
- toggleFullItem.setState(CameraPane.FULLSCREEN);
295
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
296
+ toggleFullScreenItem.addItemListener(this);
297
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
298
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
299
+ toggleTimelineItem.addItemListener(this);
298300 cameraMenu.add("-");
299301 cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
300302 toggleTextureItem.addItemListener(this);
....@@ -1158,11 +1160,14 @@
11581160 //JPanel worldPanel =
11591161 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11601162 //worldPanel.setName("World");
1161
- /*JPanel*/ cameraPanel =
1162
- new JPanel(new BorderLayout());
1163
- cameraPanel.add(cameraView);
1164
- //new timeflow.app.TimeflowApp().TimeFlowWindow(cameraPanel, frame);
1163
+ centralPanel = new JPanel(new BorderLayout());
1164
+ timelinePanel = new JPanel(new BorderLayout());
1165
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11651166
1167
+ centralPanel.add(cameraView);
1168
+ //frame.setJMenuBar(timelineMenubar);
1169
+ //centralPanel.add(timelinePanel);
1170
+
11661171 //topView.camera = ;
11671172 //frontView.camera = new Camera(2);
11681173 //sideView.camera = new Camera(3);
....@@ -1192,7 +1197,7 @@
11921197 gridPanel.add(cameraView);
11931198 gridPanel.add(XYZPanel);
11941199 */
1195
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1200
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11961201 gridPanel.setContinuousLayout(true);
11971202 gridPanel.setOneTouchExpandable(true);
11981203 gridPanel.setDividerLocation(1.0);
....@@ -1304,7 +1309,7 @@
13041309 // aConstraints.gridheight = 3;
13051310 aWindowConstraints.gridx = 1;
13061311 aWindowConstraints.fill = GridBagConstraints.BOTH;
1307
- bigThree.add(cameraPanel, aWindowConstraints);
1312
+ bigThree.add(centralPanel, aWindowConstraints);
13081313 aWindowConstraints.weightx = 0;
13091314 aWindowConstraints.gridx = 4;
13101315 aWindowConstraints.gridwidth = 1;
....@@ -2959,7 +2964,26 @@
29592964 // june 2013 copy.HardTouch();
29602965 cameraView.repaint();
29612966 return;
2962
- } else if (event.getSource() == toggleFullItem)
2967
+ } else if (event.getSource() == toggleTimelineItem)
2968
+ {
2969
+ copy.timeline ^= true;
2970
+
2971
+ if (copy.timeline)
2972
+ {
2973
+ centralPanel.remove(cameraView);
2974
+ centralPanel.add(timelinePanel);
2975
+ frame.setJMenuBar(timelineMenubar);
2976
+ }
2977
+ else
2978
+ {
2979
+ centralPanel.remove(timelinePanel);
2980
+ centralPanel.add(cameraView);
2981
+ frame.setJMenuBar(null);
2982
+ }
2983
+
2984
+ frame.validate();
2985
+ return;
2986
+ } else if (event.getSource() == toggleFullScreenItem)
29632987 {
29642988 if (CameraPane.FULLSCREEN)
29652989 {
....@@ -3221,9 +3245,9 @@
32213245 cameraView.RevertCamera();
32223246 cameraView.repaint();
32233247 return;
3224
- } else if (event.getSource() == textureButton)
3225
- {
3226
- return; // true;
3248
+// } else if (event.getSource() == textureButton)
3249
+// {
3250
+// return; // true;
32273251 } else // combos...
32283252 if (event.getSource() == texresMenu)
32293253 {
....@@ -4445,7 +4469,8 @@
44454469 MenuItem revertCameraItem;
44464470 CheckboxMenuItem toggleLiveItem;
44474471 MenuItem stepItem;
4448
- CheckboxMenuItem toggleFullItem;
4472
+ CheckboxMenuItem toggleFullScreenItem;
4473
+ CheckboxMenuItem toggleTimelineItem;
44494474 CheckboxMenuItem toggleRenderItem;
44504475 CheckboxMenuItem toggleDebugItem;
44514476 CheckboxMenuItem toggleFrustumItem;
....@@ -4473,10 +4498,12 @@
44734498 JSplitPane bigPanel;
44744499 JPanel bigThree;
44754500 JTabbedPane scenePanel;
4476
- JPanel cameraPanel;
4501
+ JPanel centralPanel;
4502
+ JPanel timelinePanel;
4503
+ JMenuBar timelineMenubar;
44774504 JSplitPane framePanel;
44784505 JTextArea/*Field*/ nameField;
4479
- cButton textureButton;
4506
+ //cButton textureButton;
44804507 cButton okButton;
44814508 cButton applyButton;
44824509 cButton cancelButton;
Object3D.java
....@@ -285,6 +285,7 @@
285285 return parent.GetName() + "#";
286286 }
287287
288
+ boolean timeline = false;
288289 boolean live = false;
289290 boolean hide = false;
290291 boolean link2master = false; // performs reset support/master at each frame
cButton.java
....@@ -7,4 +7,14 @@
77 //setBorder(new javax.swing.border.EmptyBorder(0,0,0,0));
88 setBorder(new javax.swing.border.EtchedBorder());
99 }
10
+
11
+ cButton(String name, boolean border)
12
+ {
13
+ super(name);
14
+
15
+ if (border)
16
+ setBorder(new javax.swing.border.EtchedBorder());
17
+ else
18
+ setBorder(new javax.swing.border.EmptyBorder(0,0,0,0));
19
+ }
1020 }
timeflow/app/TimeflowApp.java
....@@ -68,7 +68,7 @@
6868 }
6969 };
7070
71
- public void TimeFlowWindow(Container container, JFrame frame) throws HeadlessException
71
+ public JMenuBar TimeFlowWindow(Container container) throws HeadlessException
7272 {
7373 // read example directory
7474 String[] ex = getVisibleFiles("settings/examples");
....@@ -172,7 +172,8 @@
172172 });
173173
174174 JMenuBar menubar = new JMenuBar();
175
- frame.setJMenuBar(menubar);
175
+
176
+ // frame.setJMenuBar(menubar);
176177
177178 JMenu fileMenu = new JMenu("File");
178179 menubar.add(fileMenu);
....@@ -340,7 +341,7 @@
340341 }
341342
342343 JMenu helpMenu = new JMenu("Help");
343
- menubar.add(helpMenu);
344
+ //menubar.add(helpMenu);
344345
345346 helpMenu.add(new WebDocAction(this));
346347
....@@ -372,6 +373,8 @@
372373 }
373374 }
374375 });
376
+
377
+ return menubar;
375378 }
376379
377380 void splash(boolean visible)
....@@ -404,7 +407,7 @@
404407
405408 Container container = getContentPane();
406409
407
- TimeFlowWindow(container, this);
410
+ TimeFlowWindow(container);
408411 }
409412
410413 void makeRecentFileMenu()