Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Cursor


        lblStyleAuthorValue = new Label (compositeStyleInfo, SWT.HORIZONTAL);
        lblStyleAuthorValue.setText(""); //$NON-NLS-1$
       
        previewImage = new Composite(gBPreview, SWT.NONE);
        previewImage.setLayoutData(new RowData(233, 160));
        previewImage.setCursor(new Cursor(display, SWT.CURSOR_HAND));
        previewImage.setToolTipText(Messages.Wizard_CloudMade_PreviewGetFullMap);
        previewImage.addMouseListener(new MouseListener() {

            public void mouseDoubleClick(MouseEvent arg0) {}
            public void mouseUp(MouseEvent arg0) {}
View Full Code Here


    private static int margin = 2;
   
public DragHandle(Composite parent) {
    super(parent, SWT.NONE);
   
    dragCursor = new Cursor(parent.getDisplay(),
            SWT.CURSOR_SIZEALL);
   
    addPaintListener(this);
   
    descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(WorkbenchPlugin.PI_WORKBENCH, "icons/misc/handle.gif")//$NON-NLS-1$
View Full Code Here

        Control topShell = shell.getParent();
        if (topShell != null) {
          shell = topShell;
        }
      }
      Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
      shell.setCursor(busy);
      // Get the external editors available
      EditorRegistry reg = (EditorRegistry) WorkbenchPlugin.getDefault()
          .getEditorRegistry();
      externalEditors = reg.getSortedEditorsFromOS();
      externalEditors = filterEditors(externalEditors);
      externalEditorImages = getImages(externalEditors);
      // Clean up
      shell.setCursor(null);
      busy.dispose();
    }
    return externalEditors;
  }
View Full Code Here

          .getSite()).getPane().getControl();
      Control[] paneChildren = paneComposite.getChildren();
      Composite toDisable = ((Composite) paneChildren[0]);
      toDisable.setEnabled(false);
      if (waitCursor == null) {
        waitCursor = new Cursor(workbenchPart.getSite().getWorkbenchWindow().getShell().getDisplay(), SWT.CURSOR_WAIT);
      }
      originalCursor = paneComposite.getCursor();
      paneComposite.setCursor(waitCursor);
    }
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public static Cursor getCursor(int type) {
    String name = "CURSOR:" + type;
    if (resources.containsKey(name))
      return (Cursor) resources.get(name);
    Cursor cursor = new Cursor(Display.getDefault(), type);
    resources.put(name, cursor);
    return cursor;
  }
