Example usage for java.awt Cursor WAIT_CURSOR

List of usage examples for java.awt Cursor WAIT_CURSOR

Introduction

In this page you can find the example usage for java.awt Cursor WAIT_CURSOR.

Prototype

int WAIT_CURSOR

To view the source code for java.awt Cursor WAIT_CURSOR.

Click Source Link

Document

The wait cursor type.

Usage

From source file:org.openmicroscopy.shoola.agents.imviewer.util.saver.ImgSaver.java

/** Brings up a preview of the image or images to save. */
void previewImage() {
    ImgSaverPreviewer preview = new ImgSaverPreviewer(this);
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    createImages(uiDelegate.getSavingType());
    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    preview.initialize();/*w w w  .ja va 2s  .  c  o  m*/
    UIUtilities.centerAndShow(preview);
}

From source file:au.org.ala.delta.editor.ui.CharacterTree.java

public void collapseAll() {
    try {/*w  ww . j  a  va 2  s .c om*/
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        for (int i = 0; i < getRowCount(); i++) {
            collapseRow(i);
        }
    } finally {
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }
}

From source file:com.microsoft.intellij.forms.CreateWebSiteForm.java

@Override
protected void doOKAction() {
    boolean isOK = true;
    AzureManager manager = AzureManagerImpl.getManager(project);
    mainPanel.getRootPane().getParent().setCursor(new Cursor(Cursor.WAIT_CURSOR));

    try {/*from   w  w  w .j  a v a 2s .co  m*/
        WebSite webSite = manager.createWebSite(subscription.getId(), webHostingPlan,
                nameTextField.getText().trim());
        WebSiteConfiguration webSiteConfiguration = manager.getWebSiteConfiguration(subscription.getId(),
                webSite.getWebSpaceName(), webSite.getName());
        if (customJDK.isSelected() || customJDKUser.isSelected()) {
            CustomJdk task = new CustomJdk(webSiteConfiguration);
            task.queue();
        }
        webSiteConfiguration.setJavaVersion("1.8.0_73");
        String selectedContainer = (String) webContainerComboBox.getSelectedItem();
        if (selectedContainer.equalsIgnoreCase(WebAppsContainers.TOMCAT_8.getName())) {
            webSiteConfiguration.setJavaContainer("TOMCAT");
            webSiteConfiguration.setJavaContainerVersion(WebAppsContainers.TOMCAT_8.getValue());
        } else if (selectedContainer.equalsIgnoreCase(WebAppsContainers.TOMCAT_7.getName())) {
            webSiteConfiguration.setJavaContainer("TOMCAT");
            webSiteConfiguration.setJavaContainerVersion(WebAppsContainers.TOMCAT_7.getValue());
        } else if (selectedContainer.equalsIgnoreCase(WebAppsContainers.JETTY_9.getName())) {
            webSiteConfiguration.setJavaContainer("JETTY");
            webSiteConfiguration.setJavaContainerVersion(WebAppsContainers.JETTY_9.getValue());
        }
        manager.updateWebSiteConfiguration(subscription.getId(), webSite.getWebSpaceName(), webSite.getName(),
                webSite.getLocation(), webSiteConfiguration);
        webAppCreated = webSite.getName();
        Map<WebSite, WebSiteConfiguration> tempMap = AzureSettings.getSafeInstance(project).loadWebApps();
        tempMap.put(webSite, webSiteConfiguration);
        AzureSettings.getSafeInstance(project).saveWebApps(tempMap);
        if (customJDK.isSelected() || customJDKUser.isSelected()) {
            copyWebConfigForCustom(webSiteConfiguration);
        }
    } catch (AzureCmdException e) {
        String errorMessage = e.getMessage();
        if (errorMessage.contains(message("nameConflict"))) {
            errorMessage = message("inUseErrMsg");
            isOK = false;
        }
        PluginUtil.displayErrorDialogAndLog(message("webAppErrTtl"), errorMessage, e);
    } finally {
        mainPanel.getRootPane().getParent().setCursor(Cursor.getDefaultCursor());
    }
    if (isOK) {
        super.doOKAction();
    }
}

From source file:de.juwimm.cms.content.panel.PanDocuments.java

