List of usage examples for java.awt Cursor WAIT_CURSOR
int WAIT_CURSOR
To view the source code for java.awt Cursor WAIT_CURSOR.
Click Source Link
From source file:UI.MainUI.java
private void forecastBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_forecastBtnActionPerformed setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); DefaultTableModel dtm = (DefaultTableModel) forecastTable.getModel(); dtm.setRowCount(0);/*from w ww. ja v a 2 s . co m*/ dtm.setRowCount(4); if (algo == 1) { startFForecast(); } else { startRForecast(); } setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }
From source file:v800_trainer.JCicloTronic.java
private void jMenuOpenallActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuOpenallActionPerformed // Add your handling code here: int i;//from ww w . ja va 2 s . co m StringBuffer Buffer = new StringBuffer(); String[] liste = new String[1]; byte Data[] = new byte[81930]; File path = new File(Properties.getProperty("data.dir")); File Datei; FileFilter directoryFilter = new FileFilter() { public boolean accept(File file) { return file.isDirectory(); } public String getDescription() { return ""; }; }; chooser.setCurrentDirectory( new java.io.File(Properties.getProperty("import.dir", Properties.getProperty("data.dir")))); chooser.setDialogType(JFileChooser.OPEN_DIALOG); ExampleFileFilter filtera = new ExampleFileFilter(); ExampleFileFilter filterb = new ExampleFileFilter(); ExampleFileFilter filterc = new ExampleFileFilter(); ExampleFileFilter filterd = new ExampleFileFilter(); ExampleFileFilter filtere = new ExampleFileFilter(); filtera.addExtension("dat"); filtera.setDescription("HAC Rohdaten"); filterb.addExtension("tur"); filterb.setDescription("Hactronic Dateien"); filterc.addExtension("hrm"); filterc.setDescription("Polar Daten"); filterd.addExtension(""); filterd.setDescription("Polar V800 Verzeichnis"); filtere.addExtension("csv"); filtere.setDescription("Polar V800 CSV Flow export"); chooser.resetChoosableFileFilters(); chooser.addChoosableFileFilter(filtera); chooser.addChoosableFileFilter(filterb); chooser.addChoosableFileFilter(filterc); chooser.addChoosableFileFilter(filterd); chooser.addChoosableFileFilter(filtere); chooser.setFileFilter(filtere); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int returnVal = chooser.showDialog(this, null); if (returnVal == JFileChooser.APPROVE_OPTION) { if (chooser.getSelectedFile().getName().endsWith(".dat")) { path = new File(chooser.getCurrentDirectory().getPath()); } else { path = new File(chooser.getSelectedFile().getPath()); } if (chooser.getFileFilter().equals(filtera)) { liste = path.list(new DirFilter(".dat")); } if (chooser.getFileFilter().equals(filterb)) { liste = path.list(new DirFilter(".tur")); } if (chooser.getFileFilter().equals(filterc)) { liste = path.list(new DirFilter(".hrm")); } if (chooser.getFileFilter().equals(filtere)) { liste = path.list(new DirFilter(".csv")); } if (chooser.getFileFilter().equals(filterd)) { File[] files = path.listFiles(); ArrayList<String> pathliste = new ArrayList(); for (File file : files) { try { if (file.isDirectory()) { pathliste.add(file.getCanonicalPath()); } } catch (Exception e) { } } Thread thread = new Thread(new Runnable() { public void run() { setCursor(new Cursor(Cursor.WAIT_CURSOR)); pm = new ProgressMonitor(JCicloTronic.this, "Importiere...", "", 0, 100); pm.setMillisToPopup(1); v800export V800_export = new v800export(); V800_export.export_sessions(JCicloTronic.this, pathliste); pm.close(); ChangeModel(); setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); try { Thread.sleep(100); } catch (Exception e) { if (Thread.interrupted()) { return; } } } }); thread.start(); return; } //alle auer V800 Dateien importieren if (liste == null) { JOptionPane.showMessageDialog(null, "Keine Rohdaten-Files gefunden!", "Achtung!", JOptionPane.ERROR_MESSAGE); return; } final String[] liste_final = liste.clone(); final File path_final = path; Thread thread = new Thread(new Runnable() { public void run() { File Datei; byte Data[] = new byte[81930]; setCursor(new Cursor(Cursor.WAIT_CURSOR)); pm = new ProgressMonitor(JCicloTronic.this, "Importiere...", "", 0, 100); pm.setMillisToPopup(1); for (int i = 0; i < liste_final.length; i++) { pm.setProgress((int) 100.0 * i / liste_final.length); pm.setNote(liste_final[i]); try { Eingabedatei = new java.io.FileInputStream(path_final.getPath() + SystemProperties.getProperty("file.separator") + liste_final[i]); try { Datei = new File(path_final.getPath() + SystemProperties.getProperty("file.separator") + liste_final[i]); Data = new byte[(int) Datei.length()]; // Eingabedatei.read() Eingabedatei.read(Data); Eingabedatei.close(); if (chooser.getFileFilter().equals(filtera)) { ExtractTour(Data); } if (chooser.getFileFilter().equals(filterb)) { ExtractHactronicFile(Data); } if (chooser.getFileFilter().equals(filterc)) { ExtractPolarFile(Data); } if (chooser.getFileFilter().equals(filtere)) { ExtractCSV(Data); } } catch (IOException e) { JOptionPane.showMessageDialog(null, "IO-Fehler bei Datenlesen", "Achtung!", JOptionPane.ERROR_MESSAGE); } } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(null, "IO-Fehler bei " + path_final.getPath() + SystemProperties.getProperty("file.separator") + liste_final[i], "Achtung!", JOptionPane.ERROR_MESSAGE); } } pm.close(); JOptionPane.showMessageDialog(null, "Daten Ende", "Achtung!", JOptionPane.ERROR_MESSAGE); Properties.setProperty("import.dir", chooser.getCurrentDirectory().getPath()); ChangeModel(); setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); try { Thread.sleep(100); } catch (Exception e) { if (Thread.interrupted()) { return; } } } }); thread.start(); } }
From source file:edu.harvard.mcz.imagecapture.SpecimenDetailsViewPane.java
/** * This method initializes jButton1 /*w w w .j a v a2 s. c o m*/ * * @return javax.swing.JButton */ private JButton getJButtonNext() { if (jButtonNext == null) { jButtonNext = new JButton(); URL iconFile = this.getClass().getResource("/edu/harvard/mcz/imagecapture/resources/next.png"); if (iconFile != null) { jButtonNext.setIcon(new ImageIcon(iconFile)); } else { jButtonNext.setText("N"); } jButtonNext.setMnemonic(KeyEvent.VK_N); jButtonNext.setEnabled(myControler.isInTable()); jButtonNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { try { try { thisPane.getParent().getParent() .setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); } catch (Exception ex) { log.error(ex); } // try to move to the next specimen in the table. if (thisPane.myControler.nextSpecimenInTable()) { //thisPane.myControler.setSpecimen(thisPane.specimen.getSpecimenId() + 1); thisPane.setVisible(false); thisPane.myControler.displayInEditor(); thisPane.invalidate(); } try { thisPane.getParent().getParent() .setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } catch (Exception ex) { log.error(ex); } } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } finally { try { thisPane.getParent().getParent() .setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } catch (Exception ex) { log.error(ex); } } } }); } return jButtonNext; }
From source file:edu.harvard.mcz.imagecapture.SpecimenDetailsViewPane.java
/** * This method initializes jButton1 // ww w . j a v a 2 s .c o m * * @return javax.swing.JButton */ private JButton getJButtonPrevious() { if (jButtonPrevious == null) { jButtonPrevious = new JButton(); URL iconFile = this.getClass().getResource("/edu/harvard/mcz/imagecapture/resources/back.png"); if (iconFile != null) { jButtonPrevious.setIcon(new ImageIcon(iconFile)); } else { jButtonPrevious.setText("P"); } jButtonPrevious.setMnemonic(KeyEvent.VK_P); jButtonPrevious.setToolTipText("Move to Previous Specimen"); jButtonPrevious.setEnabled(myControler.isInTable()); jButtonPrevious.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { try { try { thisPane.getParent().getParent() .setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); } catch (Exception ex) { log.error(ex); } // try to move to the previous specimen in the table. if (thisPane.myControler.previousSpecimenInTable()) { thisPane.setVisible(false); thisPane.myControler.displayInEditor(); thisPane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); thisPane.invalidate(); } try { thisPane.getParent().getParent() .setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } catch (Exception ex) { log.error(ex); } } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } finally { try { thisPane.getParent().getParent() .setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); ; } catch (Exception ex) { log.error(ex); } } } }); } return jButtonPrevious; }
From source file:org.domainmath.gui.MainFrame.java
private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed MainFrame.octavePanel.evaluate("pkg load all;"); String f = System.getProperty("user.dir") + File.separator + "cache" + File.separator + "pkg_list.xml"; MainFrame.octavePanel.evaluate("DomainMath_PkgContents('" + f + "');"); PkgDocFrame pkgDocFrame = new PkgDocFrame(this); pkgDocFrame.setLocationRelativeTo(this); this.setCursor(new Cursor(Cursor.WAIT_CURSOR)); ActionListener taskPerformer = (ActionEvent evt1) -> { pkgDocFrame.setVisible(true);/* www .ja v a2 s.co m*/ }; javax.swing.Timer t = new javax.swing.Timer(1200, taskPerformer); t.setRepeats(false); t.start(); this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }
From source file:UI.MainUI.java
private void submitBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submitBtnActionPerformed // TODO add your handling code here: submitBtn.setEnabled(false);// ww w. j av a2 s. c o m finishBtn.setEnabled(false); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); double minErrorCondition = 0.01; FFData data = new FFData(); data.setCurrencyCol(fCurrencyComboBox.getSelectedIndex() + 1); data.setInputNeurons((Integer) inputNeurons.getValue()); data.setHiddenNeurons((Integer) hiddenNeurons.getValue()); data.setOutputNeurons((Integer) fOutputNeurons.getValue()); data.setFilePath(filePath.getText()); data.setEpoch((Integer) epochInput.getValue()); data.setMinError(minErrorCondition); data.setContext(this); FFTrain task = new FFTrain(data); task.addPropertyChangeListener(new MyfnnListener()); task.execute(); }
From source file:UI.MainUI.java
private void rSubmitBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rSubmitBtnActionPerformed rSubmitBtn.setEnabled(false);//from w w w . ja va 2 s.com rFinishBtn.setEnabled(false); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); double minErrorCondition = 0.01; RecurrentData data = new RecurrentData(); data.setCurrencyCol(rCurrencyComboBox.getSelectedIndex() + 1); data.setInputNeurons((Integer) rInputNeurons.getValue()); data.setHiddenNeurons1((Integer) rHiddenNeurons1.getValue()); data.setHiddenNeurons2((Integer) rHiddenNeurons2.getValue()); data.setOutputNeurons((Integer) rOutputNeurons.getValue()); data.setFilePath(rFilePath.getText()); data.setEpoch((Integer) rSpinner.getValue()); data.setMinError(minErrorCondition); data.setContext(this); RecurrentTrain task = new RecurrentTrain(data); task.addPropertyChangeListener(new MyRnnListener()); task.execute(); }
From source file:v800_trainer.JCicloTronic.java
private void Map_PanelComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_Map_PanelComponentShown // TODO add your handling code here: setCursor(new Cursor(Cursor.WAIT_CURSOR)); if (SelectionChanged) { Statistik_PanelComponentShown_StatistikStarten(evt); alteAuswahl = -6;/*from w w w . ja v a 2s . c o m*/ Draw_Map(); Update_Graphik_paint = true; } if (Update_Map_paint == true) { Draw_Map(); } // Draw_Map(); setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }
From source file:v800_trainer.JCicloTronic.java
private void jMenu_V800_LadenMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenu_V800_LadenMouseClicked V800_Download_Training V800_read = new V800_Download_Training(); if (!V800_read.start(this)) return;// w ww . j a v a 2 s. c om setCursor(new Cursor(Cursor.WAIT_CURSOR)); ArrayList<String> sessions = V800_read.get_all_sessions(); ArrayList<String> NewData = new ArrayList(); for (int i = 0; i < sessions.size(); i++) { String Name = sessions.get(i).replace("/", ""); Name = Properties.getProperty("data.dir", Properties.getProperty("working.dir")) + SystemProperties.getProperty("file.separator") + Name.substring(0, Name.length() - 2) + "_Tour.cfg"; File file = new File(Name); if ((file.exists() != true || Integer.parseInt(Properties.getProperty("Daten ueberschreiben")) == 1)) { NewData.add(sessions.get(i)); } } Thread thread = new Thread(new Runnable() { public void run() { setCursor(new Cursor(Cursor.WAIT_CURSOR)); pm = new ProgressMonitor(JCicloTronic.this, "Download...", "", 0, 100); pm.setMillisToPopup(0); pm.setMillisToDecideToPopup(0); ArrayList<String> PathList = V800_read.get_sessions(NewData); V800_read.stop(); // V800_read = null; pm.close(); v800export V800_export = new v800export(); pm = new ProgressMonitor(JCicloTronic.this, "Importiere...", "", 0, 100); pm.setMillisToPopup(0); pm.setMillisToDecideToPopup(0); V800_export.export_sessions(JCicloTronic.this, PathList); pm.close(); ChangeModel(); try { Thread.sleep(100); } catch (Exception e) { if (Thread.interrupted()) { return; } } } }); thread.start(); ChangeModel(); setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }
From source file:us.daveread.basicquery.BasicQuery.java
/** * Writes the data onto a file that is specified by the filePath * //from w w w. ja v a2s. c o m * @param query * The SQL statement * @param model * The model for the current results * @param filePath * A String that denotes the filepath * @param append * Whether to append the current results into the file * * @todo Make this handle other data types (especially Date/Time) better * for cleaner import to spreadsheet. */ private void writeDataAsCSV(String query, TableModel model, String filePath, boolean append) { PrintWriter out; int row, col; boolean[] quote; boolean quoteThis; String temp; Object value; out = null; this.setCursor(new Cursor(Cursor.WAIT_CURSOR)); (flashRunIndicator = new Thread( new FlashForeground(runIndicator, Color.red.brighter(), Color.lightGray, 5))).start(); (timeRunIndicator = new Thread(new InsertTime(timeIndicator, new java.util.Date().getTime(), QUERY_EXECUTION_TIMER_UPDATE_DELAY_MS))).start(); try { out = new PrintWriter(new FileWriter(filePath, append)); messageOut(""); messageOut(Resources.getString("msgStartExportToFile", filePath)); // Output query if (!fileExportsRaw.isSelected()) { // Make it look like a comment using hash comment character out.print("#,"); out.print("\""); } // out.print(getQuery().getSQL()); out.print(query.replaceAll("\n", " ")); if (!fileExportsRaw.isSelected()) { out.print("\""); } out.println(); // Setup array to hold which columns need to be quoted quote = new boolean[model.getColumnCount()]; // Output column headings - determine if column needs quotes for (col = 0; col < model.getColumnCount(); ++col) { if (col > 0) { out.print(","); } out.print("\"" + model.getColumnName(col) + "\""); /** * todo: use column type to set need for quotes */ quote[col] = false; } out.println(); // Output data for (row = 0; row < model.getRowCount(); ++row) { for (col = 0; col < model.getColumnCount(); ++col) { if (col > 0) { out.print(","); } // Get the field content try { value = model.getValueAt(row, col); if (value == null) { temp = ""; } else if (value instanceof java.sql.Timestamp) { temp = Utility.formattedDate((java.sql.Timestamp) value); } else { temp = model.getValueAt(row, col).toString(); if (!fileExportsRaw.isSelected()) { temp = temp.replace('"', '\''); temp = temp.replace('\n', '~'); } } } catch (Exception any) { LOGGER.error("Failed to export data", any); // Display error and move on messageOut(Resources.getString("errFailDuringExport", any.getMessage()), STYLE_RED); temp = ""; } // Decide if quotes are needed: // -If the row is a known character type // -If this field contains a comma quoteThis = !fileExportsRaw.isSelected() && (quote[col] || temp.indexOf(",") > -1); // Output the field if (quoteThis) { out.print("\""); } out.print(temp); if (quoteThis) { out.print("\""); } } if (!fileNoCRAddedToExportRows.isSelected()) { out.println(); } } // Assume that if writing multiple resultsets to file the // user would appreciate a separation line between them. if (append) { out.println("\n********"); } messageOut(Resources.getString("msgEndExportToFile")); } catch (Exception any) { LOGGER.error("Unable to write data to file", any); messageOut(Resources.getString("errFailDataSave", any.toString()), STYLE_RED); } finally { if (out != null) { try { out.close(); } catch (Exception any) { LOGGER.error("Failed while writing data to CSV file", any); } } } flashRunIndicator.interrupt(); flashRunIndicator = null; timeRunIndicator.interrupt(); timeRunIndicator = null; this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }