protected void createControllers() { Tools.gatherRound(this); frame.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { closing(); } }); settings.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { getBCB().openSettings(); } }); run.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { worker = new SwingWorker<Void, Void>() { @Override public Void doInBackground() { model.setMap1Dir(map1Bro.getPath()); model.setMap2Dir(map2Bro.getPath()); model.setResultDir(resBro.getPath()); model.hyperRun(); return null; } @Override protected void done() { changeRunButton(panel, 1); } }; changeRunButton(panel, 0); worker.execute(); } }); }
protected void createView() { // Frame frame = new JFrame(HYPER_TITLE); { frame.setPreferredSize(new Dimension(FRAME_WIDTH, FRAME_HEIGHT)); frame.setResizable(false); display(); frame.setFocusable(true); } background = new ImagePanel("LogoT.png"); background.setPreferredSize(new Dimension(FRAME_WIDTH, LINE_HEIGHT * 5)); // Cr��ation des icones URL url = getClass().getClassLoader().getResource("settings.png"); Icon setIco = new ImageIcon(url); int setIcoW = setIco.getIconWidth(); // Cr��ation des boutons int padding = 0; if (!Tools.isOSX()) { padding = -5; } settings = new JButton(setIco); settings.setPreferredSize( new Dimension(setIcoW + ICON_PADDING, setIcoW + ICON_PADDING + padding)); settings.setToolTipText("Settings"); run = new JButton("RUN"); run.setPreferredSize(new Dimension(FRAME_WIDTH - 20, 45)); // Tests browsers map1Bro = new Browser( frame, "First Maps directory :", BCBEnum.fType.DIR.a(), conf, BCBEnum.Param.SMAP1DIR, getBCB()); map1Bro.setDefPath(System.getProperty("user.home")); map1Bro.firstReset(); getBCB().addBro(map1Bro.getParam(), map1Bro); map2Bro = new Browser( frame, "Second Maps directory :", BCBEnum.fType.DIR.a(), conf, BCBEnum.Param.SMAP2DIR, getBCB()); map2Bro.setDefPath(System.getProperty("user.home")); map2Bro.firstReset(); getBCB().addBro(map2Bro.getParam(), map2Bro); resBro = new Browser( frame, "Results directory :", BCBEnum.fType.DIR.a(), conf, BCBEnum.Param.SRESDIR, getBCB()); resBro.setDefPath(System.getProperty("user.home")); resBro.firstReset(); getBCB().addBro(resBro.getParam(), resBro); }
@Override public void cancel() { if (worker != null) { Tools.cancelActions(path + "/Tools/tmp/tmpHyp", worker); } }