Example usage for java.awt Cursor DEFAULT_CURSOR

List of usage examples for java.awt Cursor DEFAULT_CURSOR

Introduction

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

Prototype

int DEFAULT_CURSOR

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

Click Source Link

Document

The default cursor type (gets set if no cursor is defined).

Usage

From source file:cn.pholance.datamanager.common.components.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.getInstance(jasperReportsContext).print(jasperPrint, true);
            } catch (Exception ex) {
                if (log.isErrorEnabled()) {
                    log.error("Print error.", ex);
                }//from   www  . j a  v a2 s. c  o  m
                JOptionPane.showMessageDialog(JRViewer.this, getBundleString("error.printing"));
            } finally {
                JRViewer.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                btnPrint.setEnabled(true);
            }
        }
    });

    thread.start();

}

From source file:org.gumtree.vis.hist2d.Hist2DPanel.java

@Override
public void mousePressed(MouseEvent e) {
    //        int mods = e.getModifiers();
    //        if (isMaskingEnabled() && (mods & maskingKeyMask) != 0) {
    if (isMaskingEnabled()) {
        // Prepare masking service.
        int cursorType = findCursorOnSelectedItem(e.getX(), e.getY());
        if (cursorType == Cursor.DEFAULT_CURSOR) {
            Rectangle2D screenDataArea = getScreenDataArea(e.getX(), e.getY());
            if (screenDataArea != null) {
                this.maskPoint = getPointInRectangle(e.getX(), e.getY(), screenDataArea);
            } else {
                this.maskPoint = null;
            }//from   w w  w.  j  ava  2s .c om
        } else {
            if (cursorType == Cursor.MOVE_CURSOR) {
                Point2D point = translateScreenToChart(translateScreenToJava2D(e.getPoint()));
                if (point != null) {
                    this.maskMovePoint = point;
                }
            }
            setMaskDragIndicator(cursorType);
        }
    }
    if (getMaskDragIndicator() == Cursor.DEFAULT_CURSOR) {
        if (e.getX() < getScreenDataArea().getMaxX()) {
            super.mousePressed(e);
        }
    }
}

From source file:neg.JRViewerComercialProveedor.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);
                JRViewerComercialProveedor.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                JasperPrintManager.printReport(jasperPrint, true);
            } catch (Exception ex) {
                if (log.isErrorEnabled())
                    log.error("Print error.", ex);

                JOptionPane.showMessageDialog(JRViewerComercialProveedor.this,
                        getBundleString("error.printing"));
            } finally {
                JRViewerComercialProveedor.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                btnPrint.setEnabled(true);
            }/*w w  w  .  ja  v  a2  s  .  co  m*/
        }
    });

    thread.start();

}

From source file:neg.JRViewerInformeUnitario.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);
                JRViewerInformeUnitario.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                JasperPrintManager.printReport(jasperPrint, true);
            } catch (Exception ex) {
                if (log.isErrorEnabled())
                    log.error("Print error.", ex);

                JOptionPane.showMessageDialog(JRViewerInformeUnitario.this, getBundleString("error.printing"));
            } finally {
                JRViewerInformeUnitario.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                btnPrint.setEnabled(true);
            }//from  ww  w  .  j a  v  a2  s.  c o  m
        }
    });

    thread.start();

}

From source file:neg.JRViewerComercial.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);
                JRViewerComercial.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                JasperPrintManager.printReport(jasperPrint, true);
            } catch (Exception ex) {
                if (log.isErrorEnabled())
                    log.error("Print error.", ex);

                JOptionPane.showMessageDialog(JRViewerComercial.this, getBundleString("error.printing"));
            } finally {
                JRViewerComercial.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                btnPrint.setEnabled(true);
            }/*w  ww  .j  ava2s  . c  om*/
        }
    });

    thread.start();

}

From source file:org.colombbus.tangara.EditorFrame.java

/**
 * This method initializes msgButtons/* w  w  w. ja  va2s  . co  m*/
 *
 * @return javax.swing.JPanel
 */
