Example usage for java.awt Cursor getDefaultCursor

List of usage examples for java.awt Cursor getDefaultCursor

Introduction

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

Prototype

public static Cursor getDefaultCursor() 

Source Link

Document

Return the system default cursor.

Usage

From source file:org.eurocarbdb.application.glycoworkbench.plugin.PeakAnnotationCalibrationPanel.java

public void onActivateZooming() {
    is_moving = false;
    theChartPanel.setCursor(Cursor.getDefaultCursor());
    theChartPanel.setDomainZoomable(true);
    theChartPanel.setRangeZoomable(true);
}

From source file:org.eclipse.birt.chart.device.swing.SwingEventHandler.java

public void mouseMoved(MouseEvent e) {
    final Point p = e.getPoint();

    // 1. CHECK FOR MOUSE-CLICK TRIGGERS
    ShapedAction sa = getShapedActionForConditionPoint(
            new TriggerCondition[] { TriggerCondition.MOUSE_CLICK_LITERAL, TriggerCondition.ONCLICK_LITERAL,
                    TriggerCondition.ONMOUSEDOWN_LITERAL, TriggerCondition.ONMOUSEOVER_LITERAL,
                    TriggerCondition.ONMOUSEMOVE_LITERAL },
            p);/*  ww w . ja va 2 s .  c o m*/

    if (sa != null) {
        setCursor((JComponent) iun.peerInstance(), sa.getCursor(), Cursor.getDefaultCursor());
    } else {
        setCursor((JComponent) iun.peerInstance(), null, Cursor.getDefaultCursor());
    }

    // 2. CHECK FOR MOUSE-HOVER CONDITION

    handleAction(new TriggerCondition[] { TriggerCondition.MOUSE_HOVER_LITERAL,
            TriggerCondition.ONMOUSEMOVE_LITERAL, TriggerCondition.ONMOUSEOVER_LITERAL }, e, false);
}

From source file:AltiConsole.AltiConsoleMainScreen.java

public AltiConfigData retrieveAltiConfig() {
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    AltiConfigData Alticonfig = null;/*www  .  jav a  2s  .com*/
    Alticonfig = new AltiConfigData();

    if (Serial.getConnected() == false) {
        boolean ret = false;
        ret = ConnectToAlti();
        if (!ret) {
            System.out.println("retrieveAltiConfig - Data retrieval timed out1\n");
            this.setCursor(Cursor.getDefaultCursor());
            return null;
        }
    }
    Serial.clearInput();
    //Serial.DataReady = false;
    Serial.setDataReady(false);
    // send command to switch off the continuity test
    Serial.writeData("b;\n");
    System.out.println("b;\n");
    long timeOut = 10000;
    if (UserPref.getRetrievalTimeout() != null && UserPref.getRetrievalTimeout() != "")
        timeOut = Long.decode(UserPref.getRetrievalTimeout());
    long startTime = System.currentTimeMillis();
    //while (!Serial.getDataReady()) {
    while (true) {
        long currentTime = System.currentTimeMillis();
        if (Serial.getDataReady())
            break;
        if ((currentTime - startTime) > timeOut) {
            // This is some sort of data retrieval timeout
            System.out.println("retrieveAltiConfig - Data retrieval timed out2\n");
            if (Serial.getDataReady())
                System.out.println("Data is true\n");
            else
                System.out.println("Data is false\n");
            JOptionPane.showMessageDialog(null, trans.get("AltiConsoleMainScreen.dataTimeOut") + "0",
                    trans.get("AltiConsoleMainScreen.ConnectionError"), JOptionPane.ERROR_MESSAGE);
            this.setCursor(Cursor.getDefaultCursor());

            return null;
        }
    }
    if (Serial.AltiCfg != null) {
        System.out.println("Reading altimeter config\n");
        System.out.println(Serial.AltiCfg.getUnits() + "\n");
        Alticonfig = Serial.AltiCfg;

    }
    this.setCursor(Cursor.getDefaultCursor());
    return Alticonfig;
}

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

public void monitor() {
    mnuItmLogin.setEnabled(false);//from   w  w w .j a va2 s  .  c o  m
    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:org.openmicroscopy.shoola.agents.metadata.editor.EditorUI.java

/** 
 * Save data. /* ww w. j a v  a2  s  . 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:org.openmicroscopy.shoola.agents.metadata.editor.GeneralPaneUI.java

/** 
 * Clears data to save.//from   w  w w. j  a v a  2s. c om
 * 
 * @param oldObject The previously selected object.
 */
void clearData(Object oldObject) {
    Iterator<AnnotationUI> i = components.iterator();
    AnnotationUI ui;
    while (i.hasNext()) {
        ui = i.next();
        ui.clearData(oldObject);
        ui.clearDisplay();
    }
    setCursor(Cursor.getDefaultCursor());
}

From source file:com.limegroup.gnutella.gui.GUIUtils.java

/**
 * Returns a <code>MouseListener</code> that changes the cursor and
 * notifies <code>actionListener</code> on click.
 *//*from ww  w .j  ava 2 s.  c  o  m*/
public static MouseListener getURLInputListener(final ActionListener actionListener) {
    return new MouseAdapter() {
        public void mouseEntered(MouseEvent e) {
            JComponent comp = (JComponent) e.getComponent();
            comp.getTopLevelAncestor().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        }

        public void mouseExited(MouseEvent e) {
            JComponent comp = (JComponent) e.getComponent();
            comp.getTopLevelAncestor().setCursor(Cursor.getDefaultCursor());
        }

        public void mouseClicked(MouseEvent e) {
            actionListener.actionPerformed(new ActionEvent(e.getComponent(), 0, null));
        }
    };
}

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);// w  ww . j  av  a  2  s. com
                    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:de.juwimm.cms.content.panel.PanDocuments.java

private void loadThumbs(Integer unit) {
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    try {/*from   ww  w. j  a  v  a  2 s. com*/
        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: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 {//w ww.ja v  a 2  s .  c  o 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();
    }
}