List of usage examples for java.awt Cursor DEFAULT_CURSOR
int DEFAULT_CURSOR
To view the source code for java.awt Cursor DEFAULT_CURSOR.
Click Source Link
From source file:com.vgi.mafscaling.LogView.java
private void addXYSeries(TableModel model, int column, String name, Color color) { setCursor(new Cursor(Cursor.WAIT_CURSOR)); try {//from w w w . ja v a 2 s . c o m XYSeries series; if (column == rpmCol) { series = rpmDataset.getSeries(0); ((NumberAxis) plot.getRangeAxis(0)).setStandardTickUnits(NumberAxis.createIntegerTickUnits()); plot.getRangeAxis(0).setTickLabelsVisible(true); rpmPlotRenderer.setSeriesPaint(0, color); rpmPlotRenderer.setSeriesVisible(0, true); } else { series = dataset.getSeries(column); plot.getRangeAxis(1).setTickLabelsVisible(true); plotRenderer.setSeriesPaint(column, color); plotRenderer.setSeriesVisible(column, true); displCount += 1; } if (xyMarker.count() > 0) xyMarker.addLabel(series.getDescription() + ": " + series.getY((int) xyMarker.getValue()), color, true); } finally { setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } chartPanel.revalidate(); }
From source file:com.josescalia.tumblr.form.TumblrImageViewer.java
private void setDisplay(List<DownloadableImage> downloadableImageList) { frame = (MainFrame) this.getTopLevelAncestor(); form = this;//from w w w . j a v a2s . c o m final List<DownloadableImage> downloadableImages = downloadableImageList; form.setCursor(new Cursor(Cursor.WAIT_CURSOR)); frame.setCursor(new Cursor(Cursor.WAIT_CURSOR)); frame.startProgressBar("Viewing"); if (downloadableImages != null && downloadableImages.size() > 0) { new SwingWorker<String, String>() { @Override protected String doInBackground() throws Exception { String sReturn = ""; for (DownloadableImage image : downloadableImages) { String fileName = image.getUrl().substring(image.getUrl().lastIndexOf("/") + 1); String downloadUrl = image.getUrl(); if (sReturn.length() > 0) { sReturn += "<br>"; } sReturn += "<img src='file:///" + BinaryCacheUtil.getBinaryImagePath(".cache", fileName, downloadUrl) + "'>"; } return sReturn; } @Override protected void done() { try { setImageDisplay(get()); } catch (InterruptedException e) { logger.error(e); } catch (ExecutionException e) { logger.error(e); } form.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); frame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); frame.stopProgressBar(""); } }.execute(); } }
From source file:com.vgi.mafscaling.ClosedLoop.java
public void loadData() { fileChooser.setMultiSelectionEnabled(false); if (JFileChooser.APPROVE_OPTION != fileChooser.showOpenDialog(this)) return;// ww w. j av a 2s . c o m File file = fileChooser.getSelectedFile(); int i, j; setCursor(new Cursor(Cursor.WAIT_CURSOR)); BufferedReader br = null; try { br = new BufferedReader(new FileReader(file.getAbsoluteFile())); String line = br.readLine(); if (line == null || !line.equals(SaveDataFileHeader)) { JOptionPane.showMessageDialog(null, "Invalid saved data file!", "Error", JOptionPane.ERROR_MESSAGE); return; } line = br.readLine(); String[] elements; i = 0; int offset = 0; boolean isLogData = false; while (line != null) { elements = line.split(",", -1); switch (i) { case 0: Utils.ensureColumnCount(elements.length - 1, mafTable); for (j = 0; j < elements.length - 1; ++j) mafTable.setValueAt(elements[j], i, j); break; case 1: Utils.ensureColumnCount(elements.length - 1, mafTable); for (j = 0; j < elements.length - 1; ++j) mafTable.setValueAt(elements[j], i, j); break; default: if (elements.length - 1 == logDataTable.getColumnCount()) { if (!isLogData) { offset = i; isLogData = true; } Utils.ensureRowCount(i - offset + 1, logDataTable); for (j = 0; j < elements.length - 1; ++j) logDataTable.setValueAt(elements[j], i - offset, j); } } i += 1; line = br.readLine(); } } catch (Exception e) { e.printStackTrace(); logger.error(e); } finally { setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); if (br != null) { try { br.close(); } catch (IOException e) { logger.error(e); } } } }
From source file:cn.pholance.datamanager.common.components.JRViewer.java
void pnlLinksMouseReleased(MouseEvent evt) {//GEN-FIRST:event_pnlLinksMouseReleased // Add your handling code here: pnlLinks.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }
From source file:com.openbravo.pos.util.JRViewer400.java
void btnPrintActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnPrintActionPerformed {//GEN-HEADEREND:event_btnPrintActionPerformed // Add your handling code here: Thread thread = new Thread(new Runnable() { public void run() { try { btnPrint.setEnabled(false); JRViewer400.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); JasperPrintManager.getInstance(jasperReportsContext).print(jasperPrint, true); } catch (Exception ex) { if (log.isErrorEnabled()) { log.error("Print error.", ex); }/*ww w . jav a 2 s.c o m*/ JOptionPane.showMessageDialog(JRViewer400.this, getBundleString("error.printing")); } finally { JRViewer400.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); btnPrint.setEnabled(true); } } }); thread.start(); }
From source file:neg.JRViewer.java
void btnPrintActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnPrintActionPerformed {//GEN-HEADEREND:event_btnPrintActionPerformed // Add your handling code here: Thread thread = new Thread(new Runnable() { public void run() { try { btnPrint.setEnabled(false); JRViewer.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); JasperPrintManager.printReport(jasperPrint, true); } catch (Exception ex) { if (log.isErrorEnabled()) log.error("Print error.", ex); JOptionPane.showMessageDialog(JRViewer.this, getBundleString("error.printing")); } finally { JRViewer.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); btnPrint.setEnabled(true); }/* w ww.j a v a 2 s.co m*/ } }); thread.start(); }
From source file:edu.harvard.i2b2.previousquery.ui.QueryPreviousRunsPanel.java
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equalsIgnoreCase("Rename ...")) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) jTree1.getSelectionPath().getLastPathComponent(); QueryMasterData ndata = (QueryMasterData) node.getUserObject(); Object inputValue = JOptionPane.showInputDialog(this, "Rename this query to: ", "Rename Query Dialog", JOptionPane.PLAIN_MESSAGE, null, null, ndata.name().substring(0, ndata.name().lastIndexOf("[") - 1)); if (inputValue != null) { String newQueryName = (String) inputValue; String requestXml = ndata.writeRenameQueryXML(newQueryName); setCursor(new Cursor(Cursor.WAIT_CURSOR)); String response = null; if (System.getProperty("webServiceMethod").equals("SOAP")) { // TO DO // response = // QueryListNamesClient.sendQueryRequestSOAP(requestXml); } else { response = QueryListNamesClient.sendQueryRequestREST(requestXml); }//from www.j av a2 s. c o m if (response.equalsIgnoreCase("CellDown")) { final JPanel parent = this; java.awt.EventQueue.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(parent, "Trouble with connection to the remote server, " + "this is often a network error, please try again", "Network Error", JOptionPane.INFORMATION_MESSAGE); } }); setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); return; } if (response != null) { JAXBUtil jaxbUtil = PreviousQueryJAXBUtil.getJAXBUtil(); try { JAXBElement jaxbElement = jaxbUtil.unMashallFromString(response); ResponseMessageType messageType = (ResponseMessageType) jaxbElement.getValue(); StatusType statusType = messageType.getResponseHeader().getResultStatus().getStatus(); String status = statusType.getType(); if (status.equalsIgnoreCase("DONE")) { ndata.name(newQueryName + " [" + ndata.userId() + "]"); node.setUserObject(ndata); // DefaultMutableTreeNode parent = // (DefaultMutableTreeNode) node.getParent(); jTree1.repaint(); } } catch (Exception ex) { ex.printStackTrace(); } } setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } } else if (e.getActionCommand().equalsIgnoreCase("Delete")) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) jTree1.getSelectionPath().getLastPathComponent(); QueryMasterData ndata = (QueryMasterData) node.getUserObject(); Object selectedValue = JOptionPane.showConfirmDialog(this, "Delete Query \"" + ndata.name() + "\"?", "Delete Query Dialog", JOptionPane.YES_NO_OPTION); if (selectedValue.equals(JOptionPane.YES_OPTION)) { System.out.println("delete " + ndata.name()); String requestXml = ndata.writeDeleteQueryXML(); // System.out.println(requestXml); setCursor(new Cursor(Cursor.WAIT_CURSOR)); String response = null; if (System.getProperty("webServiceMethod").equals("SOAP")) { // TO DO // response = // QueryListNamesClient.sendQueryRequestSOAP(requestXml); } else { response = QueryListNamesClient.sendQueryRequestREST(requestXml); } if (response.equalsIgnoreCase("CellDown")) { final JPanel parent = this; java.awt.EventQueue.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(parent, "Trouble with connection to the remote server, " + "this is often a network error, please try again", "Network Error", JOptionPane.INFORMATION_MESSAGE); } }); setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); return; } if (response != null) { JAXBUtil jaxbUtil = PreviousQueryJAXBUtil.getJAXBUtil(); try { JAXBElement jaxbElement = jaxbUtil.unMashallFromString(response); ResponseMessageType messageType = (ResponseMessageType) jaxbElement.getValue(); StatusType statusType = messageType.getResponseHeader().getResultStatus().getStatus(); String status = statusType.getType(); if (status.equalsIgnoreCase("DONE")) { treeModel.removeNodeFromParent(node); // jTree1.repaint(); } } catch (Exception ex) { ex.printStackTrace(); } } setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } } else if (e.getActionCommand().equalsIgnoreCase("Refresh All")) { String status = loadPreviousQueries(false); if (status.equalsIgnoreCase("")) { reset(200, false); } else if (status.equalsIgnoreCase("CellDown")) { final JPanel parent = this; java.awt.EventQueue.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(parent, "Trouble with connection to the remote server, " + "this is often a network error, please try again", "Network Error", JOptionPane.INFORMATION_MESSAGE); } }); } } }
From source file:neg.JRViewerDet1.java
void btnPrintActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnPrintActionPerformed {//GEN-HEADEREND:event_btnPrintActionPerformed // Add your handling code here: Thread thread = new Thread(new Runnable() { public void run() { try { btnPrint.setEnabled(false); JRViewerDet1.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); JasperPrintManager.printReport(jasperPrint, true); } catch (Exception ex) { if (log.isErrorEnabled()) log.error("Print error.", ex); JOptionPane.showMessageDialog(JRViewerDet1.this, getBundleString("error.printing")); } finally { JRViewerDet1.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); btnPrint.setEnabled(true); }/* www .ja v a 2s .c o m*/ } }); thread.start(); }
From source file:neg.JRViewerDet2.java
void btnPrintActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnPrintActionPerformed {//GEN-HEADEREND:event_btnPrintActionPerformed // Add your handling code here: Thread thread = new Thread(new Runnable() { public void run() { try { btnPrint.setEnabled(false); JRViewerDet2.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); JasperPrintManager.printReport(jasperPrint, true); } catch (Exception ex) { if (log.isErrorEnabled()) log.error("Print error.", ex); JOptionPane.showMessageDialog(JRViewerDet2.this, getBundleString("error.printing")); } finally { JRViewerDet2.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); btnPrint.setEnabled(true); }// w w w. ja va 2s . c o m } }); thread.start(); }
From source file:lejos.pc.charting.LogChartFrame.java
private void populateSampleData() { float value = 0, value2 = 0; int x = 0;/*from ww w .j av a2 s . c om*/ DataItem[] di = { new DataItem(), new DataItem(), new DataItem() }; di[0].datatype = DataItem.DT_INTEGER; di[1].datatype = DataItem.DT_FLOAT; di[2].datatype = DataItem.DT_FLOAT; loggerHook.logFieldNamesChanged(new String[] { "System_ms!n!1", "Sine!Y!1", "Random!y!2" }); for (int i = 0; i < 10000; i++) { if (i % 100 == 0) value2 = (float) (Math.random() * 5000 - 2500); if (i % 10 == 0) { di[0].value = new Integer(x); di[1].value = new Float(Math.sin(value)); di[2].value = new Float(value2); loggerHook.logLineAvailable(di); if (i == 4000) loggerHook.logCommentReceived(x, "Event 1: This is an example of what NXTDataLogger.writeComment() does."); if (i == 6510) loggerHook.logCommentReceived(x, "Event 2: This illustrates that multiple comment markers can be added to the chart."); if (i == 9000) loggerHook.logCommentReceived(x, "Look! Did you notice that the domain value is displayed in the tooltip? "); x += 10; value += .1f; } } setChartTitle("Sample Multiple Range Axis Dataset"); loggerHook.dataInputStreamEOF(); System.out.println("Sample dataset generation complete"); this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); // // emulate a CMD_INIT_HANDLER command from the NXT lejos.util.LogMessageManager // byte[] buf = {0,2,-1,-1,1}; // EndianTools.encodeShortBE(1, buf, 2); // tmm.tunneledMessageReceived(buf); // // // emulate a CMD_DELIVER_PACKET command from the NXT lejos.util.LogMessageManager // buf = new byte[10]; // buf[0]= 3; // CMD_DELIVER_PACKET // buf[1]= 2; // TYPE_ROBOT_DRIVE // EndianTools.encodeShortBE(6, buf, 2); // Packet size = 6: 2 bytes , 1 float // buf[4]= 1; // Handler uniqID // buf[5]= 0; // handler command: Set Forward // EndianTools.encodeIntBE(Float.floatToIntBits(500.6675f), buf, 6); // System.out.println("emulate: intbits=" + Float.floatToIntBits(500f)); // tmm.tunneledMessageReceived(buf); }