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

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

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

ScrollBar.getThumb介绍

[英]Returns the receiver's thumb value.
[中]返回接收器的拇指值。

代码示例

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

/**
 * {@inheritDoc}
 */
public int getThumb()
{
  return scrollBar.getThumb();
}

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

boolean max = bar.getSelection() == bar.getMaximum() - bar.getThumb();
int lineOffset = log.getLineCount() - log.getTopIndex();
  bar.setSelection(bar.getMaximum()-bar.getThumb());
  log.setTopIndex(log.getLineCount()-lineOffset);
  log.redraw();

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

boolean max = bar.getSelection() == bar.getMaximum() - bar.getThumb();
  bar.setSelection(bar.getMaximum()-bar.getThumb());

代码示例来源:origin: openaudible/openaudible

boolean autoScroll = !supressScrolling && (sb.getSelection() == (sb.getMaximum() - sb.getThumb()));
StringBuffer buf = new StringBuffer();
int nbLines = consoleText.getLineCount();

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

/**
 * Sets the single <em>selection</em> that is the receiver's
 * value to the argument which must be greater than or equal
 * to zero.
 *
 * @param selection the new selection (must be zero or greater)
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 */
public void setSelection (int selection) {
  checkWidget ();
  selection = Math.min (selection, getMaximum() - getThumb());
  OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
  OS.gtk_adjustment_set_value (adjustmentHandle, selection);
  OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
}

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

/**
 * Sets the single <em>selection</em> that is the receiver's
 * value to the argument which must be greater than or equal
 * to zero.
 *
 * @param selection the new selection (must be zero or greater)
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 */
public void setSelection (int selection) {
  checkWidget ();
  selection = Math.min (selection, getMaximum() - getThumb());
  OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
  OS.gtk_adjustment_set_value (adjustmentHandle, selection);
  OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
}

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

/**
 * Sets the single <em>selection</em> that is the receiver's
 * value to the argument which must be greater than or equal
 * to zero.
 *
 * @param selection the new selection (must be zero or greater)
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 */
public void setSelection (int selection) {
  checkWidget ();
  selection = Math.min (selection, getMaximum() - getThumb());
  OS.g_signal_handlers_block_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
  OS.gtk_adjustment_set_value (adjustmentHandle, selection);
  OS.g_signal_handlers_unblock_matched (adjustmentHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
}

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

/**
   * {@inheritDoc}
   */
  public void setSelection(int selection)
  {
// RAP [if]: ScrollBar#setSelection() does not limit the value
//        scrollBar.setSelection(selection);
    int minimum = scrollBar.getMinimum();
    int maximum = scrollBar.getMaximum();
    int thumb = scrollBar.getThumb();
    if( selection < minimum ) {
     scrollBar.setSelection( minimum );
    } else if ( selection > maximum - thumb ) {
     scrollBar.setSelection( maximum - thumb );
    } else {
     scrollBar.setSelection( selection );
    }
  }

代码示例来源: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);
  }
}
/**

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

if (thumb != hBar.getThumb ()) {
  hBar.setThumb (thumb);
  hBar.setPageIncrement (thumb);

代码示例来源: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.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.platform/org.eclipse.swt.examples

if (thumb != vBar.getThumb ()) {
  vBar.setThumb (thumb);
  vBar.setPageIncrement (thumb);

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

&& vBar.getMaximum() == vBar.getSelection() + vBar.getThumb();

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

&& vBar.getMaximum() == vBar.getSelection() + vBar.getThumb();

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

if (hBar != null) {
  hBar.setMaximum (Math.max (1, maximum));	/* setting a value of 0 here is ignored */
  if (hBar.getThumb () != clientArea.width) {
    hBar.setThumb (clientArea.width);
    hBar.setPageIncrement (clientArea.width);

相关文章