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

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

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

Canvas.update介绍

暂无

代码示例

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

public void refresh() {
 canvas.update();
}

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

@Override
public void viewportChanged(int topPixel) {
  int delta= topPixel - fLastTopPixel;
  if (scrollVertical(delta))
    fCanvas.update(); // force update the invalidated regions
}

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

@Override
public void viewportChanged(int topPixel) {
  int delta= topPixel - fLastTopPixel;
  if (scrollVertical(delta))
    fCanvas.update(); // force update the invalidated regions
}

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

@Override
  public void runSupport() {
    updating = false;
    if (splash == null || splash.isDisposed()) {
      return;
    }
    canvas.redraw(0, height - 50, width, height, true);
    canvas.update();
  }
});

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

/**
 * Handles a horizontal scroll event
 *
 * @param scrollbar the horizontal scroll bar that posted this event
 */
public void scrollHorizontally(ScrollBar scrollBar) {
  if (image == null) return;
  if (imageWidth > visibleWidth) {
    final int oldOffset = displayFDC.xOffset;
    final int newOffset = Math.min(scrollBar.getSelection(), imageWidth - visibleWidth);
    if (oldOffset != newOffset) {
      paintCanvas.update();
      displayFDC.xOffset = newOffset;
      paintCanvas.scroll(Math.max(oldOffset - newOffset, 0), 0, Math.max(newOffset - oldOffset, 0), 0,
        visibleWidth, visibleHeight, false);
    }
  }
}

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

@Override
  public void runSupport() {
    if (canvas != null && !canvas.isDisposed()) {
      canvas.redraw();
      canvas.update();
    }
  }
});

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

/**
 * Handles a vertical scroll event
 *
 * @param scrollbar the vertical scroll bar that posted this event
 */
public void scrollVertically(ScrollBar scrollBar) {
  if (image == null) return;
  if (imageHeight > visibleHeight) {
    final int oldOffset = displayFDC.yOffset;
    final int newOffset = Math.min(scrollBar.getSelection(), imageHeight - visibleHeight);
    if (oldOffset != newOffset) {
      paintCanvas.update();
      displayFDC.yOffset = newOffset;
      paintCanvas.scroll(0, Math.max(oldOffset - newOffset, 0), 0, Math.max(newOffset - oldOffset, 0),
        visibleWidth, visibleHeight, false);
    }
  }
}

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

@Override
  public void runSupport() {
    if (canvas != null && !canvas.isDisposed()) {
      canvas.redraw();
      canvas.update();
    }
  }
});

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

@Override
  public void runSupport() {
    if (canvas != null && !canvas.isDisposed()) {
      canvas.redraw();
      canvas.update();
    }
  }
});

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

@Override
public void redraw() {
  if (fCanvas != null && !fCanvas.isDisposed()) {
    if (VerticalRuler.AVOID_NEW_GC) {
      fCanvas.redraw();
      fCanvas.update();
    } else {
      GC gc= new GC(fCanvas);
      doubleBufferPaint(gc);
      gc.dispose();
    }
  }
}

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

@Override
public void redraw() {
  if (fCachedTextViewer != null && fCanvas != null && !fCanvas.isDisposed()) {
    if (VerticalRuler.AVOID_NEW_GC) {
      fCanvas.redraw();
      fCanvas.update();
    } else {
      GC gc= new GC(fCanvas);
      doubleBufferPaint(gc);
      gc.dispose();
    }
  }
}

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

/**
 * Redraws the vertical ruler.
 */
private void redraw() {
  if (fCanvas != null && !fCanvas.isDisposed()) {
    if (AVOID_NEW_GC) {
      fCanvas.redraw();
      fCanvas.update();
    } else {
      GC gc= new GC(fCanvas);
      doubleBufferPaint(gc);
      gc.dispose();
    }
  }
}

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

/**
 * Redraws the overview ruler.
 */
private void redraw() {
  if (fTextViewer == null || fModel == null)
    return;
  if (fCanvas != null && !fCanvas.isDisposed()) {
    if (VerticalRuler.AVOID_NEW_GC) {
      fCanvas.redraw();
      fCanvas.update();
    } else {
      GC gc= new GC(fCanvas);
      doubleBufferPaint(gc);
      gc.dispose();
    }
  }
}

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

