Example usage for java.awt Cursor Cursor

List of usage examples for java.awt Cursor Cursor

Introduction

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

Prototype

protected Cursor(String name) 

Source Link

Document

Creates a new custom cursor object with the specified name.

Note: this constructor should only be used by AWT implementations as part of their support for custom cursors.

Usage

From source file:com.vgi.mafscaling.MafChartPanel.java

public void mouseExited(MouseEvent e) {
    IsMovable = false;
    initialMovePointY = 0;
    chartPanel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}

From source file:osu.beatmapdownloader.JFrame.java

public void goWebsite() {
       String text = "NewKey";
       L_madeBy.setText("<html>Made by player: <a href=\"\">" + text + "</a></html>");
       L_madeBy.setCursor(new Cursor(Cursor.HAND_CURSOR));
       L_madeBy.addMouseListener(new MouseAdapter() {
           @Override/*ww  w  .ja  v  a 2s. com*/
           public void mouseClicked(MouseEvent e) {
               try {
                   Desktop.getDesktop().browse(new URI("https://osu.ppy.sh/u/637668"));
               } catch (URISyntaxException | IOException ex) {
               }
           }
       });
   }

From source file:net.sf.maltcms.chromaui.chromatogram1Dviewer.ui.panel.Chromatogram1DViewPanel.java

/**
 * Creates new form Chromatogram1DViewPanel
 *///from   w w  w  . j a  va  2 s . c o m
public Chromatogram1DViewPanel(InstanceContent topComponentInstanceContent, Lookup tcLookup,
        ADataset1D<IChromatogram1D, IScan> ds) {
    initComponents();
    this.content = topComponentInstanceContent;
    this.lookup = tcLookup;
    chart = new JFreeChart(new XYPlot());
    ContextAwareChartPanel chartPanel = new ContextAwareChartPanel(chart, true, true, true, true, true);
    Cursor crosshairCursor = new Cursor(Cursor.CROSSHAIR_CURSOR);
    chartPanel.setCursor(crosshairCursor);
    chartPanel.setInitialDelay(100);
    chartPanel.setDismissDelay(30000);
    chartPanel.setReshowDelay(0);
    chartPanel.setFocusable(true);
    chartPanel.setMouseWheelEnabled(true);
    chartPanel.setPopupMenuActionProvider(new ActionProvider());
    addKeyListener(this);
    this.chartPanel = chartPanel;
    add(chartPanel, BorderLayout.CENTER);
    content.add(chartPanel);
}

From source file:us.paulevans.basicxslt.Utils.java

/**
 * Displays an error dialog//from ww  w.j  a va 2  s. co m
 * @param aParent
 * @param aThrowable
 */
public static void showErrorDialog(Frame aParent, Throwable aThrowable) {

    String message;
    Throwable throwableToReport;

    throwableToReport = ExceptionUtils.getRootCause(aThrowable);
    if (throwableToReport == null) {
        throwableToReport = aThrowable;
    }
    message = throwableToReport.getMessage();
    if (StringUtils.isBlank(message)) {
        message = ExceptionUtils.getStackTrace(throwableToReport);
    }
    if (aParent != null) {
        aParent.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }
    JOptionPane.showMessageDialog(aParent,
            MessageFormat.format(stringFactory.getString(LabelStringFactory.ERRORS_MESSAGE), message,
                    AppConstants.BUG_HOME_URL),
            stringFactory.getString(LabelStringFactory.ERRORS_TITLE), JOptionPane.ERROR_MESSAGE);
}

From source file:net.sf.maltcms.chromaui.chromatogram2Dviewer.ui.panel.Chromatogram2DViewerPanel.java

/**
 * Creates new form Chromatogram2DViewerPanel
 */// ww  w . ja  v a  2s .  co m
public Chromatogram2DViewerPanel(InstanceContent topComponentInstanceContent, Lookup tcLookup,
        ADataset2D<IChromatogram2D, IScan2D> ds, PaintScale ps) {
    initComponents();
    this.content = topComponentInstanceContent;
    this.lookup = tcLookup;
    chart = new JFreeChart(new XYPlot());
    chartPanel = new ContextAwareChartPanel(chart, true, true, true, true, true);
    Cursor crosshairCursor = new Cursor(Cursor.CROSSHAIR_CURSOR);
    chartPanel.setCursor(crosshairCursor);
    //        chart.addProgressListener(cdxpanel);
    chartPanel.setInitialDelay(100);
    chartPanel.setDismissDelay(30000);
    chartPanel.setReshowDelay(0);
    chartPanel.setFocusable(true);
    jPanel2.add(chartPanel, BorderLayout.CENTER);
    content.add(chartPanel);
    addKeyListener(this);
    setPaintScale(ps);
}

From source file:ste.travian.gui.WorldController.java

/**
 * Shows the map chart/*w w w . j  a  v a  2s .co m*/
 */
public void showMap() {
    mainWindow.setCursor(new Cursor(Cursor.WAIT_CURSOR));
    executor.execute(new Runnable() {
        public void run() {
            try {
                load();
                mainWindow.showMap(getWorldPanel());
                //
                // do not move the line below, it needs to be here so
                // that all components will have the wait cursor set
                //
                mainWindow.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            } catch (Exception e) {
                mainWindow.setCursor(Cursor.getDefaultCursor());
                mainWindow.error("Error creating the map", e);
            }
        }
    });
}

