org.eclipse.swt.widgets.Canvas.setCursor()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(177)

本文整理了Java中org.eclipse.swt.widgets.Canvas.setCursor()方法的一些代码示例,展示了Canvas.setCursor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.setCursor()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Canvas
类名称:Canvas
方法名:setCursor

Canvas.setCursor介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

void paintCanvas( Event event ) {
 canvas.setCursor( null );
 int index = list.getSelectionIndex();
 if ( index == -1 ) {
   return;
  canvas.setCursor( (Cursor) object );
  return;

代码示例来源:origin: org.eclipse/org.eclipse.help.ui

public void setCursor(Cursor c) {
  super.setCursor(c);
  label.setCursor(c);
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

public void deselect() {
      // hide the popup
//            fHoverManager.disposeInformationControl();

      // deselect
      fSelection= null;

      resetViewerBackground(oldStyles);
      oldStyles= null;

      Display disp= fShell.getDisplay();
      canvas.setCursor(null);
      // TODO: remove shading - for now: set standard background
      canvas.setBackground(disp.getSystemColor(SWT.COLOR_INFO_BACKGROUND));

    }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public void deselect() {
      // hide the popup
//            fHoverManager.disposeInformationControl();

      // deselect
      fSelection= null;

      resetViewerBackground(oldStyles);
      oldStyles= null;

      Display disp= fShell.getDisplay();
      canvas.setCursor(null);
      // TODO: remove shading - for now: set standard background
      canvas.setBackground(disp.getSystemColor(SWT.COLOR_INFO_BACKGROUND));

    }

代码示例来源:origin: org.eclipse.mylyn.commons/screenshots

private void doDispose() {
  disposeImageResources();
  canvas.setCursor(null);
  for (Cursor cursor : cursors.values()) {
    cursor.dispose();
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

public void deselect() {
      // hide the popup
//            fHoverManager.disposeInformationControl();

      // deselect
      fSelection= null;

      resetViewerBackground(oldStyles);
      oldStyles= null;

      Display disp= fShell.getDisplay();
      canvas.setCursor(null);
      // TODO: remove shading - for now: set standard background
      canvas.setBackground(disp.getSystemColor(SWT.COLOR_INFO_BACKGROUND));

    }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * Handles mouse moves.
 *
 * @param event the mouse move event
 */
private void handleMouseMove(MouseEvent event) {
  if (fTextViewer != null) {
    int[] lines= toLineNumbers(event.y, true);
    Position p= getAnnotationPosition(lines);
    Cursor cursor= (p != null ? fHitDetectionCursor : null);
    if (cursor != fLastCursor) {
      fCanvas.setCursor(cursor);
      fLastCursor= cursor;
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * Handles mouse moves.
 *
 * @param event the mouse move event
 */
private void handleMouseMove(MouseEvent event) {
  if (fTextViewer != null) {
    int[] lines= toLineNumbers(event.y, true);
    Position p= getAnnotationPosition(lines);
    Cursor cursor= (p != null ? fHitDetectionCursor : null);
    if (cursor != fLastCursor) {
      fCanvas.setCursor(cursor);
      fLastCursor= cursor;
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.compare

@Override
  public void mouseMove(MouseEvent e) {
    Cursor cursor= null;
    Diff diff= handlemouseInBirdsEyeView(fBirdsEyeCanvas, e.y);
    if (diff != null && diff.getKind() != RangeDifference.NOCHANGE)
      cursor= e.widget.getDisplay().getSystemCursor(SWT.CURSOR_HAND);
    if (fLastCursor != cursor) {
      fBirdsEyeCanvas.setCursor(cursor);
      fLastCursor= cursor;
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * Handles mouse moves.
 *
 * @param event the mouse move event
 */
private void handleMouseMove(MouseEvent event) {
  fParentRuler.setLocationOfLastMouseButtonActivity(event.x, event.y);
  if (fCachedTextViewer != null) {
    int line= toDocumentLineNumber(event.y);
    Cursor cursor= (hasAnnotation(line) ? fHitDetectionCursor : null);
    if (cursor != fLastCursor) {
      fCanvas.setCursor(cursor);
      fLastCursor= cursor;
    }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * Handles mouse moves.
 *
 * @param event the mouse move event
 */
private void handleMouseMove(MouseEvent event) {
  fParentRuler.setLocationOfLastMouseButtonActivity(event.x, event.y);
  if (fCachedTextViewer != null) {
    int line= toDocumentLineNumber(event.y);
    Cursor cursor= (hasAnnotation(line) ? fHitDetectionCursor : null);
    if (cursor != fLastCursor) {
      fCanvas.setCursor(cursor);
      fLastCursor= cursor;
    }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public void selected() {
  Display disp= fShell.getDisplay();
  canvas.setCursor(getHandCursor(disp));
  // TODO: shade - for now: set grey background
  canvas.setBackground(getSelectionColor(disp));
  // highlight the viewer background at its position
  oldStyles= setViewerBackground(fAnnotation);
  // set the selection
  fSelection= this;
  if (fHoverManager != null)
    fHoverManager.showInformation();
  if (fInput.fAnnotationListener != null) {
    VerticalRulerEvent event= new VerticalRulerEvent(fAnnotation);
    fInput.fAnnotationListener.annotationSelected(event);
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

public void selected() {
  Display disp= fShell.getDisplay();
  canvas.setCursor(fHandCursor);
  // TODO: shade - for now: set grey background
  canvas.setBackground(getSelectionColor(disp));
  // highlight the viewer background at its position
  oldStyles= setViewerBackground(fAnnotation);
  // set the selection
  fSelection= this;
  if (fHoverManager != null)
    fHoverManager.showInformation();
  if (fInput.fAnnotationListener != null) {
    VerticalRulerEvent event= new VerticalRulerEvent(fAnnotation);
    fInput.fAnnotationListener.annotationSelected(event);
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

public void selected() {
  Display disp= fShell.getDisplay();
  canvas.setCursor(getHandCursor(disp));
  // TODO: shade - for now: set grey background
  canvas.setBackground(getSelectionColor(disp));
  // highlight the viewer background at its position
  oldStyles= setViewerBackground(fAnnotation);
  // set the selection
  fSelection= this;
  if (fHoverManager != null)
    fHoverManager.showInformation();
  if (fInput.fAnnotationListener != null) {
    VerticalRulerEvent event= new VerticalRulerEvent(fAnnotation);
    fInput.fAnnotationListener.annotationSelected(event);
  }
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
public void dragStart(DragSourceEvent event) {
  Cursor cursor = cHeaderArea.getCursor();
  if (cursor != null
      && cursor.equals(event.display.getSystemCursor(SWT.CURSOR_SIZEWE))) {
    event.doit = false;
    return;
  }
  cHeaderArea.setCursor(null);
  TableColumnCore tc = getTableColumnByOffset(event.x);
  isHeaderDragging = tc != null;
  if (isHeaderDragging) {
    eventData = tc.getName();
  }
  //System.out.println("drag " + eventData);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

void doMouseLinkCursor(int x, int y) {
  int offset = getOffsetAtPoint(x, y, null, true);
  Display display = getDisplay();
  Cursor newCursor = cursor;
  if (renderer.hasLink(offset)) {
    newCursor = display.getSystemCursor(SWT.CURSOR_HAND);
  } else {
    if (cursor == null) {
      int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
      newCursor = display.getSystemCursor(type);
    }
  }
  if (newCursor != getCursor()) super.setCursor(newCursor);
}
/**

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

void doMouseLinkCursor(int x, int y) {
  int offset = getOffsetAtPoint(x, y, null, true);
  Display display = getDisplay();
  Cursor newCursor = cursor;
  if (renderer.hasLink(offset)) {
    newCursor = display.getSystemCursor(SWT.CURSOR_HAND);
  } else {
    if (cursor == null) {
      int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
      newCursor = display.getSystemCursor(type);
    }
  }
  if (newCursor != getCursor()) super.setCursor(newCursor);
}
/**

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void doMouseLinkCursor(int x, int y) {
  int offset = getOffsetAtPoint(x, y, null, true);
  Display display = getDisplay();
  Cursor newCursor = cursor;
  if (renderer.hasLink(offset)) {
    newCursor = display.getSystemCursor(SWT.CURSOR_HAND);
  } else {
    if (cursor == null) {
      int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
      newCursor = display.getSystemCursor(type);
    }
  }
  if (newCursor != getCursor()) super.setCursor(newCursor);
}
/**

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

void doMouseLinkCursor(int x, int y) {
  int offset = getOffsetAtPoint(x, y, null, true);
  Display display = getDisplay();
  Cursor newCursor = cursor;
  if (renderer.hasLink(offset)) {
    newCursor = display.getSystemCursor(SWT.CURSOR_HAND);
  } else {
    if (cursor == null) {
      int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
      newCursor = display.getSystemCursor(type);
    }
  }
  if (newCursor != getCursor()) super.setCursor(newCursor);
}
/**

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

void doMouseLinkCursor(int x, int y) {
  int offset = getOffsetAtPoint(x, y, null, true);
  Display display = getDisplay();
  Cursor newCursor = cursor;
  if (renderer.hasLink(offset)) {
    newCursor = display.getSystemCursor(SWT.CURSOR_HAND);
  } else {
    if (cursor == null) {
      int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
      newCursor = display.getSystemCursor(type);
    }
  }
  if (newCursor != getCursor()) super.setCursor(newCursor);
}
/**

相关文章

Canvas类方法