.. | .. |
---|
25 | 25 | |
---|
26 | 26 | public class TimeflowApp extends JFrame |
---|
27 | 27 | { |
---|
28 | | - public TFModel model = new TFModel(); |
---|
| 28 | + public TimeflowModel model = new TimeflowModel(); |
---|
29 | 29 | public JFileChooser fileChooser; |
---|
30 | 30 | AboutWindow splash; |
---|
31 | 31 | String[][] examples; |
---|
.. | .. |
---|
35 | 35 | public JMenu filterMenu; |
---|
36 | 36 | JMenuItem save = new JMenuItem("Save"); |
---|
37 | 37 | FilterControlPanel filterControlPanel; |
---|
38 | | - LinkTabPane leftPanel; |
---|
| 38 | + //LinkTabPane |
---|
| 39 | + JTabbedPane leftPanel; |
---|
39 | 40 | TFListener filterMenuMaker = new TFListener() |
---|
40 | 41 | { |
---|
41 | 42 | @Override |
---|
.. | .. |
---|
68 | 69 | } |
---|
69 | 70 | }; |
---|
70 | 71 | |
---|
71 | | - public void TimeFlowWindow(Container container, JFrame frame) throws HeadlessException |
---|
| 72 | + public JMenuBar TimeFlowWindow(Container container) throws HeadlessException |
---|
72 | 73 | { |
---|
73 | 74 | // read example directory |
---|
74 | 75 | String[] ex = getVisibleFiles("settings/examples"); |
---|
.. | .. |
---|
83 | 84 | examples[i][0] = s; |
---|
84 | 85 | examples[i][1] = "settings/examples/" + ex[i]; |
---|
85 | 86 | } |
---|
| 87 | + |
---|
86 | 88 | templates = getVisibleFiles("settings/templates"); |
---|
87 | 89 | fileChooser = new JFileChooser(state.getCurrentFile()); |
---|
88 | 90 | |
---|
.. | .. |
---|
90 | 92 | |
---|
91 | 93 | // left tab area, with vertical gray divider. |
---|
92 | 94 | JPanel leftHolder = new JPanel(); |
---|
93 | | - container.add(leftHolder, BorderLayout.WEST); |
---|
| 95 | + container.add(leftHolder, BorderLayout.EAST); // WEST); |
---|
94 | 96 | |
---|
95 | 97 | leftHolder.setLayout(new BorderLayout()); |
---|
96 | 98 | JPanel pad = new Pad(3, 3); |
---|
97 | 99 | pad.setBackground(Color.gray); |
---|
98 | 100 | leftHolder.add(pad, BorderLayout.EAST); |
---|
99 | 101 | |
---|
100 | | - leftPanel = new LinkTabPane();//JTabbedPane(); |
---|
| 102 | + leftPanel = new //LinkTabPane(); |
---|
| 103 | + JTabbedPane(); |
---|
101 | 104 | leftHolder.add(leftPanel, BorderLayout.CENTER); |
---|
102 | 105 | |
---|
103 | 106 | JPanel configPanel = new JPanel(); |
---|
.. | .. |
---|
112 | 115 | configPanel.add(legend, BorderLayout.CENTER); |
---|
113 | 116 | legend.add(new SizeLegendPanel(model), BorderLayout.NORTH); |
---|
114 | 117 | legend.add(new ColorLegendPanel(model), BorderLayout.CENTER); |
---|
115 | | - leftPanel.addTab(configPanel, "Display", true); |
---|
| 118 | + leftPanel.add(configPanel, "Display"); //, true); |
---|
116 | 119 | |
---|
117 | | - leftPanel.addTab(filterControlPanel, "Filter", true); |
---|
| 120 | + leftPanel.add(filterControlPanel, "Filter"); //, true); |
---|
118 | 121 | |
---|
119 | 122 | // center tab area |
---|
120 | 123 | |
---|
.. | .. |
---|
135 | 138 | AbstractView[] views = |
---|
136 | 139 | { |
---|
137 | 140 | timeline, |
---|
138 | | - new CalendarView(model), |
---|
| 141 | + //new CalendarView(model), |
---|
139 | 142 | new ListView(model), |
---|
140 | 143 | new TableView(model), |
---|
141 | 144 | new BarGraphView(model), |
---|
142 | | - intro, |
---|
143 | | - new DescriptionView(model), |
---|
| 145 | + //intro, |
---|
144 | 146 | new SummaryView(model), |
---|
| 147 | + new DescriptionView(model), |
---|
145 | 148 | }; |
---|
146 | 149 | |
---|
147 | 150 | for (int i = 0; i < views.length; i++) |
---|
148 | 151 | { |
---|
149 | | - center.addTab(views[i], views[i].getName(), i < 5); |
---|
| 152 | + center.addTab(views[i], views[i].getName(), true); // i < 5); |
---|
150 | 153 | displayPanel.addLocalControl(views[i].getName(), views[i].getControls()); |
---|
151 | 154 | } |
---|
152 | 155 | |
---|
.. | .. |
---|
172 | 175 | }); |
---|
173 | 176 | |
---|
174 | 177 | JMenuBar menubar = new JMenuBar(); |
---|
175 | | - frame.setJMenuBar(menubar); |
---|
| 178 | + |
---|
| 179 | + // frame.setJMenuBar(menubar); |
---|
176 | 180 | |
---|
177 | 181 | JMenu fileMenu = new JMenu("File"); |
---|
178 | 182 | menubar.add(fileMenu); |
---|
179 | 183 | |
---|
180 | | - fileMenu.add(new NewDataAction(this)); |
---|
| 184 | + TimeflowAction tlAction = new NewDataAction(this); |
---|
| 185 | + fileMenu.add(tlAction); |
---|
| 186 | + tlAction.actionPerformed(null); |
---|
181 | 187 | fileMenu.add(new CopySchemaAction(this)); |
---|
182 | 188 | |
---|
183 | 189 | JMenu templateMenu = new JMenu("New From Template"); |
---|
.. | .. |
---|
199 | 205 | } |
---|
200 | 206 | |
---|
201 | 207 | fileMenu.addSeparator(); |
---|
202 | | - |
---|
203 | 208 | |
---|
204 | 209 | JMenuItem open = new JMenuItem("Open..."); |
---|
205 | 210 | fileMenu.add(open); |
---|
.. | .. |
---|
340 | 345 | } |
---|
341 | 346 | |
---|
342 | 347 | JMenu helpMenu = new JMenu("Help"); |
---|
343 | | - menubar.add(helpMenu); |
---|
| 348 | + //menubar.add(helpMenu); |
---|
344 | 349 | |
---|
345 | 350 | helpMenu.add(new WebDocAction(this)); |
---|
346 | 351 | |
---|
.. | .. |
---|
372 | 377 | } |
---|
373 | 378 | } |
---|
374 | 379 | }); |
---|
| 380 | + |
---|
| 381 | + return menubar; |
---|
375 | 382 | } |
---|
376 | 383 | |
---|
377 | 384 | void splash(boolean visible) |
---|
.. | .. |
---|
404 | 411 | |
---|
405 | 412 | Container container = getContentPane(); |
---|
406 | 413 | |
---|
407 | | - TimeFlowWindow(container, this); |
---|
| 414 | + TimeFlowWindow(container); |
---|
408 | 415 | } |
---|
409 | 416 | |
---|
410 | 417 | void makeRecentFileMenu() |
---|