From source file:com.vgi.mafscaling.MafChartPanel.java

public void mousePressed(MouseEvent e) {
    Insets insets = chartPanel.getInsets();
    int x = (int) ((e.getX() - insets.left) / chartPanel.getScaleX());
    int y = (int) ((e.getY() - insets.top) / chartPanel.getScaleY());
    ChartEntity entity = chartPanel.getChartRenderingInfo().getEntityCollection().getEntity(x, y);
    if (entity == null || !(entity instanceof XYItemEntity))
        return;//from  w  ww  .j  a  v a  2s . c om
    IsMovable = true;
    chartPanel.setCursor(new Cursor(Cursor.HAND_CURSOR));
    xyItemEntity = (XYItemEntity) entity;
    XYPlot plot = chartPanel.getChart().getXYPlot();
    Rectangle2D dataArea = chartPanel.getChartRenderingInfo().getPlotInfo().getDataArea();
    Point2D p = chartPanel.translateScreenToJava2D(e.getPoint());
    initialMovePointY = plot.getRangeAxis().java2DToValue(p.getY(), dataArea, plot.getRangeAxisEdge());
}

From source file:nz.govt.natlib.ndha.manualdeposit.bulkupload.BulkUploadForm.java

public void setWaitCursor(final boolean isWaiting) {
    glass.setVisible(isWaiting);/*from w w  w  .ja v  a2 s . c om*/
    if (isWaiting) {
        final Cursor hourglass = new Cursor(Cursor.WAIT_CURSOR);
        setCursor(hourglass);
    } else {
        final Cursor normal = new Cursor(Cursor.DEFAULT_CURSOR);
        setCursor(normal);
    }
}

From source file:Interfaces.EstadisticaGui.java

private void dibujarGraficos() {
    this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
    abrirBase();//from w w w  .  j  a va  2s  .c o  m
    panelGrande.removeAll();
    Integer anio = (Integer) spinnerAnio.getValue();
    // Creamos y rellenamos el modelo de datos
    LazyList<Categoria> categorias = Categoria.findAll();
    Iterator<Categoria> it = categorias.iterator();
    while (it.hasNext()) {
        Categoria c = it.next();
        if (!c.getString("nombre").equals("COMPRAS")) {
            DefaultCategoryDataset dataset = new DefaultCategoryDataset();
            float[] ingreso = calcularIngreso(c.getInteger("id"), anio);
            dataset.setValue(ingreso[0], c.getString("nombre"), "Enero");
            dataset.setValue(ingreso[1], c.getString("nombre"), "Febrero");
            dataset.setValue(ingreso[2], c.getString("nombre"), "Marzo");
            dataset.setValue(ingreso[3], c.getString("nombre"), "Abril");
            dataset.setValue(ingreso[4], c.getString("nombre"), "Mayo");
            dataset.setValue(ingreso[5], c.getString("nombre"), "Junio");
            dataset.setValue(ingreso[6], c.getString("nombre"), "Julio");
            dataset.setValue(ingreso[7], c.getString("nombre"), "Agosto");
            dataset.setValue(ingreso[8], c.getString("nombre"), "Septiembre");
            dataset.setValue(ingreso[9], c.getString("nombre"), "Octubre");
            dataset.setValue(ingreso[10], c.getString("nombre"), "Noviembre");
            dataset.setValue(ingreso[11], c.getString("nombre"), "Diciembre");
            JFreeChart chart = ChartFactory.createBarChart3D(
                    "Ingresos en la categoria " + c.getString("nombre"), "mes", "Pesos", dataset,
                    PlotOrientation.VERTICAL, true, true, false);
            // Creacin del panel con el grfico
            ChartPanel panelGrafico = new ChartPanel(chart);
            CategoryPlot categoryplot = (CategoryPlot) chart.getPlot();
            org.jfree.chart.axis.CategoryAxis categoryaxis = categoryplot.getDomainAxis();
            categoryaxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(0.2D));
            CategoryItemRenderer categoryitemrenderer = categoryplot.getRenderer();
            categoryitemrenderer.setBaseItemLabelsVisible(true);
            JPanel panelParaGrafico = new JPanel();
            panelParaGrafico.setLayout(new BorderLayout());
            panelGrande.add(panelParaGrafico);
            panelParaGrafico.add(panelGrafico);
        }
    }
    this.pack();
    this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));

}

From source file:osu.beatmapdownloader.JFrame.java

public void apiHelp() {
       String text = "More Info";
       L_apiHelp.setText("<html><a href=\"\">" + text + "</a></html>");
       L_apiHelp.setCursor(new Cursor(Cursor.HAND_CURSOR));
       L_apiHelp.addMouseListener(new MouseAdapter() {
           @Override/*from   ww w. ja  va  2  s .com*/
           public void mouseClicked(MouseEvent e) {
               try {
                   Desktop.getDesktop().browse(new URI("https://osu.ppy.sh/p/api"));
               } catch (URISyntaxException | IOException ex) {
               }
           }
       });
   }