private void loadThumbs(Integer unit) {
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    try {/*from ww  w . ja v a  2  s . c  om*/
        tblDocumentsModel = new DocumentTableModel();
        tblDocumentSorter = new TableSorter(tblDocumentsModel, tblDocuments.getTableHeader());
        tblDocuments.getSelectionModel().clearSelection();
        tblDocuments.setModel(tblDocumentSorter);
        DocumentSlimValue[] dsva = null;
        if (((CboModel) cboRegion.getSelectedItem()).isUnit) {
            dsva = comm.getAllSlimDocumentValues(unit);
        } else {
            dsva = comm.getAllSlimDocumentValues4ViewComponent(viewComponentId);
        }
        panDocumentButtons.removeAll();
        anzahlItems = 0;
        bgrp = new ButtonGroup();
        for (int i = 0; i < dsva.length; i++) {
            DocumentSlimValue dsv = dsva[i];
            tblDocumentsModel.addRow(dsv);
            PanDocumentSymbol pan = new PanDocumentSymbol();
            // pan.setPreferredSize(new Dimension(95,95));
            pan.getFileButton().setIcon(Utils.getIcon4Extension(Utils.getExtension(dsv.getDocumentName())));
            pan.getFileNameLabel().setText(dsv.getDocumentName());
            pan.getFileButton().setActionCommand(dsv.getDocumentId() + "");
            pan.getFileButton().addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    btnFileActionPerformed(e);
                }
            });
            if (intDocId != null && (intDocId.intValue() == dsv.getDocumentId())) {
                pan.getFileButton().doClick();
                mimeType = dsv.getMimeType();
                selectDocument(intDocId);
            }
            panDocumentButtons.add(pan, null);
            anzahlItems++;
            bgrp.add(pan.getFileButton());
            this.setMaxButtonWidth(pan);
        }
        panDocumentButtons.validate();
        panDocumentButtons.repaint();
        resizeScrollpane();
    } catch (Exception exe) {
        log.error("Error loading thumbs", exe);
    }
    this.setCursor(Cursor.getDefaultCursor());
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.EditorUI.java

/** 
 * Save data. /*  ww w.  j  a v a2s. c  o  m*/
 * 
 * @param asynch Pass <code>true</code> to save data asynchronously,
 *              <code>false</code> otherwise.
 */
void saveData(boolean async) {
    saved = true;
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    toolBar.setDataToSave(false);
    if (model.getRefObject() instanceof ExperimenterData) {
        Object exp = userUI.getExperimenterToSave();
        model.fireAdminSaving(exp, async);
        return;
    } else if (model.getRefObject() instanceof GroupData) {
        AdminObject o = groupUI.getAdminObject();
        if (o == null) {
            saved = false;
            setCursor(Cursor.getDefaultCursor());
            toolBar.setDataToSave(true);
            return;
        }
        model.fireAdminSaving(o, async);
        return;
    }
    DataToSave object = generalPane.prepareDataToSave();
    List<Object> metadata = null;
    Object refObject = model.getRefObject();
    if (refObject instanceof ImageData)
        metadata = acquisitionPane.prepareDataToSave();

    model.fireAnnotationSaving(object, metadata, async);
}

From source file:com.josescalia.tumblr.app.MainFrame.java

