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

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

本文整理了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

  1. void paintCanvas( Event event ) {
  2. canvas.setCursor( null );
  3. int index = list.getSelectionIndex();
  4. if ( index == -1 ) {
  5. return;
  6. canvas.setCursor( (Cursor) object );
  7. return;

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

  1. public void setCursor(Cursor c) {
  2. super.setCursor(c);
  3. label.setCursor(c);
  4. }

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

  1. public void deselect() {
  2. // hide the popup
  3. // fHoverManager.disposeInformationControl();
  4. // deselect
  5. fSelection= null;
  6. resetViewerBackground(oldStyles);
  7. oldStyles= null;
  8. Display disp= fShell.getDisplay();
  9. canvas.setCursor(null);
  10. // TODO: remove shading - for now: set standard background
  11. canvas.setBackground(disp.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
  12. }

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

  1. public void deselect() {
  2. // hide the popup
  3. // fHoverManager.disposeInformationControl();
  4. // deselect
  5. fSelection= null;
  6. resetViewerBackground(oldStyles);
  7. oldStyles= null;
  8. Display disp= fShell.getDisplay();
  9. canvas.setCursor(null);
  10. // TODO: remove shading - for now: set standard background
  11. canvas.setBackground(disp.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
  12. }

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

  1. private void doDispose() {
  2. disposeImageResources();
  3. canvas.setCursor(null);
  4. for (Cursor cursor : cursors.values()) {
  5. cursor.dispose();
  6. }
  7. }

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

  1. public void deselect() {
  2. // hide the popup
  3. // fHoverManager.disposeInformationControl();
  4. // deselect
  5. fSelection= null;
  6. resetViewerBackground(oldStyles);
  7. oldStyles= null;
  8. Display disp= fShell.getDisplay();
  9. canvas.setCursor(null);
  10. // TODO: remove shading - for now: set standard background
  11. canvas.setBackground(disp.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
  12. }

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

  1. /**
  2. * Handles mouse moves.
  3. *
  4. * @param event the mouse move event
  5. */
  6. private void handleMouseMove(MouseEvent event) {
  7. if (fTextViewer != null) {
  8. int[] lines= toLineNumbers(event.y, true);
  9. Position p= getAnnotationPosition(lines);
  10. Cursor cursor= (p != null ? fHitDetectionCursor : null);
  11. if (cursor != fLastCursor) {
  12. fCanvas.setCursor(cursor);
  13. fLastCursor= cursor;
  14. }
  15. }
  16. }

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

  1. /**
  2. * Handles mouse moves.
  3. *
  4. * @param event the mouse move event
  5. */
  6. private void handleMouseMove(MouseEvent event) {
  7. if (fTextViewer != null) {
  8. int[] lines= toLineNumbers(event.y, true);
  9. Position p= getAnnotationPosition(lines);
  10. Cursor cursor= (p != null ? fHitDetectionCursor : null);
  11. if (cursor != fLastCursor) {
  12. fCanvas.setCursor(cursor);
  13. fLastCursor= cursor;
  14. }
  15. }
  16. }

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

  1. @Override
  2. public void mouseMove(MouseEvent e) {
  3. Cursor cursor= null;
  4. Diff diff= handlemouseInBirdsEyeView(fBirdsEyeCanvas, e.y);
  5. if (diff != null && diff.getKind() != RangeDifference.NOCHANGE)
  6. cursor= e.widget.getDisplay().getSystemCursor(SWT.CURSOR_HAND);
  7. if (fLastCursor != cursor) {
  8. fBirdsEyeCanvas.setCursor(cursor);
  9. fLastCursor= cursor;
  10. }
  11. }
  12. }

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

  1. /**
  2. * Handles mouse moves.
  3. *
  4. * @param event the mouse move event
  5. */
  6. private void handleMouseMove(MouseEvent event) {
  7. fParentRuler.setLocationOfLastMouseButtonActivity(event.x, event.y);
  8. if (fCachedTextViewer != null) {
  9. int line= toDocumentLineNumber(event.y);
  10. Cursor cursor= (hasAnnotation(line) ? fHitDetectionCursor : null);
  11. if (cursor != fLastCursor) {
  12. fCanvas.setCursor(cursor);
  13. fLastCursor= cursor;
  14. }
  15. }
  16. }

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

  1. /**
  2. * Handles mouse moves.
  3. *
  4. * @param event the mouse move event
  5. */
  6. private void handleMouseMove(MouseEvent event) {
  7. fParentRuler.setLocationOfLastMouseButtonActivity(event.x, event.y);
  8. if (fCachedTextViewer != null) {
  9. int line= toDocumentLineNumber(event.y);
  10. Cursor cursor= (hasAnnotation(line) ? fHitDetectionCursor : null);
  11. if (cursor != fLastCursor) {
  12. fCanvas.setCursor(cursor);
  13. fLastCursor= cursor;
  14. }
  15. }
  16. }

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

  1. public void selected() {
  2. Display disp= fShell.getDisplay();
  3. canvas.setCursor(getHandCursor(disp));
  4. // TODO: shade - for now: set grey background
  5. canvas.setBackground(getSelectionColor(disp));
  6. // highlight the viewer background at its position
  7. oldStyles= setViewerBackground(fAnnotation);
  8. // set the selection
  9. fSelection= this;
  10. if (fHoverManager != null)
  11. fHoverManager.showInformation();
  12. if (fInput.fAnnotationListener != null) {
  13. VerticalRulerEvent event= new VerticalRulerEvent(fAnnotation);
  14. fInput.fAnnotationListener.annotationSelected(event);
  15. }
  16. }

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

  1. public void selected() {
  2. Display disp= fShell.getDisplay();
  3. canvas.setCursor(fHandCursor);
  4. // TODO: shade - for now: set grey background
  5. canvas.setBackground(getSelectionColor(disp));
  6. // highlight the viewer background at its position
  7. oldStyles= setViewerBackground(fAnnotation);
  8. // set the selection
  9. fSelection= this;
  10. if (fHoverManager != null)
  11. fHoverManager.showInformation();
  12. if (fInput.fAnnotationListener != null) {
  13. VerticalRulerEvent event= new VerticalRulerEvent(fAnnotation);
  14. fInput.fAnnotationListener.annotationSelected(event);
  15. }
  16. }

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

  1. public void selected() {
  2. Display disp= fShell.getDisplay();
  3. canvas.setCursor(getHandCursor(disp));
  4. // TODO: shade - for now: set grey background
  5. canvas.setBackground(getSelectionColor(disp));
  6. // highlight the viewer background at its position
  7. oldStyles= setViewerBackground(fAnnotation);
  8. // set the selection
  9. fSelection= this;
  10. if (fHoverManager != null)
  11. fHoverManager.showInformation();
  12. if (fInput.fAnnotationListener != null) {
  13. VerticalRulerEvent event= new VerticalRulerEvent(fAnnotation);
  14. fInput.fAnnotationListener.annotationSelected(event);
  15. }
  16. }

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

  1. @Override
  2. public void dragStart(DragSourceEvent event) {
  3. Cursor cursor = cHeaderArea.getCursor();
  4. if (cursor != null
  5. && cursor.equals(event.display.getSystemCursor(SWT.CURSOR_SIZEWE))) {
  6. event.doit = false;
  7. return;
  8. }
  9. cHeaderArea.setCursor(null);
  10. TableColumnCore tc = getTableColumnByOffset(event.x);
  11. isHeaderDragging = tc != null;
  12. if (isHeaderDragging) {
  13. eventData = tc.getName();
  14. }
  15. //System.out.println("drag " + eventData);
  16. }

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

  1. void doMouseLinkCursor(int x, int y) {
  2. int offset = getOffsetAtPoint(x, y, null, true);
  3. Display display = getDisplay();
  4. Cursor newCursor = cursor;
  5. if (renderer.hasLink(offset)) {
  6. newCursor = display.getSystemCursor(SWT.CURSOR_HAND);
  7. } else {
  8. if (cursor == null) {
  9. int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
  10. newCursor = display.getSystemCursor(type);
  11. }
  12. }
  13. if (newCursor != getCursor()) super.setCursor(newCursor);
  14. }
  15. /**

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

  1. void doMouseLinkCursor(int x, int y) {
  2. int offset = getOffsetAtPoint(x, y, null, true);
  3. Display display = getDisplay();
  4. Cursor newCursor = cursor;
  5. if (renderer.hasLink(offset)) {
  6. newCursor = display.getSystemCursor(SWT.CURSOR_HAND);
  7. } else {
  8. if (cursor == null) {
  9. int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
  10. newCursor = display.getSystemCursor(type);
  11. }
  12. }
  13. if (newCursor != getCursor()) super.setCursor(newCursor);
  14. }
  15. /**

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

  1. void doMouseLinkCursor(int x, int y) {
  2. int offset = getOffsetAtPoint(x, y, null, true);
  3. Display display = getDisplay();
  4. Cursor newCursor = cursor;
  5. if (renderer.hasLink(offset)) {
  6. newCursor = display.getSystemCursor(SWT.CURSOR_HAND);
  7. } else {
  8. if (cursor == null) {
  9. int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
  10. newCursor = display.getSystemCursor(type);
  11. }
  12. }
  13. if (newCursor != getCursor()) super.setCursor(newCursor);
  14. }
  15. /**

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

  1. void doMouseLinkCursor(int x, int y) {
  2. int offset = getOffsetAtPoint(x, y, null, true);
  3. Display display = getDisplay();
  4. Cursor newCursor = cursor;
  5. if (renderer.hasLink(offset)) {
  6. newCursor = display.getSystemCursor(SWT.CURSOR_HAND);
  7. } else {
  8. if (cursor == null) {
  9. int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
  10. newCursor = display.getSystemCursor(type);
  11. }
  12. }
  13. if (newCursor != getCursor()) super.setCursor(newCursor);
  14. }
  15. /**

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

  1. void doMouseLinkCursor(int x, int y) {
  2. int offset = getOffsetAtPoint(x, y, null, true);
  3. Display display = getDisplay();
  4. Cursor newCursor = cursor;
  5. if (renderer.hasLink(offset)) {
  6. newCursor = display.getSystemCursor(SWT.CURSOR_HAND);
  7. } else {
  8. if (cursor == null) {
  9. int type = blockSelection ? SWT.CURSOR_CROSS : SWT.CURSOR_IBEAM;
  10. newCursor = display.getSystemCursor(type);
  11. }
  12. }
  13. if (newCursor != getCursor()) super.setCursor(newCursor);
  14. }
  15. /**

相关文章

Canvas类方法