Package java.awt

Examples of java.awt.Cursor


   
    /**
     * Update the mouse cursor according the the current operation
     */
    protected void updateCursor(){
        Cursor cursor;
       
        if (currentElementCreator != null) {
            cursor = _creatingElementCursor;
           
        } else if (_translatingSheet){
View Full Code Here


                         "</font></center></html>";
            cvs_build_label.setFont(new java.awt.Font("Dialog", 0, 12));
              cvs_build_label.setForeground(java.awt.Color.red);
              cvs_build_label.setText(str);
              cvs_build_label.setToolTipText(JMConstants.JMULE_FORUMS);
              cvs_build_label.setCursor(new Cursor(Cursor.HAND_CURSOR));
              cvs_build_label.addMouseListener(new MouseAdapter() {
                public void mouseClicked(MouseEvent event) {
                  BrowserLauncher.openURL(JMConstants.JMULE_FORUMS);
                }
              });
View Full Code Here

    {
      showError("No URL specified");
      return;
    }
   
    setCursor(new Cursor(Cursor.WAIT_CURSOR));
   
    try {
      getContainerPlayer().setMediaLocation(location, prefs.autoPlay);
    }
    catch (Throwable e) {
     
      logger.log(Level.WARNING, "" + e, e);
      showError("" + e)// normally we would just want e.getMessage(), but in many cases this can be blank, like a NoPlayerException.
                // for now we'll just include the whole thing which includes the class.  A better way would be to
                // translate an empty NoPlayerException into "Player not found" - which BTW isn't that sensible to a user not familiar with JMF...
     
     

     
      return;
    }
    finally
    {
      setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }
   
    // update prefs with new URL
    if (!prefs.recentUrls.contains(location))
    {  prefs.recentUrls.add(0, location);
View Full Code Here

                // TODO Auto-generated method stub
            }

            public void mouseExited( MouseEvent e )
            {
                url.setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );
            }

            public void mouseEntered( MouseEvent e )
            {
                url.setCursor( new Cursor( Cursor.HAND_CURSOR ) );
            }

            public void mouseClicked( MouseEvent e )
            {
View Full Code Here

  public void dragGestureRecognized(DragGestureEvent dge) {
    GroupTreeNode selectedNode = getSelectedNode();
    if (selectedNode == null)
      return; // nothing to transfer (select manually?)
    Cursor cursor = DragSource.DefaultMoveDrop;
    dragNode = selectedNode;
    dge.getDragSource().startDrag(dge, cursor, selectedNode, this);
  }
View Full Code Here

                sw.start();
                glassPane.setVisible(true);
                String searchTerm = textField.getText();
                try
                {
                    frame.setCursor(new Cursor(Cursor.WAIT_CURSOR));
                    String searchType = null;
                    for (Enumeration<AbstractButton> elements = type
                            .getElements(); elements.hasMoreElements();)
                    {
                        AbstractButton button = elements.nextElement();
                        if (button.isSelected())
                        {
                            searchType = button.getText();
                            break;
                        }
                    }
                    displayPhotos(flickrSearchService.searchPhotos(searchType,
                            searchTerm));
                } catch (Exception e1)
                {
                    e1.printStackTrace();
                } finally
                {
                    frame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
                    frame.pack();
                    center();
                    glassPane.setVisible(false);
                    logger.info(format("finished searching for %s in %d ms",
                            searchTerm, sw.getTime()));
View Full Code Here

            // taskUnderPoint="+taskUnderPoint);
            if (taskUnderPoint == null) {
                setDefaultCursor();
            } else {
                if (itemUnderPoint instanceof TaskBoundaryChartItem) {
                    Cursor cursor = ((TaskBoundaryChartItem) itemUnderPoint)
                            .isStartBoundary() ? W_RESIZE_CURSOR
                            : E_RESIZE_CURSOR;
                    setCursor(cursor);
                }
                // special cursor
View Full Code Here

        }
      }

      public void mouseExited(MouseEvent e) {
        if (bDrag) {
          setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
          bDrag = false;
        }
      }
    });
    addMouseMotionListener(new MouseMotionAdapter() {
      public void mouseDragged(MouseEvent e) {
        int x = e.getX();
        int y = e.getY();
        if (bDrag && x < iWidth) {
          int w = x - iXDrag;
          if (w < 0) {
            w = 0;
          }
          iColWidth[iColDrag] = w;
          adjustScroll();
          repaint();
        }
        else {
          //  Drag selection
          if(y > iRowHeight) {
            if(clearNextDrag) {
              clearSel();
              clearNextDrag = false;
            }
            int row = rowForY(y);
            if(row < model.getRowCount()) {
              if(lastDragSel != -1) {
                //  TODO allow up drag selection without clearing previous selection
                if(row < lastDragSel) {
                  for(int j = row + 1; j <= lastDragSel; j++) {
                    selRow(j, false);                 
                  }
                  selRow(row, true);               
                }
                else {
                  for(int i = lastDragSel; i <= row; i++) {
                    selRow(i, true);               
                  }               
                }
              }
              else {
                selRow(row, true);
              }
              repaint();
              lastDragSel = row;
             }
          }
        }
      }

      public void mouseMoved(MouseEvent e) {
        int x = e.getX();
        int y = e.getY();
        if (y <= iRowHeight) {
          int xb = x;
          x += iX - iGridWidth;
          int i = model.getColumnCount() - 1;
          for (; i >= 0; i--) {
            if (x > -7 && x < 7) {
              break;
            }
            x += iColWidth[i];
          }
          if (i >= 0) {
            if (!bDrag) {
              setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
              bDrag = true;
              iXDrag = xb - iColWidth[i];
              iColDrag = i;
            }
            return;
          }
        }
        if (bDrag) {
          setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
          bDrag = false;
        }
      }
     
    });
View Full Code Here

        public void mouseEntered(MouseEvent e) {
            setDefaultCursor();
        }

        public void mouseExited(MouseEvent e) {
            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        }
View Full Code Here

      actions.put(ActionType.SHOW_NEXT, showNextAction);
     
      actions.put(ActionType.SEARCH, new ResourceAction(preferences, HelpPane.class, ActionType.SEARCH.name()) {
          @Override
          public void actionPerformed(ActionEvent ev) {
            final Cursor previousCursor = getCursor();
            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            try {
              String searchedText = searchTextField.getText().trim();
              if (searchedText.length() > 0) {
                controller.search(searchedText);
View Full Code Here

TOP

Related Classes of java.awt.Cursor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.