Package java.awt

Examples of java.awt.Cursor$CursorDisposer


  private Thread runWeaverThread;

  private Thread createWeaverThread() {
    return new Thread(new Runnable() {
      public void run() {
        Cursor oldCursor = getTopLevelAncestor().getCursor();
        getTopLevelAncestor().setCursor(
            Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

        try {
          status.setText("Running");
View Full Code Here


    }
  }// GEN-LAST:event_pnlLinksMouseDragged

  final void pnlLinksMouseReleased() {// GEN-FIRST:event_pnlLinksMouseReleased
    // Add your handling code here:
    pnlLinks.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
  }// GEN-LAST:event_pnlLinksMouseReleased
View Full Code Here

  /**
   * @param evt
   */
  final void pnlLinksMousePressed(final java.awt.event.MouseEvent evt) {
    // Add your handling code here:
    pnlLinks.setCursor(new Cursor(Cursor.MOVE_CURSOR));

    downX = evt.getX();
    downY = evt.getY();
  }// GEN-LAST:event_pnlLinksMousePressed
View Full Code Here

        if (element instanceof JRPrintHyperlink
            && ((JRPrintHyperlink) element).getHyperlinkType() != JRHyperlink.HYPERLINK_TYPE_NONE) {
          hyperlink = (JRPrintHyperlink) element;

          link = new JPanel();
          link.setCursor(new Cursor(Cursor.HAND_CURSOR));
          link.setLocation((int) (element.getX() * realZoom),
              (int) (element.getY() * realZoom));
          link.setSize((int) (element.getWidth() * realZoom),
              (int) (element.getHeight() * realZoom));
          link.setOpaque(false);
 
View Full Code Here

      private void setMode(int x, int y){
        boolean nearLeft=(Math.abs(8*(x-selection.x))<selection.width);
        boolean nearRight=(Math.abs(8*(selection.x+selection.width-x))<selection.width);
        boolean nearTop=(Math.abs(8*(y-selection.y))<selection.height);
        boolean nearBottom=(Math.abs(8*(selection.y+selection.height-y))<selection.height);
        Cursor cursor=Cursor.getDefaultCursor();
        selectionMode=SelectionMode.RESIZE;
        if (nearLeft){
          if(nearTop){movePoint=MovePoint.TOP_LEFT;cursor=Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR);}
          else if(nearBottom){movePoint=MovePoint.BOTTOM_LEFT;cursor=Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR);}
          else if(!lockAspectRatio){movePoint=MovePoint.LEFT; cursor=Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR);}
View Full Code Here

        if (selectionMode==SelectionMode.RESIZE) resizeSelection(deltaX,deltaY);
        else moveSelection(deltaX,deltaY);
      }
     
      private void resizeSelection(int dx, int dy){
        Cursor cursor=getCursor();
        switch (cursor.getType()){
          case Cursor.E_RESIZE_CURSOR:
            if(!lockAspectRatio)updateSelection(dx,false,0,false);
            break;
          case Cursor.W_RESIZE_CURSOR:
            if(!lockAspectRatio)updateSelection(dx,true,0,false);
View Full Code Here

       
        return convertBuiltInCursor(e, cursorStr);
    }
   
    public Cursor convertBuiltInCursor(Element e, String cursorStr) {
        Cursor cursor = null;

        // The CSS engine guarantees an non null, non empty string
        // as the computed value for cursor. Therefore, the following
        // test is safe.
        if (cursorStr.charAt(0) == 'a') {
View Full Code Here

                    // We go an element, check it is of type cursor
                    String cursorNS = cursorElement.getNamespaceURI();
                    if (SVGConstants.SVG_NAMESPACE_URI.equals(cursorNS)
                        &&
                        SVGConstants.SVG_CURSOR_TAG.equals(cursorElement.getNodeName())) {
                        Cursor c = convertSVGCursorElement(cursorElement);
                        if (c != null) {
                            return c;
                        }
                    }
                }
View Full Code Here

        CursorDescriptor desc = new CursorDescriptor(purl, x, y);

        //
        // Check if there is a cursor in the cache for this url
        //
        Cursor cachedCursor = cursorCache.getCursor(desc);

        if (cachedCursor != null) {
            return cachedCursor;
        }
       
        //
        // Load image into Filter f and transform hotSpot to
        // cursor space.
        //
        Point2D.Float hotSpot = new Point2D.Float(x, y);
        Filter f = cursorHrefToFilter(cursorElement,
                                      purl,
                                      hotSpot);
        if (f == null) {
            cursorCache.clearCursor(desc);
            return null;
        }
           
        // The returned Filter is guaranteed to create a
        // default rendering of the desired size
        Rectangle cursorSize = f.getBounds2D().getBounds();
        RenderedImage ri = f.createScaledRendering(cursorSize.width,
                                                   cursorSize.height,
                                                   null);
        Image img = null;

        if (ri instanceof Image) {
            img = (Image)ri;
        } else {
            img = renderedImageToImage(ri);
        }

        // Make sure the not spot does not fall out of the cursor area. If it
        // does, then clamp the coordinates to the image space.
        hotSpot.x = hotSpot.x < 0 ? 0 : hotSpot.x;
        hotSpot.y = hotSpot.y < 0 ? 0 : hotSpot.y;
        hotSpot.x = hotSpot.x > (cursorSize.width-1) ? cursorSize.width - 1 : hotSpot.x;
        hotSpot.y = hotSpot.y > (cursorSize.height-1) ? cursorSize.height - 1: hotSpot.y;

        //
        // The cursor image is now into 'img'
        //
        Cursor c = Toolkit.getDefaultToolkit()
            .createCustomCursor(img,
                                new Point((int)Math.round(hotSpot.x),
                                          (int)Math.round(hotSpot.y)),
                                purl.toString());
View Full Code Here

            userAgent = ua;
        }

        public void handleEvent(Event evt) {
            SVGAElement elt = (SVGAElement)evt.getCurrentTarget();
            Cursor cursor = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
            userAgent.setSVGCursor(cursor);
            userAgent.openLink(elt);
            evt.stopPropagation();
        }
View Full Code Here

TOP

Related Classes of java.awt.Cursor$CursorDisposer

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.