private JPanel getMsgButtons() {
    if (msgButtons == null) {
        toProgramLabel = new JLabel();
        toProgramLabel.setText(Messages.getString("EditorFrame.button.copyInProgramMode")); //$NON-NLS-1$
        toProgramLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 13)); //$NON-NLS-1$
        toProgramLabel.setForeground(new Color(60, 87, 174));
        toProgramLabel
                .setIcon(new ImageIcon(getClass().getResource("/org/colombbus/tangara/to_program_off.png"))); //$NON-NLS-1$
        toProgramLabel.setEnabled(false);
        toProgramLabel.addMouseListener(new java.awt.event.MouseAdapter() {
            @Override
            public void mousePressed(java.awt.event.MouseEvent e) {
                console.insertCodeToProgram();
            }

            @Override
            public void mouseExited(java.awt.event.MouseEvent e) {
                if (!noCodeSelected) {
                    setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
                    toProgramLabel.setForeground(new Color(60, 87, 174));
                }
            }

            @Override
            public void mouseEntered(java.awt.event.MouseEvent e) {
                if (!noCodeSelected) {
                    setCursor(new Cursor(Cursor.HAND_CURSOR));
                    toProgramLabel.setForeground(new Color(100, 100, 255));
                }
            }
        });

        selectAllLabel = new JLabel();
        selectAllLabel.setText(Messages.getString("EditorFrame.button.selectAll")); //$NON-NLS-1$
        selectAllLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 13)); //$NON-NLS-1$
        selectAllLabel.setForeground(new Color(60, 87, 174));
        selectAllLabel.setIcon(new ImageIcon(getClass().getResource("/org/colombbus/tangara/select_all.png"))); //$NON-NLS-1$
        selectAllLabel.addMouseListener(new java.awt.event.MouseAdapter() {
            @Override
            public void mousePressed(java.awt.event.MouseEvent e) {
                console.selectAll();
            }

            @Override
            public void mouseExited(java.awt.event.MouseEvent e) {
                setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
                selectAllLabel.setForeground(new Color(60, 87, 174));
            }

            @Override
            public void mouseEntered(java.awt.event.MouseEvent e) {
                setCursor(new Cursor(Cursor.HAND_CURSOR));
                selectAllLabel.setForeground(new Color(100, 100, 255));
            }
        });

        deselectAllLabel = new JLabel();
        deselectAllLabel.setText(Messages.getString("EditorFrame.button.deselectAll")); //$NON-NLS-1$
        deselectAllLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 13)); //$NON-NLS-1$
        deselectAllLabel.setForeground(new Color(60, 87, 174));
        deselectAllLabel
                .setIcon(new ImageIcon(getClass().getResource("/org/colombbus/tangara/select_none.png"))); //$NON-NLS-1$
        deselectAllLabel.addMouseListener(new java.awt.event.MouseAdapter() {
            @Override
            public void mousePressed(java.awt.event.MouseEvent e) {
                console.clearSelection();
            }

            @Override
            public void mouseExited(java.awt.event.MouseEvent e) {
                setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
                deselectAllLabel.setForeground(new Color(60, 87, 174));
            }

            @Override
            public void mouseEntered(java.awt.event.MouseEvent e) {
                setCursor(new Cursor(Cursor.HAND_CURSOR));
                deselectAllLabel.setForeground(new Color(100, 100, 255));
            }
        });

        JLabel separatorLabel1 = new JLabel("        "); //$NON-NLS-1$
        JLabel separatorLabel2 = new JLabel("        "); //$NON-NLS-1$

        msgButtons = new JPanel();
        msgButtons.setLayout(new FlowLayout());
        msgButtons.setBackground(new Color(240, 240, 240));
        msgButtons.add(toProgramLabel);
        msgButtons.add(separatorLabel1);
        msgButtons.add(selectAllLabel);
        msgButtons.add(separatorLabel2);
        msgButtons.add(deselectAllLabel);
    }
    return msgButtons;
}

From source file:ireport_5_6_0.view.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() {
        @Override//from   w  ww.  j a v a 2s . c o  m
        public void run() {
            try {

                btnPrint.setEnabled(false);
                JRViewer.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                JasperPrintManager.getInstance(jasperReportsContext).print(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);
            }
        }
    });
    thread.start();
}

From source file:org.gumtree.vis.hist2d.Hist2DPanel.java

/**
 * Handles a 'mouse released' event.  On Windows, we need to check if this
 * is a popup trigger, but only if we haven't already been tracking a zoom
 * rectangle.//from   w  w  w. ja  v a 2s  . c  o m
 *
 * @param e  information about the event.
 */
public void mouseReleased(MouseEvent e) {
    if (currentMaskRectangle != null) {
        // reset masking service.
        maskPoint = null;
        currentMaskRectangle = null;
    } else {
        //        } else if (getScreenDataArea().contains(e.getPoint())){
        super.mouseReleased(e);
    }
    setMaskDragIndicator(Cursor.DEFAULT_CURSOR);
    this.maskMovePoint = null;
}

From source file:neg.JRViewerSin.java

private void btnPrintActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintActionPerformed
    // Add your handling code here:

    Thread thread = new Thread(new Runnable() {
        public void run() {
            try {

                btnPrint.setEnabled(false);
                JRViewerSin.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                JasperPrintManager.printReport(jasperPrint, true);
            } catch (Exception ex) {
                if (log.isErrorEnabled())
                    log.error("Print error.", ex);

                JOptionPane.showMessageDialog(JRViewerSin.this, getBundleString("error.printing"));
            } finally {
                JRViewerSin.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                btnPrint.setEnabled(true);
            }/*www. j a va2  s .  co  m*/
        }
    });

    thread.start();
}

From source file:lejos.pc.charting.LogChartFrame.java

/** Attempt to start a connection using a thread so the GUI stays responsive. Manage connect button state
 * @param e//ww w.  j  a v  a  2s  .c  o  m
 */
private void jButtonConnect_actionPerformed(ActionEvent e) {
    final ActionEvent ee = e;
    Runnable doAction = new Runnable() {
        public void run() {
            if (jButtonConnect.getText().equals("Connect")) {
                if (!isNXTConnected) {
                    jButtonConnect.setText("Connecting..");
                    jButtonConnect.setEnabled(false);
                    LogChartFrame.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                    if (makeConnection()) {
                        jButtonConnect.setText("Disconnect");
                    } else {
                        jButtonConnect.setText("Connect");
                    }
                    LogChartFrame.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                    jButtonConnect.setEnabled(true);
                }

                System.out.println(ee.getActionCommand().toString());
            } else {
                closeCurrentConnection();
            }
        }
    };
    new Thread(doAction).start();
}