本文整理了Java中org.eclipse.swt.widgets.ScrollBar.getSelection()
方法的一些代码示例,展示了ScrollBar.getSelection()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScrollBar.getSelection()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.ScrollBar
类名称:ScrollBar
方法名:getSelection
[英]Returns the single 'selection' that is the receiver's value.
[中]返回作为接收器值的单个“选择”。
代码示例来源:origin: pentaho/pentaho-kettle
public int getSelection() {
return scrollBar.getSelection();
}
代码示例来源:origin: pentaho/pentaho-kettle
private Point getOffset( Point thumb, Point area ) {
Point p = new Point( 0, 0 );
Point sel = new Point( hori.getSelection(), vert.getSelection() );
if ( thumb.x == 0 || thumb.y == 0 ) {
return p;
}
p.x = Math.round( -sel.x * area.x / thumb.x );
p.y = Math.round( -sel.y * area.y / thumb.y );
return p;
}
代码示例来源:origin: pentaho/pentaho-kettle
private Point getOffset( Point thumb, Point area ) {
Point p = new Point( 0, 0 );
Point sel = new Point( hori.getSelection(), vert.getSelection() );
if ( thumb.x == 0 || thumb.y == 0 ) {
return p;
}
p.x = Math.round( -sel.x * area.x / thumb.x );
p.y = Math.round( -sel.y * area.y / thumb.y );
return p;
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public void widgetSelected( SelectionEvent e ) {
offsety = -sbVertical.getSelection();
widget.redraw();
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public void widgetSelected( SelectionEvent e ) {
offsetx = -sbHorizontal.getSelection();
widget.redraw();
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
protected Point getOffset( Point thumb, Point area ) {
Point p = new Point( 0, 0 );
Point sel = new Point( hori.getSelection(), vert.getSelection() );
if ( thumb.x == 0 || thumb.y == 0 ) {
return p;
}
p.x = Math.round( -sel.x * area.x / thumb.x / magnification );
p.y = Math.round( -sel.y * area.y / thumb.y / magnification );
return p;
}
代码示例来源:origin: pentaho/pentaho-kettle
public void dispose() {
props.setScreen( new WindowProperty( shell ) );
bounds = shell.getBounds();
hscroll = wFields.getHorizontalBar().getSelection();
vscroll = wFields.getVerticalBar().getSelection();
shell.dispose();
}
代码示例来源:origin: pentaho/pentaho-kettle
public void dispose() {
props.setScreen( new WindowProperty( shell ) );
bounds = shell.getBounds();
hscroll = wFields.getHorizontalBar().getSelection();
vscroll = wFields.getVerticalBar().getSelection();
shell.dispose();
}
代码示例来源:origin: pentaho/pentaho-kettle
offsetx = -sbHorizontal.getSelection();
offsety = -sbVertical.getSelection();
widget.redraw();
代码示例来源:origin: pentaho/pentaho-kettle
sbHorizontal.setVisible( false );
} else {
offsetx = -sbHorizontal.getSelection();
sbHorizontal.setVisible( true );
sbVertical.setVisible( false );
} else {
offsety = sbVertical.getSelection();
sbVertical.setVisible( true );
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private static Point getOrigin( ScrolledComposite composite ) {
Point result = new Point( 0, 0 );
ScrollBar horizontalBar = composite.getHorizontalBar();
if( horizontalBar != null ) {
result.x = horizontalBar.getSelection();
}
ScrollBar verticalBar = composite.getVerticalBar();
if( verticalBar != null ) {
result.y = verticalBar.getSelection();
}
return result;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
void updateScrollBarValue (ScrollBar bar) {
yCurrentScroll = bar.getSelection();
layoutItems (0, false);
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.nebula.widgets.grid
private static int getScrollLeft( Grid grid ) {
int result = 0;
ScrollBar horizontalBar = grid.getHorizontalBar();
if( horizontalBar != null ) {
result = horizontalBar.getSelection();
}
return result;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Scrolls the widget horizontally.
*/
void handleHorizontalScroll(Event event) {
int scrollPixel = getHorizontalBar().getSelection() - horizontalScrollOffset;
scrollHorizontal(scrollPixel, false);
}
/**
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
/**
* Scrolls the widget vertically.
*/
void handleVerticalScroll(Event event) {
int scrollPixel = getVerticalBar().getSelection() - getVerticalScrollOffset();
scrollVertical(scrollPixel, false);
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
void hScroll() {
if (content == null) return;
Point location = content.getLocation ();
ScrollBar hBar = getHorizontalBar ();
int hSelection = hBar.getSelection ();
content.setLocation (-hSelection, location.y);
}
boolean needHScroll(Rectangle contentRect, boolean vVisible) {
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
void hScroll() {
if (content == null) return;
Point location = content.getLocation ();
ScrollBar hBar = getHorizontalBar ();
int hSelection = hBar.getSelection ();
content.setLocation (-hSelection, location.y);
}
boolean needHScroll(Rectangle contentRect, boolean vVisible) {
代码示例来源:origin: com.github.rinde/rinsim-problem
@Override
public void handleEvent(org.eclipse.swt.widgets.Event e) {
final int hSelection = hBar.getSelection();
final int destX = -hSelection - origin.x;
canvas.scroll(destX, 0, 0, 0, timeline.getWidth(),
timeline.getHeight(), false);
barCanvas.scroll(destX, 0, 0, 0,
timelineBar.contents.getBounds().width,
timelineBar.contents.getBounds().height, false);
origin.x = -hSelection;
}
});
代码示例来源: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);
}
}
/**
内容来源于网络,如有侵权,请联系作者删除!