drawCanvas.update();

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

@Override
public void redraw() {
  if (fRelayoutRequired) {
    layout(true);
    return;
  }
  if (fCachedTextViewer != null && fCanvas != null && !fCanvas.isDisposed()) {
    if (VerticalRuler.AVOID_NEW_GC) {
      fCanvas.redraw();
      fCanvas.update();
    } else {
      GC gc= new GC(fCanvas);
      doubleBufferPaint(gc);
      gc.dispose();
    }
  }
}

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

@Override
  public void run() {
    if (canvas.isDisposed()) return;
    int timeout = TIMER;
    GraphicsTab tab = getTab();
    if (tab instanceof AnimatedGraphicsTab) {
      AnimatedGraphicsTab animTab = (AnimatedGraphicsTab) tab;
      if (animate && animTab.getAnimation()) {
        Rectangle rect = canvas.getClientArea();
        animTab.next(rect.width, rect.height);
        canvas.redraw();
        canvas.update();
      }
      timeout =  animTab.getAnimationTime();
    }
    display.timerExec(timeout, this);
  }
});

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

paintCanvas.update();

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

void onArrowLeft (int stateMask) {
  if (horizontalOffset == 0) return;
  int newSelection = Math.max (0, horizontalOffset - SIZE_HORIZONTALSCROLL);
  update ();
  GC gc = new GC (this);
  gc.copyArea (
    0, 0,
    clientArea.width, clientArea.height,
    horizontalOffset - newSelection, 0);
  gc.dispose ();
  if (header.getVisible ()) {
    header.update ();
    Rectangle headerClientArea = header.getClientArea ();
    gc = new GC (header);
    gc.copyArea (
      0, 0,
      headerClientArea.width, headerClientArea.height,
      horizontalOffset - newSelection, 0);
    gc.dispose();
  }
  horizontalOffset = newSelection;
  ScrollBar hBar = getHorizontalBar ();
  if (hBar != null) hBar.setSelection (horizontalOffset);
}
void onArrowRight (int stateMask) {

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

void onArrowRight (int stateMask) {
  ScrollBar hBar = getHorizontalBar ();
  if (hBar == null) return;
  int maximum = hBar.getMaximum ();
  int clientWidth = clientArea.width;
  if ((horizontalOffset + clientArea.width) == maximum) return;
  if (maximum <= clientWidth) return;
  int newSelection = Math.min (horizontalOffset + SIZE_HORIZONTALSCROLL, maximum - clientWidth);
  update ();
  GC gc = new GC (this);
  gc.copyArea (
    0, 0,
    clientArea.width, clientArea.height,
    horizontalOffset - newSelection, 0);
  gc.dispose ();
  if (header.getVisible ()) {
    Rectangle headerClientArea = header.getClientArea ();
    header.update ();
    gc = new GC (header);
    gc.copyArea (
      0, 0,
      headerClientArea.width, headerClientArea.height,
      horizontalOffset - newSelection, 0);
    gc.dispose();
  }
  horizontalOffset = newSelection;
  hBar.setSelection (horizontalOffset);
}
void onArrowUp (int stateMask) {

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

void onScrollHorizontal (Event event) {
  ScrollBar hBar = getHorizontalBar ();
  if (hBar == null) return;
  int newSelection = hBar.getSelection ();
  update ();
  if (itemsCount > 0) {
    GC gc = new GC (this);
    gc.copyArea (
      0, 0,
      clientArea.width, clientArea.height,
      horizontalOffset - newSelection, 0);
    gc.dispose ();
  } else {
    redraw ();    /* ensure that static focus rectangle updates properly */
  }

  if (drawCount <= 0 && header.isVisible ()) {
    header.update ();
    Rectangle headerClientArea = header.getClientArea ();
    GC gc = new GC (header);
    gc.copyArea (
      0, 0,
      headerClientArea.width, headerClientArea.height,
      horizontalOffset - newSelection, 0);
    gc.dispose ();
  }
  horizontalOffset = newSelection;
}
void onScrollVertical (Event event) {

相关文章

Canvas类方法