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

x33g5p2x  于2022-01-30 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(178)

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

ScrollBar.setThumb介绍

[英]Sets the thumb value. The thumb value should be used to represent the size of the visual portion of the current range. This value is usually the same as the page increment value.

This new value will be ignored if it is less than one, and will be clamped if it exceeds the receiver's current range.
[中]设置拇指值。thumb值应用于表示当前范围的可视部分的大小。该值通常与页面增量值相同。
如果这个新值小于1,它将被忽略,如果它超过接收器的当前范围,它将被钳制。

代码示例

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

public void setThumb( int thumb ) {
  scrollBar.setThumb( thumb );
 }
}

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

Point thumb = getThumb( area, max );
hori.setThumb( thumb.x );
vert.setThumb( thumb.y );

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

Point thumb = getThumb( area, max );
hori.setThumb( thumb.x );
vert.setThumb( thumb.y );

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

hori.setThumb( 100 );
vert.setThumb( 100 );

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

hori.setThumb( 100 );
vert.setThumb( 100 );

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

hori.setThumb( 100 );
vert.setThumb( 100 );

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

hori.setThumb( 100 );
vert.setThumb( 100 );

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.nebula.widgets.grid

/**
 * {@inheritDoc}
 */
public void setThumb(int value)
{
  scrollBar.setThumb(value);
}

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

ScrollBar createScrollBar (int type) {
  ScrollBar bar = new ScrollBar (this, type);
  if ((state & CANVAS) != 0) {
    bar.setMaximum (100);
    bar.setThumb (10);
  }
  return bar;
}

代码示例来源:origin: rinde/RinSim

void updateScrollbars(boolean adaptToScrollbar) {
 final Rectangle rect = image.getBounds();
 final Rectangle client = canvas.getClientArea();
 hBar.setMaximum(rect.width);
 vBar.setMaximum(rect.height);
 hBar.setThumb(Math.min(rect.width, client.width));
 vBar.setThumb(Math.min(rect.height, client.height));
 if (!adaptToScrollbar) {
  final org.eclipse.swt.graphics.Point center = getCenteredOrigin();
  hBar.setSelection(-center.x);
  vBar.setSelection(-center.y);
 }
}

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

/**
 * Resizes the maximum and thumb of both scrollbars.
 */
void resizeScrollBars () {
  Rectangle clientArea = canvas.getClientArea();
  ScrollBar bar = canvas.getHorizontalBar();
  if (bar != null) {
    bar.setMaximum(maxX);
    bar.setThumb(clientArea.width);
    bar.setPageIncrement(clientArea.width);
  }
  bar = canvas.getVerticalBar();
  if (bar != null) {
    bar.setMaximum(maxY);
    bar.setThumb(clientArea.height);
    bar.setPageIncrement(clientArea.height);
  }
}

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

/**
 */
private void updateVScrollBar() {
  
  if (Utilities.okToUse(fVScrollBar) && fSynchronizedScrolling) {
    int virtualHeight= getVirtualHeight();
    int viewPortHeight= getViewportHeight();
    int pageIncrement= viewPortHeight-1;
    int thumb= (viewPortHeight > virtualHeight) ? virtualHeight : viewPortHeight;
          
    fVScrollBar.setPageIncrement(pageIncrement);
    fVScrollBar.setMaximum(virtualHeight);
    fVScrollBar.setThumb(thumb);
  }            
}

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

/**
 */
private void updateVScrollBar() {
  if (Utilities.okToUse(fVScrollBar) && fSynchronizedScrolling) {
    int virtualHeight= fMerger.getVirtualHeight();
    int viewPortHeight= getViewportHeight();
    int pageIncrement= viewPortHeight-1;
    int thumb= (viewPortHeight > virtualHeight) ? virtualHeight : viewPortHeight;
    fVScrollBar.setPageIncrement(pageIncrement);
    fVScrollBar.setMaximum(virtualHeight);
    fVScrollBar.setThumb(thumb);
  }
}

代码示例来源:origin: com.github.rinde/rinsim-problem

@Override
 public void paintControl(PaintEvent e) {
  timeline.update();
  e.gc.drawImage(timeline.contents, origin.x, origin.y);
  e.gc.setForeground(e.display.getSystemColor(SWT.COLOR_RED));
  e.gc.drawLine(origin.x + (int) (currentTime / timeline.timePerPixel),
    0, origin.x + (int) (currentTime / timeline.timePerPixel),
    canvas.getClientArea().height);
  hBar.setMaximum(timeline.getWidth() == 0 ? 1 : timeline.getWidth() + 20);
  vBar.setMaximum(timeline.getHeight() + 5);
  hBar.setThumb(Math.min(timeline.getWidth() + 20,
    canvas.getClientArea().width));
  vBar.setThumb(Math.min(timeline.getHeight() + 5,
    canvas.getClientArea().height));
 }
});

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

/**
 * Update the scrollbars
 * 
 * @return true if we need to relayout the whole thing
 */
protected boolean updateScrollBars() {
  Point size = getScreenSize();
  ScrollBar hBar = getHorizontalBar(), vBar = getVerticalBar();
  boolean needRelayout = false;
  hBar.setMaximum(_drawnSize.x);
  hBar.setThumb(Math.min(_drawnSize.x, size.x));
  hBar.setIncrement(15); // TODO something meaningful ?
  hBar.setPageIncrement(size.x);
  boolean visible = !(_origin.x == 0 && _drawnSize.x <= size.x);
  hBar.setVisible(visible);
  size = getScreenSize();
  vBar.setMaximum(_drawnSize.y);
  vBar.setThumb(Math.min(_drawnSize.y, size.y));
  vBar.setIncrement(15); // TODO line height here
  vBar.setPageIncrement(size.y);
  visible = !(_origin.y == 0 && _drawnSize.y <= size.y);
  if (!isPrint() && vBar.isVisible() != visible) {
    needRelayout = true;
  }
  vBar.setVisible(visible);
  return needRelayout;
}

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

void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) {
  int inactive = 1;
  if (clientArea < maximum) {
    bar.setMaximum(maximum - margin);
    bar.setThumb(clientArea - margin);
    bar.setPageIncrement(clientArea - margin);
    if (!alwaysShowScroll) bar.setVisible(true);
  } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) {
    bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive);
  }
}
/**

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

void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) {
  int inactive = 1;
  if (clientArea < maximum) {
    bar.setMaximum(maximum - margin);
    bar.setThumb(clientArea - margin);
    bar.setPageIncrement(clientArea - margin);
    if (!alwaysShowScroll) bar.setVisible(true);
  } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) {
    bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive);
  }
}
/**

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

void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) {
  int inactive = 1;
  if (clientArea < maximum) {
    bar.setMaximum(maximum - margin);
    bar.setThumb(clientArea - margin);
    bar.setPageIncrement(clientArea - margin);
    if (!alwaysShowScroll) bar.setVisible(true);
  } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) {
    bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive);
  }
}
/**

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

void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) {
  int inactive = 1;
  if (clientArea < maximum) {
    bar.setMaximum(maximum - margin);
    bar.setThumb(clientArea - margin);
    bar.setPageIncrement(clientArea - margin);
    if (!alwaysShowScroll) bar.setVisible(true);
  } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) {
    bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive);
  }
}
/**

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

void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) {
  int inactive = 1;
  if (clientArea < maximum) {
    bar.setMaximum(maximum - margin);
    bar.setThumb(clientArea - margin);
    bar.setPageIncrement(clientArea - margin);
    if (!alwaysShowScroll) bar.setVisible(true);
  } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) {
    bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive);
  }
}
/**

相关文章