Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Cursor


    protected Cursor calculateCursor() {
        EditPart targetEditPart = getTargetEditPart();
        if (isInState(STATE_INITIAL)
               && targetEditPart instanceof NodeEditPart)
        {
            final Cursor  nodeCursor =
                ((NodeEditPart)targetEditPart).getCursor(getLocation());
           
            // if the edit part specified a custom cursor and there is no
            // active drag tracker (which would otherwise manage cursor)
            // then set the custom cursor
View Full Code Here


    StyledText text = fTextViewer.getTextWidget();
    if (text == null || text.isDisposed())
      return;
    Display display = text.getDisplay();
    if (fCursor == null)
      fCursor = new Cursor(display, SWT.CURSOR_HAND);
    text.setCursor(fCursor);
  }
View Full Code Here

    StyledText text = viewer.getTextWidget();
    if (text == null || text.isDisposed())
      return;
    Display display = text.getDisplay();
    if (fCursor == null)
      fCursor = new Cursor(display, SWT.CURSOR_HAND);
    text.setCursor(fCursor);
  }
View Full Code Here

   *            int The ID value for the cursor
   * @return Cursor The system cursor matching the specific ID
   */
  public static Cursor getCursor(int id) {
    Integer key = Integer.valueOf(id);
    Cursor cursor = m_idToCursorMap.get(key);
    if (cursor == null) {
      cursor = new Cursor(Display.getDefault(), id);
      m_idToCursorMap.put(key, cursor);
    }
    return cursor;
  }
View Full Code Here

   *            int The ID value for the cursor
   * @return Cursor The system cursor matching the specific ID
   */
  public static Cursor getCursor(int id) {
    Integer key = Integer.valueOf(id);
    Cursor cursor = m_idToCursorMap.get(key);
    if (cursor == null) {
      cursor = new Cursor(Display.getDefault(), id);
      m_idToCursorMap.put(key, cursor);
    }
    return cursor;
  }
View Full Code Here

    private boolean disposed = false;
    private Display display;

    public SWTCursorChanger(Display theDisplay) {
        this.display = theDisplay;
        arrow = new Cursor(theDisplay, SWT.CURSOR_ARROW);
        cross = theDisplay.getSystemCursor(SWT.CURSOR_CROSS);
        hand = new Cursor(theDisplay, SWT.CURSOR_HAND);
        stop = theDisplay.getSystemCursor(SWT.CURSOR_NO);
    }
View Full Code Here

        }
        else if (!stop.isDisposed() && theCursorType == CursorChanger.STOP) {
            graphPane.setCursor(stop);
        }
        else if (display != null && !display.isDisposed()){
            graphPane.setCursor(new Cursor(display, SWT.CURSOR_ARROW));
        }
    }
View Full Code Here

          //
          openWebModeButton.setEnabled(false);
          return;
        }
        try {
          Cursor waitCursor = getDisplay().getSystemCursor(SWT.CURSOR_WAIT);
          getShell().setCursor(waitCursor);
          getHost().compile(moduleNames);
        } catch (UnableToCompleteException e) {
          // Already logged by callee.
          //
          MessageBox msgBox = new MessageBox(getShell(), SWT.OK
              | SWT.ICON_ERROR);
          msgBox.setText("Compilation Failed");
          msgBox.setMessage("Compilation failed. Please see the log in the development shell for details.");
          msgBox.open();
          return;
        } finally {
          // Restore the cursor.
          //
          Cursor normalCursor = getDisplay().getSystemCursor(SWT.CURSOR_ARROW);
          getShell().setCursor(normalCursor);
        }

        String locationText = location.getText();
View Full Code Here

   *  This method shows busy cursor while layout is runnning.
   */
  public final void runLayout()
  {
    viewer.getControl().getShell().setEnabled(false);
    viewer.getControl().getShell().setCursor(new Cursor(null, SWT.CURSOR_WAIT));
    //disable higlight and handles
    IFigure highlightLayer = ((ChsScalableRootEditPart) viewer.getRootEditPart()).getLayer(
      HighlightLayer.HIGHLIGHT_LAYER);

    IFigure handleLayer = ((ChsScalableRootEditPart) viewer.getRootEditPart()).getLayer(
      LayerConstants.HANDLE_LAYER);

    highlightLayer.setVisible(false);
    handleLayer.setVisible(false);

    boolean isSuccessful;

    if (fromChisioModel)
    {
      isSuccessful = createTopology(rootModel);
    }
    else
    {
      isSuccessful = createTopology(V, E);
    }

    if (isSuccessful)
    {
      this.layout();

      this.transform();

      // Propagate geometric changes to v-level objects if we have created
      // l-graph objects from chisio model.
      if (fromChisioModel)
      {
        this.update();
      }
    }
    else
    {
      MessageBox mb = new MessageBox(new Shell(), SWT.OK);
      mb.setMessage("Compound structures are not supported by this"
        + " layout style!");
      mb.setText(ChisioMain.TOOL_NAME);
      mb.open();
    }

    //enable highlight and handles
    highlightLayer.setVisible(true);
    handleLayer.setVisible(true);

    viewer.getControl().getShell().setCursor(new Cursor(null, SWT.CURSOR_ARROW));
    viewer.getControl().getShell().setEnabled(true);
  }
View Full Code Here

  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

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.