View Full Code Here

        super(MOUSE|WHEEL|MOTION);
    }

    @Override
    public void init( IConfigurationElement element ) {
        Cursor editCursor=null;
        IToolManager toolManager = ApplicationGIS.getToolManager();
       
        /*
         * Vitalus: The modern tool cursor approach is used - the order of finding the
         * default cursor:
         * 1) Try to find default cursor from "toolCursorId" attribute
         * 2) Try to find child configuration element "cursor"
         * 3) Set default system arrow cursor
         */
        String cursorId = element.getAttribute("toolCursorId"); //$NON-NLS-1$
        if(cursorId != null){
            editCursor = toolManager.findToolCursor(cursorId);
        }
        if(editCursor == null){
            IConfigurationElement[] cursorElement = element.getChildren("cursor"); //$NON-NLS-1$
            editCursor = new CursorProxy(cursorElement[0]).getCursor();
        }
       
        if( editCursor==null ){
            editCursor=Display.getDefault().getSystemCursor(SWT.CURSOR_ARROW);
        }

        //Must be configured in "org.locationtech.udig.tool.default" plugin
        Cursor selectionCursor = toolManager.findToolCursor("boxSelectionCursor"); //$NON-NLS-1$
        handler=new EditToolHandler(selectionCursor, editCursor);
        initRequiredActivators();
        EditToolConfigurationHelper editToolConfigurationHelper = new EditToolConfigurationHelper(getHandler().getBehaviours());
        initEventBehaviours(editToolConfigurationHelper);
        initEnablementBehaviours(handler.getEnablementBehaviours());
View Full Code Here

  private void createNewTools() {

    this.tools = new LinkedList<ImageTool>();

    // cursors:
    Cursor cursor = null;
    Image image = null;
    Display device = Display.getCurrent();

    image = this.registry.get("Add"); //$NON-NLS-1$
    cursor = new Cursor(device, image.getImageData(), 8, 8);
    AddMarkImageTool addTool = new AddMarkImageTool(cursor, this);

    image = this.registry.get("Delete"); //$NON-NLS-1$
    cursor = new Cursor(device, image.getImageData(), 1, 14);
    DeleteMarkImageTool deleteTool = new DeleteMarkImageTool(cursor, this);

    image = this.registry.get("Move"); //$NON-NLS-1$
    cursor = new Cursor(device, image.getImageData(), 6, 6);
    MoveMarkImageTool moveTool = new MoveMarkImageTool(cursor, this);

    image = this.registry.get("ZoomIn"); //$NON-NLS-1$
    cursor = new Cursor(device, image.getImageData(), 5, 5);
    ZoomInImageTool zoomInTool = new ZoomInImageTool(cursor, this);

    image = this.registry.get("ZoomOut"); //$NON-NLS-1$
    cursor = new Cursor(device, image.getImageData(), 5, 5);
    ZoomOutImageTool zoomOutTool = new ZoomOutImageTool(cursor, this);

    image = this.registry.get("Pan"); //$NON-NLS-1$
    cursor = new Cursor(device, image.getImageData(), 7, 7);
    PanImageTool panTool = new PanImageTool(cursor, this);

    this.tools.add(addTool);
    this.tools.add(deleteTool);
    this.tools.add(moveTool);
View Full Code Here

                    }
                }
            };
           
            Control focusControl = null;
            Cursor arrowCursor = null;
            Cursor waitCursor = null;
            try {
                focusControl = display.getFocusControl();
                progressMonitorPart.setVisible(true);
                runButton.setEnabled(false);
                cancelButton.removeSelectionListener(closeListener);
                cancelButton.addSelectionListener(cancelListener);
                waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
                setDisplayCursor(waitCursor);
                // Set the arrow cursor to the cancel component.
                arrowCursor = new Cursor(display, SWT.CURSOR_ARROW);
                cancelButton.setText(IDialogConstants.CANCEL_LABEL);
                cancelButton.setCursor(arrowCursor);
                cancelButton.setFocus();
                setMessage("Validation in progress...");
                PlatformGIS.runBlockingOperation(process, progressMonitorPart);
                //progressMonitorPart.setVisible(false);
            } catch (InvocationTargetException e1) {
                // TODO Handle InvocationTargetException
                throw (RuntimeException) new RuntimeException( ).initCause( e1 );
            } catch (InterruptedException e1) {
                // TODO Handle InterruptedException
                throw (RuntimeException) new RuntimeException( ).initCause( e1 );
            } finally {
                //restore listeners
                cancelButton.removeSelectionListener(cancelListener);
                cancelButton.addSelectionListener(closeListener);
                cancelButton.setText(IDialogConstants.CLOSE_LABEL);
                //fix cursors
                setDisplayCursor(null);
                cancelButton.setCursor(null);
                waitCursor.dispose();
                waitCursor = null;
                arrowCursor.dispose();
                arrowCursor = null;
                //enable buttons
                cancelButton.setEnabled(true);
View Full Code Here

        }
    }
   
    private boolean updateSLD() {
        //busy cursor
        Cursor waitCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_WAIT);
        setDisplayCursor(waitCursor);

        //generate the SLD
        StyledLayerDescriptor sld = null;
        Style style = null;
View Full Code Here

                            y = 0;
                        }
                        if (imageDescriptor == null || imageDescriptor.getImageData() == null)
                            cursor = getSystemCursor(cursorID);
                        else
                            cursor = new Cursor(Display.getDefault(), imageDescriptor
                                    .getImageData(), x, y);
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.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.