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

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

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

ScrollBar.getMinimum介绍

[英]Returns the minimum value which the receiver will allow.
[中]返回接收器允许的最小值。

代码示例

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

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

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

@Override
    public void runSupport() {
      if (isDisposed()) {
        return;
      }
      int pos = vBar.getSelection();
      if ( distance > 0 ){
        pos += distance;
        pos = Math.min( pos,vBar.getMaximum());
        vBar.setSelection( pos );
      }else{
        pos += distance;
        pos = Math.max( pos,vBar.getMinimum());
        vBar.setSelection( pos );
      }
      swt_vBarChanged();
    }});
}

代码示例来源: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.e4.ui.css.swt

@Override
public boolean computePositions(Rectangle currClientArea, Scrollable scrollable) {
  fHandleDrawnRect = null;
  if (this.fScrollBar == null || this.fScrollBar.getMaximum() - this.fScrollBar.getMinimum() <= 1
      || !getVisible() || !this.fScrollBarSettings.getScrollBarThemed()) {
    return false;
  }
  StyledText styledText = (StyledText) scrollable;
  int lineWidth = getCurrentScrollBarWidth();
  int w = currClientArea.width;
  int h = currClientArea.height - (styledText.getTopMargin() + styledText.getBottomMargin());
  this.fScrollBarPositions = new ScrollBarPositions.ScrollBarPositionsVertical(this.fScrollBar.getMinimum(),
      this.fScrollBar.getMaximum(), styledText.getTopPixel(), h, w);
  fHandleDrawnRect = fScrollBarPositions.getHandleDrawRect(lineWidth);
  if (fHandleDrawnRect == null || h <= fHandleDrawnRect.height) {
    return false;
  }
  return true;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

@Override
public boolean computePositions(Rectangle currClientArea, Scrollable scrollable) {
  fHandleDrawnRect = null;
  if (this.fScrollBar == null || this.fScrollBar.getMaximum() - this.fScrollBar.getMinimum() <= 1
      || !getVisible() || !this.fScrollBarSettings.getScrollBarThemed()) {
    return false;
  }
  StyledText styledText = (StyledText) scrollable;
  int lineWidth = getCurrentScrollBarWidth();
  int w = currClientArea.width - (styledText.getLeftMargin() + styledText.getRightMargin());
  int h = currClientArea.height;
  fScrollBarPositions = new ScrollBarPositions.ScrollBarPositionsHorizontal(this.fScrollBar.getMinimum(),
      this.fScrollBar.getMaximum(), styledText.getHorizontalPixel(), h, w);
  fHandleDrawnRect = fScrollBarPositions.getHandleDrawRect(lineWidth);
  if (fHandleDrawnRect == null || w <= fHandleDrawnRect.width) {
    return false;
  }
  return true;
}

代码示例来源: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.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.e4.ui.css.swt

&& proximityRectHorizontal.contains(controlPos.x, controlPos.y))
&& currClientArea.width < (fHorizontalScrollHandler.fScrollBar.getMaximum()
    - fHorizontalScrollHandler.fScrollBar.getMinimum()));
    - fVerticalScrollHandler.fScrollBar.getMinimum()));

相关文章