private void executeMenu(final String beanName) {
    mainPanel.setCursor(new Cursor(Cursor.WAIT_CURSOR));
    progressBar.setIndeterminate(true);//ww  w . j  a  v  a  2  s.  co m
    new SwingWorker<BaseForm, BaseForm>() {
        @Override
        protected BaseForm doInBackground() throws Exception {
            return (BaseForm) context.getBean(beanName);
        }

        @Override
        protected void done() {
            BaseForm frm;
            try {
                removePanelFromMain();
                frm = get();
                frm.showForm();
                frm.setVisible(true);
                mainPanel.setLayout(new BorderLayout());
                mainPanel.add(frm);
                mainPanel.validate();

            } catch (InterruptedException ex) {
                logger.error(ex.getMessage());
                UIAlert.showError(mainPanel, "No Such Form Defined");
            } catch (ExecutionException ex) {
                logger.error(ex.getMessage());
                UIAlert.showError(mainPanel, "Something wrong with the system");
            }
            progressBar.setIndeterminate(false);
            mainPanel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        }
    }.execute();

    //this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}

From source file:vn.topmedia.monitor.form.MDIMain.java

public void monitor() {
    mnuItmLogin.setEnabled(false);// ww w.  j  a va  2s .c  om
    btnLogin.setEnabled(false);
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    monitor = new SMSMonitor(this);
    desktopPane.add(monitor);
    monitor.setVisible(true);
    this.setCursor(Cursor.getDefaultCursor());
    goToTray();

    if (monitorType == Constants.MONITOR_SERVER_TYPE) {
        //Check address avaiable
        monitor.loadMonitorCheck(address);
        //Neu la monitor server thi listern port mac dinh la 9200
        //Dung de nhan message thong qua socket khi Rabbit Server bi loi hoac la muon gui thong tin qua Socket
        //            monitor.startMonitoring();
    }

    //Alert setting
    Alert.setMdiMain(this);
    Alert.setMonitor(monitor);
    loadRabbitClient();
}

From source file:com.floreantpos.main.SetUpWindow.java

public void actionPerformed(ActionEvent e) {
    try {/*  ww w .j  a v a 2  s.  c  om*/
        String command = e.getActionCommand();

        Database selectedDb = (Database) databaseCombo.getSelectedItem();

        final String providerName = selectedDb.getProviderName();
        final String databaseURL = tfServerAddress.getText();
        final String databasePort = tfServerPort.getText();
        final String databaseName = tfDatabaseName.getText();
        final String user = tfUserName.getText();
        final String pass = new String(tfPassword.getPassword());

        final String connectionString = selectedDb.getConnectString(databaseURL, databasePort, databaseName);
        final String hibernateDialect = selectedDb.getHibernateDialect();
        final String driverClass = selectedDb.getHibernateConnectionDriverClass();

        if (CANCEL.equalsIgnoreCase(command)) {
            System.exit(1);
            return;
        }

        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        if (TEST.equalsIgnoreCase(command)) {
            try {
                DatabaseUtil.checkConnection(connectionString, hibernateDialect, driverClass, user, pass);
            } catch (DatabaseConnectionException e1) {
                JOptionPane.showMessageDialog(this, Messages.getString("DatabaseConfigurationDialog.32")); //$NON-NLS-1$
                return;
            }
            connectionSuccess = true;
            JOptionPane.showMessageDialog(this, Messages.getString("DatabaseConfigurationDialog.31")); //$NON-NLS-1$
            return;
        }
        saveConfig(selectedDb, providerName, databaseURL, databasePort, databaseName, user, pass,
                connectionString, hibernateDialect);
        if (CREATE_SAMPLE_DATA.equals(command)) {
            DataImportAction
                    .importMenuItems(DatabaseUtil.class.getResourceAsStream("/floreantpos-menu-items.xml")); //$NON-NLS-1$
        } else if (CREATE_DATABASE.equals(command)) {
            int i = JOptionPane.showConfirmDialog(this, Messages.getString("DatabaseConfigurationDialog.33"), //$NON-NLS-1$
                    Messages.getString("DatabaseConfigurationDialog.34"), JOptionPane.YES_NO_OPTION); //$NON-NLS-1$
            if (i != JOptionPane.YES_OPTION) {
                return;
            }

            i = JOptionPane.showConfirmDialog(this, Messages.getString("DatabaseConfigurationDialog.4"), //$NON-NLS-1$
                    Messages.getString("DatabaseConfigurationDialog.5"), JOptionPane.YES_NO_OPTION); //$NON-NLS-1$
            boolean generateSampleData = false;
            if (i == JOptionPane.YES_OPTION)
                generateSampleData = true;

            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            String createDbConnectString = selectedDb.getCreateDbConnectString(databaseURL, databasePort,
                    databaseName);
            boolean databaseCreated = DatabaseUtil.createDatabase(createDbConnectString, hibernateDialect,
                    driverClass, user, pass, generateSampleData);

            if (databaseCreated) {
                JOptionPane.showMessageDialog(SetUpWindow.this,
                        Messages.getString("DatabaseConfigurationDialog.6") + //$NON-NLS-1$
                                Messages.getString("DatabaseConfigurationDialog.7")); //$NON-NLS-1$
                connectionSuccess = true;
            } else {
                JOptionPane.showMessageDialog(SetUpWindow.this,
                        Messages.getString("DatabaseConfigurationDialog.36")); //$NON-NLS-1$
            }
        } else if (SAVE.equalsIgnoreCase(command)) {
            Integer terminalId = tfTerminalNumber.getInteger();
            Integer defaultPassLen = tfSecretKeyLength.getInteger();
            Integer autoLogOffTime = tfLogoffTime.getInteger();
            Boolean isLogOff = chkAutoLogoff.isSelected();
            Double scaleFactor = tfScaleFactor.getDouble();

            TerminalConfig.setTerminalId(terminalId);
            TerminalConfig.setDefaultPassLen(defaultPassLen);
            TerminalConfig.setScreenScaleFactor(scaleFactor);
            TerminalConfig.setAutoLogoffEnable(isLogOff);
            TerminalConfig.setAutoLogoffTime(autoLogOffTime <= 0 ? 10 : autoLogOffTime);
            try {
                DatabaseUtil.initialize();
                saveConfigData();
            } catch (Exception ex) {
                int i = JOptionPane.showConfirmDialog(this, "Connection Failed. Do you want to save?", //$NON-NLS-1$
                        "Connection status!", JOptionPane.YES_NO_OPTION); //$NON-NLS-1$
                if (i == JOptionPane.YES_OPTION) {
                    System.exit(1);
                }
            }
        }
    } catch (Exception e2) {
        PosLog.error(getClass(), e2);
        POSMessageDialog.showMessage(this, e2.getMessage());
    } finally {
        setCursor(Cursor.getDefaultCursor());
    }
}

From source file:de.juwimm.cms.util.Communication.java

public boolean exitPerformed(ExitEvent e) {
    log.info("Exit-event started");
    int result = JOptionPane.showConfirmDialog(UIConstants.getMainFrame(), rb.getString("dialog.exit.text"),
            rb.getString("dialog.exit"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
    if (result == JOptionPane.YES_OPTION) {
        if (!checkOutPages.isEmpty()) {
            ArrayList<ContentValue> pageList = new ArrayList<ContentValue>();
            Iterator it = checkOutPages.iterator();
            while (it.hasNext()) {
                try {
                    ContentValue current = getClientService().getContent(((Integer) it.next()));
                    pageList.add(current);
                } catch (Exception ex) {
                    String msg = Messages.getString("exception.checkingInAllRemainingPages",
                            Integer.toString(checkOutPages.size()));
                    log.info(msg);/*from w w  w.j  a  va2 s  .c o m*/
                    JOptionPane.showMessageDialog(UIConstants.getMainFrame(), msg, rb.getString("dialog.title"),
                            JOptionPane.INFORMATION_MESSAGE);
                    UIConstants.getMainFrame().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                    while (it.hasNext()) {
                        Integer contentId = (Integer) it.next();
                        try {
                            msg = Messages.getString("exception.checkingInAllRemainingPagesStatusbar",
                                    contentId.toString());
                            UIConstants.setActionStatus(msg);
                            getClientService().checkIn4ContentId(contentId);
                        } catch (Exception exe) {
                            log.error("Exit event error", exe);
                        }
                    }
                    checkOutPages = new ArrayList<Integer>();
                    UIConstants.getMainFrame().setCursor(Cursor.getDefaultCursor());
                    try {
                        if (log.isDebugEnabled()) {
                            log.debug("Calling logout on server");
                        }
                        getClientService().logout();
                    } catch (Exception exe) {
                    }
                    log.info("Goodbye!");
                    loggedIn = false;
                    return true;
                }
            }
            PanCheckInPages pan = new PanCheckInPages(pageList);
            if (rb == null)
                rb = Constants.rb;
            DlgModal dlg = new DlgModal(pan, 300, 500, rb.getString("DlgModal.checkin"));
            dlg.addOkListener(new OkListener(pan, dlg));
            dlg.setVisible(true);
        }
        try {
            if (log.isDebugEnabled()) {
                log.debug("Calling logout on server");
            }
            getClientService().logout();
        } catch (Exception exe) {
        }
        log.info("Goodbye!");
        loggedIn = false;
        return true;
    }
    return false;
}

From source file:VASSAL.launch.ModuleManagerWindow.java

public void setWaitCursor(boolean wait) {
    setCursor(Cursor.getPredefinedCursor(wait ? Cursor.WAIT_CURSOR : Cursor.DEFAULT_CURSOR));
}