@Override public void run() { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); } });
@Override public void run() { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } });
@Override public void run() { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); } });
public void setCursor(int cursor) { getFrame(serverBrowser).setCursor(new Cursor(cursor)); Toolkit.getDefaultToolkit().sync(); }
/* private final*/ public void setCursor(int cursor) { getFrame(this).setCursor(new Cursor(cursor)); Toolkit.getDefaultToolkit().sync(); }
public static Cursor setRootFrameCursor(Component component, Cursor newCursor) { Guardian.assertNotNull("component", component); Frame frame = getRootFrame(component); if (frame == null && component instanceof Frame) { frame = (Frame) component; } Cursor oldCursor = null; if (frame != null) { oldCursor = frame.getCursor(); if (newCursor != null) { frame.setCursor(newCursor); } else { frame.setCursor(Cursor.getDefaultCursor()); } } return oldCursor; }
public static Cursor setRootFrameCursor(Component component, Cursor newCursor) { Guardian.assertNotNull("component", component); Frame frame = getRootFrame(component); if (frame == null && component instanceof Frame) { frame = (Frame) component; } Cursor oldCursor = null; if (frame != null) { oldCursor = frame.getCursor(); if (newCursor != null) { frame.setCursor(newCursor); } else { frame.setCursor(Cursor.getDefaultCursor()); } } return oldCursor; }
@Override public void run() { WindowManager.getDefault().getMainWindow().setCursor(Cursor.getDefaultCursor()); if (finishedMessage && file != null) { if (autoSave) { final String msg = NbBundle.getMessage(ScreenshotMaker.class, "ScreenshotMaker.finishedMessage.message", file.getAbsolutePath()); StatusDisplayer.getDefault().setStatusText(msg); } else { final String msg = NbBundle.getMessage(ScreenshotMaker.class, "ScreenshotMaker.finishedMessage.message", file.getName()); JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), msg, NbBundle.getMessage(ScreenshotMaker.class, "ScreenshotMaker.finishedMessage.title"), JOptionPane.INFORMATION_MESSAGE); } } } });
public static void main(String... args) { // create the cursor Toolkit t = Toolkit.getDefaultToolkit(); Image i = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); Cursor noCursor = t.createCustomCursor(i, new Point(0, 0), "none"); // try it with a normal frame Frame f = new Frame(); // create the GLCanvas and add it to the frame GLCanvas canvas = new GLCanvas(); frame.add(canvas); f.setCursor(noCursor); f.setSize(400, 200); f.setVisible(true); }
@Override protected Object doInBackground(com.bc.ceres.core.ProgressMonitor pm) throws Exception { try { pm.beginTask(message, 1); SwingUtilities.invokeLater(() -> { snapApp.setStatusBarMessage(message); snapApp.getMainFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); }); if (task != null) { task.run(); } } catch (Throwable e) { snapApp.handleError("The operation failed.", e); //handleUnknownException(e); } finally { SwingUtilities.invokeLater(() -> snapApp.getMainFrame().setCursor(Cursor.getDefaultCursor())); snapApp.setStatusBarMessage(""); pm.done(); } return null; } }
/** * Starts the action. * @param parentFrame the parent frame */ public void start(Frame parentFrame) { this.parent = parentFrame; progressDialog = new SignatureUpdateProgressDialog(parent); parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); execute(); progressDialog.setVisible(true); if (progressDialog.isCancelled()) { cancel(true); } }
/** * @see javax.swing.SwingWorker#done() */ @Override protected void done() { try { Map<SignatureType, SignatureFileInfo> updatedFiles = get(); progressDialog.setVisible(false); DialogUtils.showUpdateSuccessfulDialog(parent, updatedFiles); } catch (InterruptedException e) { log.debug(e.getMessage(), e); } catch (ExecutionException e) { log.error(e.getCause().toString(), e); progressDialog.setVisible(false); DialogUtils.showSignatureUpdateErrorDialog(parent, e.getCause()); } catch (CancellationException e) { log.warn(e.getMessage()); } finally { progressDialog.setVisible(false); progressDialog.dispose(); parent.setCursor(Cursor.getDefaultCursor()); } }
/** * Starts the action. * @param parentFrame the parent frame */ public void start(Frame parentFrame) { this.parent = parentFrame; progressDialog = new SignatureUpdateProgressDialog(parent); parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); execute(); progressDialog.setVisible(true); if (progressDialog.isCancelled()) { cancel(true); } }
/** * Starts the task. * @param parentFrame the parent of this task */ public void start(Frame parentFrame) { this.parent = parentFrame; progressDialog = new SignatureUpdateProgressDialog(parent); parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); execute(); progressDialog.setVisible(true); if (progressDialog.isCancelled()) { cancel(true); } }
/** * Starts the task. * @param parentFrame the parent of this task */ public void start(Frame parentFrame) { this.parent = parentFrame; progressDialog = new SignatureUpdateProgressDialog(parent); parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); execute(); progressDialog.setVisible(true); if (progressDialog.isCancelled()) { cancel(true); } }
public static void copySequenceToClipboard(Genome genome, String chr, int start, int end, Strand strand) { try { IGV.getMainFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); byte[] seqBytes = genome.getSequence(chr, start, end); if (seqBytes == null) { MessageUtils.showMessage("Sequence not available"); } else { String sequence = new String(seqBytes); SequenceTrack sequenceTrack = IGV.getInstance().getSequenceTrack(); if (strand == Strand.NEGATIVE || (sequenceTrack != null && sequenceTrack.getStrand() == Strand.NEGATIVE)) { sequence = SequenceTrack.getReverseComplement(sequence); } StringUtils.copyTextToClipboard(sequence); } } finally { IGV.getMainFrame().setCursor(Cursor.getDefaultCursor()); } }
@Override public void done() { if (resources.getModuleOutput().getText().hashCode() != hcout) { resources.getMessagespane().setSelectedIndex(1); } if (resources.getLogs().getText().hashCode() != hclogs) { resources.getMessagespane().setSelectedIndex(0); } resources.getProgressBar().setVisible(false); resources.getProgressBar().invalidate(); resources.getProgressBar().validate(); resources.getProgressBar().repaint(); resources.removeProgressListener(this); resources.getProgressBar().setValue(resources.getProgressBar().getMaximum()); this.resources.getMainFrame().setCursor(null); resources.getMainFrame().setEnabled(true); //setCursor(null); //turn off the wait cursor } public void setCurrentProgress(int progress) {
@Override public void done() { if (resources.getModuleOutput().getText().hashCode() != hcout) { resources.getMessagespane().setSelectedIndex(1); } if (resources.getLogs().getText().hashCode() != hclogs) { resources.getMessagespane().setSelectedIndex(0); } resources.getProgressBar().setVisible(false); resources.getProgressBar().invalidate(); resources.getProgressBar().validate(); resources.getProgressBar().repaint(); resources.removeProgressListener(this); resources.getProgressBar().setValue(resources.getProgressBar().getMaximum()); this.resources.getMainFrame().setCursor(null); resources.getMainFrame().setEnabled(true); //setCursor(null); //turn off the wait cursor } public void setCurrentProgress(int progress) {
@Override protected void done() { SnapApp.getDefault().getMainFrame().setCursor(Cursor.getDefaultCursor()); String errorMsg = "The HSV image view could not be created."; try { final ProductSceneView productSceneView = new ProductSceneView(get()); OpenRGBImageViewAction.openDocumentWindow(productSceneView); } catch (OutOfMemoryError e) { Dialogs.showOutOfMemoryError(errorMsg); return; } catch (Exception e) { SnapApp.getDefault().handleError(errorMsg, e); return; } SnapApp.getDefault().setStatusBarMessage(""); } };
@Override protected void done() { SnapApp.getDefault().getMainFrame().setCursor(Cursor.getDefaultCursor()); String errorMsg = "The RGB image view could not be created."; try { ProductSceneView productSceneView = new ProductSceneView(get()); openDocumentWindow(productSceneView); } catch (OutOfMemoryError e) { Dialogs.showOutOfMemoryError(errorMsg); return; } catch (Exception e) { SnapApp.getDefault().handleError(errorMsg, e); return; } SnapApp.getDefault().setStatusBarMessage(""); } };