| GrafreeD.java | ●●●●● patch | view | raw | blame | history | |
| GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
| ObjEditor.java | ●●●●● patch | view | raw | blame | history | |
| timeflow/app/TimeflowApp.java | ●●●●● patch | view | raw | blame | history | |
| timeflow/app/TimeflowAppLauncher.java | ●●●●● patch | view | raw | blame | history | 
GrafreeD.java
.. .. @@ -50,7 +50,7 @@ 50 50 universe.material = new cMaterial(); 51 51 //god.addChild(universe); 52 52 universe.name = "Applet"; 53  - theApplet3D = this;53  + grafreeD = this;54 54 } 55 55 56 56 /**/ .. .. @@ -750,16 +750,17 @@ 750 750 751 751 //Monitor mon=MonitorFactory.start("myFirstMonitor"); 752 752 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();757 757 // theApplet3D.universe.textures = CameraPane.DEFAULT_TEXTURE; 758 758 759  - theApplet3D.universe.root = true;760  - theApplet3D.universe.openEditWindow(null, true); //, true);759  + grafreeD.universe.root = true;760  + grafreeD.universe.openEditWindow(null, true); //, true);761 761 //mon.stop(); 762 762 //System.out.println(mon); 763  + //timeflow.app.TimeflowAppLauncher.GetTimeFlow();763 764 } 764 765 765 766 // Timer callback .. .. @@ -984,7 +985,7 @@ 984 985 } while (avail > 0 && numRead >= 0); 985 986 return new String(data, 0, pos, "US-ASCII"); 986 987 } 987  - public static GrafreeD theApplet3D;988  + public static GrafreeD grafreeD;988 989 public static boolean standAlone = true; 989 990 public Composite universe; 990 991 public static Object3D clipboard = new Object3D(); GroupEditor.java
.. .. @@ -1794,7 +1794,7 @@ 1794 1794 if (event.getSource() == invariantsItem) 1795 1795 { 1796 1796 System.out.println("Invariants:"); 1797  - GrafreeD.theApplet3D.universe.invariants();1797  + GrafreeD.grafreeD.universe.invariants();1798 1798 } else 1799 1799 if (event.getSource() == memoryItem) 1800 1800 { .. .. @@ -2638,7 +2638,7 @@ 2638 2638 // bug 2639 2639 //gridPanel.setDividerLocation(1.0); 2640 2640 //bigPanel.setDividerLocation(0.0); 2641  - bigThree.remove(jtp);2641  + bigThree.remove(scenePanel);2642 2642 bigThree.remove(cameraPanel); 2643 2643 bigThree.remove(XYZPanel); 2644 2644 aWindowConstraints.gridx = 0; .. .. @@ -2666,7 +2666,7 @@ 2666 2666 if (event.getSource() == threeButton) 2667 2667 { 2668 2668 radio.layout = threeButton; 2669  - bigThree.remove(jtp);2669  + bigThree.remove(scenePanel);2670 2670 bigThree.remove(cameraPanel); 2671 2671 bigThree.remove(XYZPanel); 2672 2672 aWindowConstraints.gridx = 0; .. .. @@ -2694,7 +2694,7 @@ 2694 2694 if (event.getSource() == fourButton) 2695 2695 { 2696 2696 radio.layout = fourButton; 2697  - bigThree.remove(jtp);2697  + bigThree.remove(scenePanel);2698 2698 bigThree.remove(cameraPanel); 2699 2699 bigThree.remove(XYZPanel); 2700 2700 aWindowConstraints.gridx = 0; .. .. @@ -2704,7 +2704,7 @@ 2704 2704 aWindowConstraints.fill = GridBagConstraints.BOTH; 2705 2705 aWindowConstraints.weightx = 1; 2706 2706 aWindowConstraints.weighty = 1; 2707  - bigThree.add(jtp, aWindowConstraints);2707  + bigThree.add(scenePanel, aWindowConstraints);2708 2708 aWindowConstraints.weightx = 1; 2709 2709 aWindowConstraints.gridwidth = 3; 2710 2710 // aConstraints.gridheight = 3; .. .. @@ -2722,7 +2722,7 @@ 2722 2722 if (event.getSource() == sixButton) 2723 2723 { 2724 2724 radio.layout = sixButton; 2725  - bigThree.remove(jtp);2725  + bigThree.remove(scenePanel);2726 2726 bigThree.remove(cameraPanel); 2727 2727 bigThree.remove(XYZPanel); 2728 2728 aWindowConstraints.gridx = 0; .. .. @@ -2732,7 +2732,7 @@ 2732 2732 aWindowConstraints.fill = GridBagConstraints.VERTICAL; 2733 2733 aWindowConstraints.weightx = 0; 2734 2734 aWindowConstraints.weighty = 1; 2735  - bigThree.add(jtp, aWindowConstraints);2735  + bigThree.add(scenePanel, aWindowConstraints);2736 2736 aWindowConstraints.weightx = 1; 2737 2737 aWindowConstraints.gridwidth = 3; 2738 2738 // aWindowConstraints.gridheight = 3; .. .. @@ -2750,7 +2750,7 @@ 2750 2750 if (event.getSource() == sevenButton) 2751 2751 { 2752 2752 radio.layout = sevenButton; 2753  - bigThree.remove(jtp);2753  + bigThree.remove(scenePanel);2754 2754 bigThree.remove(cameraPanel); 2755 2755 bigThree.remove(XYZPanel); 2756 2756 aWindowConstraints.gridx = 0; .. .. @@ -2760,7 +2760,7 @@ 2760 2760 aWindowConstraints.fill = GridBagConstraints.VERTICAL; 2761 2761 aWindowConstraints.weightx = 0; 2762 2762 aWindowConstraints.weighty = 1; 2763  - bigThree.add(jtp, aWindowConstraints);2763  + bigThree.add(scenePanel, aWindowConstraints);2764 2764 aWindowConstraints.weightx = 1; 2765 2765 aWindowConstraints.gridwidth = 3; 2766 2766 // aWindowConstraints.gridheight = 3; ObjEditor.java
.. .. @@ -1161,6 +1161,7 @@ 1161 1161 /*JPanel*/ cameraPanel = 1162 1162 new JPanel(new BorderLayout()); 1163 1163 cameraPanel.add(cameraView); 1164  + //new timeflow.app.TimeflowApp().TimeFlowWindow(cameraPanel, frame);1164 1165 1165 1166 //topView.camera = ; 1166 1167 //frontView.camera = new Camera(2); .. .. @@ -1244,15 +1245,15 @@ 1244 1245 scrollpane.setWheelScrollingEnabled(true); 1245 1246 scrollpane.addMouseWheelListener(this); // Default not fast enough 1246 1247 1247  - /*JTabbedPane*/ jtp = new JTabbedPane();1248  - jtp.add(scrollpane);1248  + /*JTabbedPane*/ scenePanel = new JTabbedPane();1249  + scenePanel.add(scrollpane);1249 1250 1250  - jtp.add(FSPane = new cFileSystemPane(this));1251  + scenePanel.add(FSPane = new cFileSystemPane(this));1251 1252 1252 1253 optionsPanel = new JPanel(new GridBagLayout()); 1253 1254 1254 1255 optionsPanel.setName("Options"); 1255  - jtp.add(optionsPanel);1256  + scenePanel.add(optionsPanel);1256 1257 1257 1258 1258 1259 /* .. .. @@ -1275,7 +1276,7 @@ 1275 1276 jtp.add(tree); 1276 1277 */ 1277 1278 1278  - bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel);1279  + bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);1279 1280 bigPanel.setContinuousLayout(true); 1280 1281 bigPanel.setOneTouchExpandable(true); 1281 1282 bigPanel.setDividerLocation(0.8); .. .. @@ -1297,7 +1298,7 @@ 1297 1298 aWindowConstraints.fill = GridBagConstraints.VERTICAL; 1298 1299 aWindowConstraints.weightx = 0; 1299 1300 aWindowConstraints.weighty = 1; 1300  - bigThree.add(jtp, aWindowConstraints);1301  + bigThree.add(scenePanel, aWindowConstraints);1301 1302 aWindowConstraints.weightx = 1; 1302 1303 aWindowConstraints.gridwidth = 3; 1303 1304 // aConstraints.gridheight = 3; .. .. @@ -4471,7 +4472,7 @@ 4471 4472 JSplitPane gridPanel; 4472 4473 JSplitPane bigPanel; 4473 4474 JPanel bigThree; 4474  - JTabbedPane jtp;4475  + JTabbedPane scenePanel;4475 4476 JPanel cameraPanel; 4476 4477 JSplitPane framePanel; 4477 4478 JTextArea/*Field*/ nameField; timeflow/app/TimeflowApp.java
.. .. @@ -25,7 +25,6 @@ 25 25 26 26 public class TimeflowApp extends JFrame 27 27 { 28  -29 28 public TFModel model = new TFModel(); 30 29 public JFileChooser fileChooser; 31 30 AboutWindow splash; .. .. @@ -39,7 +38,6 @@ 39 38 LinkTabPane leftPanel; 40 39 TFListener filterMenuMaker = new TFListener() 41 40 { 42  -43 41 @Override 44 42 public void note(TFEvent e) 45 43 { .. .. @@ -70,35 +68,8 @@ 70 68 } 71 69 }; 72 70 73  - void splash(boolean visible)71  + public void TimeFlowWindow(Container container, JFrame frame) throws HeadlessException74 72 { 75  - splash.setVisible(visible);76  - }77  -78  - public void init() throws Exception79  - {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  - @Override89  - 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  -102 73 // read example directory 103 74 String[] ex = getVisibleFiles("settings/examples"); 104 75 int n = ex.length; .. .. @@ -115,11 +86,11 @@ 115 86 templates = getVisibleFiles("settings/templates"); 116 87 fileChooser = new JFileChooser(state.getCurrentFile()); 117 88 118  - getContentPane().setLayout(new BorderLayout());89  + container.setLayout(new BorderLayout());119 90 120 91 // left tab area, with vertical gray divider. 121 92 JPanel leftHolder = new JPanel(); 122  - getContentPane().add(leftHolder, BorderLayout.WEST);93  + container.add(leftHolder, BorderLayout.WEST);123 94 124 95 leftHolder.setLayout(new BorderLayout()); 125 96 JPanel pad = new Pad(3, 3); .. .. @@ -148,11 +119,10 @@ 148 119 // center tab area 149 120 150 121 final LinkTabPane center = new LinkTabPane(); 151  - getContentPane().add(center, BorderLayout.CENTER);122  + container.add(center, BorderLayout.CENTER);152 123 153 124 center.addPropertyChangeListener(new PropertyChangeListener() 154 125 { 155  -156 126 @Override 157 127 public void propertyChange(PropertyChangeEvent evt) 158 128 { .. .. @@ -187,7 +157,6 @@ 187 157 // but then, once data is loaded, switch directly to the timeline view. 188 158 model.addListener(new TFListener() 189 159 { 190  -191 160 @Override 192 161 public void note(TFEvent e) 193 162 { .. .. @@ -203,7 +172,7 @@ 203 172 }); 204 173 205 174 JMenuBar menubar = new JMenuBar(); 206  - setJMenuBar(menubar);175  + frame.setJMenuBar(menubar);207 176 208 177 JMenu fileMenu = new JMenu("File"); 209 178 menubar.add(fileMenu); .. .. @@ -236,7 +205,6 @@ 236 205 fileMenu.add(open); 237 206 open.addActionListener(new ActionListener() 238 207 { 239  -240 208 @Override 241 209 public void actionPerformed(ActionEvent e) 242 210 { .. .. @@ -254,7 +222,6 @@ 254 222 fileMenu.add(impDel); 255 223 impDel.addActionListener(new ActionListener() 256 224 { 257  -258 225 @Override 259 226 public void actionPerformed(ActionEvent e) 260 227 { .. .. @@ -273,7 +240,6 @@ 273 240 save.setEnabled(false); 274 241 save.addActionListener(new ActionListener() 275 242 { 276  -277 243 @Override 278 244 public void actionPerformed(ActionEvent e) 279 245 { .. .. @@ -283,7 +249,6 @@ 283 249 }); 284 250 model.addListener(new TFListener() 285 251 { 286  -287 252 @Override 288 253 public void note(TFEvent e) 289 254 { .. .. @@ -295,7 +260,6 @@ 295 260 fileMenu.add(saveAs); 296 261 saveAs.addActionListener(new ActionListener() 297 262 { 298  -299 263 @Override 300 264 public void actionPerformed(ActionEvent e) 301 265 { .. .. @@ -309,7 +273,6 @@ 309 273 fileMenu.add(exportTSV); 310 274 exportTSV.addActionListener(new ActionListener() 311 275 { 312  -313 276 @Override 314 277 public void actionPerformed(ActionEvent e) 315 278 { .. .. @@ -320,7 +283,6 @@ 320 283 fileMenu.add(exportCSV); 321 284 exportCSV.addActionListener(new ActionListener() 322 285 { 323  -324 286 @Override 325 287 public void actionPerformed(ActionEvent e) 326 288 { .. .. @@ -331,15 +293,14 @@ 331 293 fileMenu.add(exportHTML); 332 294 exportHTML.addActionListener(new ActionListener() 333 295 { 334  -335 296 @Override 336 297 public void actionPerformed(ActionEvent e) 337 298 { 338 299 exportHtml(); 339 300 } 340 301 }); 341  - fileMenu.addSeparator();342  - fileMenu.add(quitAction);302  +// fileMenu.addSeparator();303  +// fileMenu.add(quitAction);343 304 344 305 JMenu editMenu = new JMenu("Edit"); 345 306 menubar.add(editMenu); .. .. @@ -370,7 +331,6 @@ 370 331 final String file = examples[i][1]; 371 332 example.addActionListener(new ActionListener() 372 333 { 373  -374 334 @Override 375 335 public void actionPerformed(ActionEvent e) 376 336 { .. .. @@ -388,7 +348,6 @@ 388 348 helpMenu.add(about); 389 349 about.addActionListener(new ActionListener() 390 350 { 391  -392 351 @Override 393 352 public void actionPerformed(ActionEvent e) 394 353 { .. .. @@ -398,7 +357,6 @@ 398 357 399 358 model.addListener(new TFListener() 400 359 { 401  -402 360 @Override 403 361 public void note(TFEvent e) 404 362 { .. .. @@ -416,6 +374,39 @@ 416 374 }); 417 375 } 418 376 377  + void splash(boolean visible)378  + {379  + splash.setVisible(visible);380  + }381  +382  + public void init() throws Exception383  + {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  +// @Override392  +// 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  +419 410 void makeRecentFileMenu() 420 411 { 421 412 openRecent.removeAll(); timeflow/app/TimeflowAppLauncher.java
.. .. @@ -7,46 +7,58 @@ 7 7 8 8 // For some reason we have to do this in a separate class in order to 9 9 // get the menubar working right on the Mac. 10  +public class TimeflowAppLauncher11  +{12  + public static void main(String[] args) throws Exception13  + {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());10 17 11  -public class TimeflowAppLauncher {12  - public static void main(String[] args) throws Exception13  - {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  - @Override30  - public void run() {31  - try32  - {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  + try19  + {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  + }41 28 42  - @Override43  - 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  + @Override38  + public void run()39  + {40  + try41  + {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  + @Override52  + 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  + }52 64 }