Normand Briere
2018-07-07 ecaf579303705545735450cbc8b8014d7e062329
Timeline integrated
5 files modified
231 ■■■■ changed files
GrafreeD.java 17 ●●●● patch | view | raw | blame | history
GroupEditor.java 18 ●●●● patch | view | raw | blame | history
ObjEditor.java 15 ●●●● patch | view | raw | blame | history
timeflow/app/TimeflowApp.java 89 ●●●●● patch | view | raw | blame | history
timeflow/app/TimeflowAppLauncher.java 92 ●●●●● patch | view | raw | blame | history
GrafreeD.java
....@@ -50,7 +50,7 @@
5050 universe.material = new cMaterial();
5151 //god.addChild(universe);
5252 universe.name = "Applet";
53
- theApplet3D = this;
53
+ grafreeD = this;
5454 }
5555
5656 /**/
....@@ -750,16 +750,17 @@
750750
751751 //Monitor mon=MonitorFactory.start("myFirstMonitor");
752752 standAlone = true;
753
- theApplet3D = new GrafreeD();
754
- theApplet3D.universe = new Composite();
755
- theApplet3D.universe.name = "Scene";
756
- theApplet3D.universe.material = new cMaterial();
753
+ grafreeD = new GrafreeD();
754
+ grafreeD.universe = new Composite();
755
+ grafreeD.universe.name = "Scene";
756
+ grafreeD.universe.material = new cMaterial();
757757 // theApplet3D.universe.textures = CameraPane.DEFAULT_TEXTURE;
758758
759
- theApplet3D.universe.root = true;
760
- theApplet3D.universe.openEditWindow(null, true); //, true);
759
+ grafreeD.universe.root = true;
760
+ grafreeD.universe.openEditWindow(null, true); //, true);
761761 //mon.stop();
762762 //System.out.println(mon);
763
+ //timeflow.app.TimeflowAppLauncher.GetTimeFlow();
763764 }
764765
765766 // Timer callback
....@@ -984,7 +985,7 @@
984985 } while (avail > 0 && numRead >= 0);
985986 return new String(data, 0, pos, "US-ASCII");
986987 }
987
- public static GrafreeD theApplet3D;
988
+ public static GrafreeD grafreeD;
988989 public static boolean standAlone = true;
989990 public Composite universe;
990991 public static Object3D clipboard = new Object3D();
GroupEditor.java
....@@ -1794,7 +1794,7 @@
17941794 if (event.getSource() == invariantsItem)
17951795 {
17961796 System.out.println("Invariants:");
1797
- GrafreeD.theApplet3D.universe.invariants();
1797
+ GrafreeD.grafreeD.universe.invariants();
17981798 } else
17991799 if (event.getSource() == memoryItem)
18001800 {
....@@ -2638,7 +2638,7 @@
26382638 // bug
26392639 //gridPanel.setDividerLocation(1.0);
26402640 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(jtp);
2641
+ bigThree.remove(scenePanel);
26422642 bigThree.remove(cameraPanel);
26432643 bigThree.remove(XYZPanel);
26442644 aWindowConstraints.gridx = 0;
....@@ -2666,7 +2666,7 @@
26662666 if (event.getSource() == threeButton)
26672667 {
26682668 radio.layout = threeButton;
2669
- bigThree.remove(jtp);
2669
+ bigThree.remove(scenePanel);
26702670 bigThree.remove(cameraPanel);
26712671 bigThree.remove(XYZPanel);
26722672 aWindowConstraints.gridx = 0;
....@@ -2694,7 +2694,7 @@
26942694 if (event.getSource() == fourButton)
26952695 {
26962696 radio.layout = fourButton;
2697
- bigThree.remove(jtp);
2697
+ bigThree.remove(scenePanel);
26982698 bigThree.remove(cameraPanel);
26992699 bigThree.remove(XYZPanel);
27002700 aWindowConstraints.gridx = 0;
....@@ -2704,7 +2704,7 @@
27042704 aWindowConstraints.fill = GridBagConstraints.BOTH;
27052705 aWindowConstraints.weightx = 1;
27062706 aWindowConstraints.weighty = 1;
2707
- bigThree.add(jtp, aWindowConstraints);
2707
+ bigThree.add(scenePanel, aWindowConstraints);
27082708 aWindowConstraints.weightx = 1;
27092709 aWindowConstraints.gridwidth = 3;
27102710 // aConstraints.gridheight = 3;
....@@ -2722,7 +2722,7 @@
27222722 if (event.getSource() == sixButton)
27232723 {
27242724 radio.layout = sixButton;
2725
- bigThree.remove(jtp);
2725
+ bigThree.remove(scenePanel);
27262726 bigThree.remove(cameraPanel);
27272727 bigThree.remove(XYZPanel);
27282728 aWindowConstraints.gridx = 0;
....@@ -2732,7 +2732,7 @@
27322732 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
27332733 aWindowConstraints.weightx = 0;
27342734 aWindowConstraints.weighty = 1;
2735
- bigThree.add(jtp, aWindowConstraints);
2735
+ bigThree.add(scenePanel, aWindowConstraints);
27362736 aWindowConstraints.weightx = 1;
27372737 aWindowConstraints.gridwidth = 3;
27382738 // aWindowConstraints.gridheight = 3;
....@@ -2750,7 +2750,7 @@
27502750 if (event.getSource() == sevenButton)
27512751 {
27522752 radio.layout = sevenButton;
2753
- bigThree.remove(jtp);
2753
+ bigThree.remove(scenePanel);
27542754 bigThree.remove(cameraPanel);
27552755 bigThree.remove(XYZPanel);
27562756 aWindowConstraints.gridx = 0;
....@@ -2760,7 +2760,7 @@
27602760 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
27612761 aWindowConstraints.weightx = 0;
27622762 aWindowConstraints.weighty = 1;
2763
- bigThree.add(jtp, aWindowConstraints);
2763
+ bigThree.add(scenePanel, aWindowConstraints);
27642764 aWindowConstraints.weightx = 1;
27652765 aWindowConstraints.gridwidth = 3;
27662766 // aWindowConstraints.gridheight = 3;
ObjEditor.java
....@@ -1161,6 +1161,7 @@
11611161 /*JPanel*/ cameraPanel =
11621162 new JPanel(new BorderLayout());
11631163 cameraPanel.add(cameraView);
1164
+ //new timeflow.app.TimeflowApp().TimeFlowWindow(cameraPanel, frame);
11641165
11651166 //topView.camera = ;
11661167 //frontView.camera = new Camera(2);
....@@ -1244,15 +1245,15 @@
12441245 scrollpane.setWheelScrollingEnabled(true);
12451246 scrollpane.addMouseWheelListener(this); // Default not fast enough
12461247
1247
- /*JTabbedPane*/ jtp = new JTabbedPane();
1248
- jtp.add(scrollpane);
1248
+ /*JTabbedPane*/ scenePanel = new JTabbedPane();
1249
+ scenePanel.add(scrollpane);
12491250
1250
- jtp.add(FSPane = new cFileSystemPane(this));
1251
+ scenePanel.add(FSPane = new cFileSystemPane(this));
12511252
12521253 optionsPanel = new JPanel(new GridBagLayout());
12531254
12541255 optionsPanel.setName("Options");
1255
- jtp.add(optionsPanel);
1256
+ scenePanel.add(optionsPanel);
12561257
12571258
12581259 /*
....@@ -1275,7 +1276,7 @@
12751276 jtp.add(tree);
12761277 */
12771278
1278
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel);
1279
+ bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
12791280 bigPanel.setContinuousLayout(true);
12801281 bigPanel.setOneTouchExpandable(true);
12811282 bigPanel.setDividerLocation(0.8);
....@@ -1297,7 +1298,7 @@
12971298 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
12981299 aWindowConstraints.weightx = 0;
12991300 aWindowConstraints.weighty = 1;
1300
- bigThree.add(jtp, aWindowConstraints);
1301
+ bigThree.add(scenePanel, aWindowConstraints);
13011302 aWindowConstraints.weightx = 1;
13021303 aWindowConstraints.gridwidth = 3;
13031304 // aConstraints.gridheight = 3;
....@@ -4471,7 +4472,7 @@
44714472 JSplitPane gridPanel;
44724473 JSplitPane bigPanel;
44734474 JPanel bigThree;
4474
- JTabbedPane jtp;
4475
+ JTabbedPane scenePanel;
44754476 JPanel cameraPanel;
44764477 JSplitPane framePanel;
44774478 JTextArea/*Field*/ nameField;
timeflow/app/TimeflowApp.java
....@@ -25,7 +25,6 @@
2525
2626 public class TimeflowApp extends JFrame
2727 {
28
-
2928 public TFModel model = new TFModel();
3029 public JFileChooser fileChooser;
3130 AboutWindow splash;
....@@ -39,7 +38,6 @@
3938 LinkTabPane leftPanel;
4039 TFListener filterMenuMaker = new TFListener()
4140 {
42
-
4341 @Override
4442 public void note(TFEvent e)
4543 {
....@@ -70,35 +68,8 @@
7068 }
7169 };
7270
73
- void splash(boolean visible)
71
+ public void TimeFlowWindow(Container container, JFrame frame) throws HeadlessException
7472 {
75
- splash.setVisible(visible);
76
- }
77
-
78
- public void init() throws Exception
79
- {
80
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
81
- setBounds(0, 0, Math.min(d.width, 1200), Math.min(d.height, 900));
82
- setTitle(Display.version());
83
- setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
84
- final QuitAction quitAction = new QuitAction(this, model);
85
- addWindowListener(new WindowAdapter()
86
- {
87
-
88
- @Override
89
- public void windowClosing(WindowEvent e)
90
- {
91
- quitAction.quit();
92
- }
93
-
94
- public void windowStateChanged(WindowEvent e)
95
- {
96
- repaint();
97
- }
98
- });
99
- Image icon = Toolkit.getDefaultToolkit().getImage("images/icon.gif");
100
- setIconImage(icon);
101
-
10273 // read example directory
10374 String[] ex = getVisibleFiles("settings/examples");
10475 int n = ex.length;
....@@ -115,11 +86,11 @@
11586 templates = getVisibleFiles("settings/templates");
11687 fileChooser = new JFileChooser(state.getCurrentFile());
11788
118
- getContentPane().setLayout(new BorderLayout());
89
+ container.setLayout(new BorderLayout());
11990
12091 // left tab area, with vertical gray divider.
12192 JPanel leftHolder = new JPanel();
122
- getContentPane().add(leftHolder, BorderLayout.WEST);
93
+ container.add(leftHolder, BorderLayout.WEST);
12394
12495 leftHolder.setLayout(new BorderLayout());
12596 JPanel pad = new Pad(3, 3);
....@@ -148,11 +119,10 @@
148119 // center tab area
149120
150121 final LinkTabPane center = new LinkTabPane();
151
- getContentPane().add(center, BorderLayout.CENTER);
122
+ container.add(center, BorderLayout.CENTER);
152123
153124 center.addPropertyChangeListener(new PropertyChangeListener()
154125 {
155
-
156126 @Override
157127 public void propertyChange(PropertyChangeEvent evt)
158128 {
....@@ -187,7 +157,6 @@
187157 // but then, once data is loaded, switch directly to the timeline view.
188158 model.addListener(new TFListener()
189159 {
190
-
191160 @Override
192161 public void note(TFEvent e)
193162 {
....@@ -203,7 +172,7 @@
203172 });
204173
205174 JMenuBar menubar = new JMenuBar();
206
- setJMenuBar(menubar);
175
+ frame.setJMenuBar(menubar);
207176
208177 JMenu fileMenu = new JMenu("File");
209178 menubar.add(fileMenu);
....@@ -236,7 +205,6 @@
236205 fileMenu.add(open);
237206 open.addActionListener(new ActionListener()
238207 {
239
-
240208 @Override
241209 public void actionPerformed(ActionEvent e)
242210 {
....@@ -254,7 +222,6 @@
254222 fileMenu.add(impDel);
255223 impDel.addActionListener(new ActionListener()
256224 {
257
-
258225 @Override
259226 public void actionPerformed(ActionEvent e)
260227 {
....@@ -273,7 +240,6 @@
273240 save.setEnabled(false);
274241 save.addActionListener(new ActionListener()
275242 {
276
-
277243 @Override
278244 public void actionPerformed(ActionEvent e)
279245 {
....@@ -283,7 +249,6 @@
283249 });
284250 model.addListener(new TFListener()
285251 {
286
-
287252 @Override
288253 public void note(TFEvent e)
289254 {
....@@ -295,7 +260,6 @@
295260 fileMenu.add(saveAs);
296261 saveAs.addActionListener(new ActionListener()
297262 {
298
-
299263 @Override
300264 public void actionPerformed(ActionEvent e)
301265 {
....@@ -309,7 +273,6 @@
309273 fileMenu.add(exportTSV);
310274 exportTSV.addActionListener(new ActionListener()
311275 {
312
-
313276 @Override
314277 public void actionPerformed(ActionEvent e)
315278 {
....@@ -320,7 +283,6 @@
320283 fileMenu.add(exportCSV);
321284 exportCSV.addActionListener(new ActionListener()
322285 {
323
-
324286 @Override
325287 public void actionPerformed(ActionEvent e)
326288 {
....@@ -331,15 +293,14 @@
331293 fileMenu.add(exportHTML);
332294 exportHTML.addActionListener(new ActionListener()
333295 {
334
-
335296 @Override
336297 public void actionPerformed(ActionEvent e)
337298 {
338299 exportHtml();
339300 }
340301 });
341
- fileMenu.addSeparator();
342
- fileMenu.add(quitAction);
302
+// fileMenu.addSeparator();
303
+// fileMenu.add(quitAction);
343304
344305 JMenu editMenu = new JMenu("Edit");
345306 menubar.add(editMenu);
....@@ -370,7 +331,6 @@
370331 final String file = examples[i][1];
371332 example.addActionListener(new ActionListener()
372333 {
373
-
374334 @Override
375335 public void actionPerformed(ActionEvent e)
376336 {
....@@ -388,7 +348,6 @@
388348 helpMenu.add(about);
389349 about.addActionListener(new ActionListener()
390350 {
391
-
392351 @Override
393352 public void actionPerformed(ActionEvent e)
394353 {
....@@ -398,7 +357,6 @@
398357
399358 model.addListener(new TFListener()
400359 {
401
-
402360 @Override
403361 public void note(TFEvent e)
404362 {
....@@ -416,6 +374,39 @@
416374 });
417375 }
418376
377
+ void splash(boolean visible)
378
+ {
379
+ splash.setVisible(visible);
380
+ }
381
+
382
+ public void init() throws Exception
383
+ {
384
+ Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
385
+ setBounds(0, 0, Math.min(d.width, 1200), Math.min(d.height, 900));
386
+ setTitle(Display.version());
387
+ setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
388
+// final QuitAction quitAction = new QuitAction(this, model);
389
+// addWindowListener(new WindowAdapter()
390
+// {
391
+// @Override
392
+// public void windowClosing(WindowEvent e)
393
+// {
394
+// quitAction.quit();
395
+// }
396
+//
397
+// public void windowStateChanged(WindowEvent e)
398
+// {
399
+// repaint();
400
+// }
401
+// });
402
+ Image icon = Toolkit.getDefaultToolkit().getImage("images/icon.gif");
403
+ setIconImage(icon);
404
+
405
+ Container container = getContentPane();
406
+
407
+ TimeFlowWindow(container, this);
408
+ }
409
+
419410 void makeRecentFileMenu()
420411 {
421412 openRecent.removeAll();
timeflow/app/TimeflowAppLauncher.java
....@@ -7,46 +7,58 @@
77
88 // For some reason we have to do this in a separate class in order to
99 // get the menubar working right on the Mac.
10
+public class TimeflowAppLauncher
11
+{
12
+ public static void main(String[] args) throws Exception
13
+ {
14
+ System.setProperty("apple.laf.useScreenMenuBar", "true");
15
+ System.setProperty("com.apple.mrj.application.apple.menu.about.name", "TimeFlow");
16
+ System.out.println("Running " + Display.version());
1017
11
-public class TimeflowAppLauncher {
12
- public static void main(String[] args) throws Exception
13
- {
14
- System.setProperty("apple.laf.useScreenMenuBar", "true");
15
- System.setProperty("com.apple.mrj.application.apple.menu.about.name", "TimeFlow");
16
- System.out.println("Running "+Display.version());
17
-
18
- try {
19
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
20
- }
21
- catch (Exception e) {
22
- System.out.println("Can't set system look & feel");
23
- }
24
-
25
- final TimeflowApp t=new TimeflowApp();
26
- t.splash=new AboutWindow(t, t.model.getDisplay());
27
- t.splash(true);
28
- SwingUtilities.invokeLater(new Runnable() {
29
- @Override
30
- public void run() {
31
- try
32
- {
33
- t.init();
34
- t.setVisible(true);
35
- }
36
- catch (Exception e)
37
- {
38
- e.printStackTrace(System.out);
39
- }
40
- t.splash.addMouseListener(new MouseAdapter() {
18
+ try
19
+ {
20
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
21
+ } catch (Exception e)
22
+ {
23
+ System.out.println("Can't set system look & feel");
24
+ }
25
+
26
+ GetTimeFlow();
27
+ }
4128
42
- @Override
43
- public void mouseClicked(MouseEvent e) {
44
- t.splash.setVisible(false);
45
- }}
46
- );
47
- t.splash(false);
48
- //t.splash.message=t.model.getDisplay().version();
49
- }});
50
-
51
- }
29
+ public static TimeflowApp GetTimeFlow()
30
+ {
31
+ final TimeflowApp t = new TimeflowApp();
32
+ t.splash = new AboutWindow(t, t.model.getDisplay());
33
+ t.splash(true);
34
+ SwingUtilities.invokeLater(new Runnable()
35
+ {
36
+
37
+ @Override
38
+ public void run()
39
+ {
40
+ try
41
+ {
42
+ t.init();
43
+ t.setVisible(true);
44
+ } catch (Exception e)
45
+ {
46
+ e.printStackTrace(System.out);
47
+ }
48
+ t.splash.addMouseListener(new MouseAdapter()
49
+ {
50
+
51
+ @Override
52
+ public void mouseClicked(MouseEvent e)
53
+ {
54
+ t.splash.setVisible(false);
55
+ }
56
+ });
57
+ t.splash(false);
58
+ //t.splash.message=t.model.getDisplay().version();
59
+ }
60
+ });
61
+
62
+ return t;
63
+ }
5264 }