当前位置: 首页>>代码示例>>Java>>正文


Java Slider.setMaximum方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Slider.setMaximum方法的典型用法代码示例。如果您正苦于以下问题:Java Slider.setMaximum方法的具体用法?Java Slider.setMaximum怎么用?Java Slider.setMaximum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Slider的用法示例。


在下文中一共展示了Slider.setMaximum方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: FrameView

import org.eclipse.swt.widgets.Slider; //导入方法依赖的package包/类
FrameView(Composite parent) {
	super(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	setLayout(layout);
	setBackground(ColorConstants.white);
	header = new Label(this, SWT.BORDER);
	header.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

	FontManager.setFont(header, Constants.MESSAGE_FONT_SIZE);

	viewer = new FrameViewer(this);

	slider = new Slider(this, SWT.HORIZONTAL | SWT.BORDER);
	slider.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

	slider.setMinimum(1);
	slider.setMaximum(1);
	slider.setIncrement(1);
	slider.addSelectionListener(new SelectionAdapter() {
		int sel = slider.getSelection();
		@Override
		public void widgetSelected(SelectionEvent e) {
			if(slider.getSelection() != sel) {
				model.setStep(slider.getSelection()-1);
				sel = slider.getSelection();
				PandionJUI.navigateToLine(model.getSourceFile(), model.getStepLine());
				//				slider.setToolTipText(slider.getSelection() + "/" + slider.getMaximum());
			}
		}
	});
	slider.setVisible(false);
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:33,代码来源:FrameView.java

示例2: TreeViewControls

import org.eclipse.swt.widgets.Slider; //导入方法依赖的package包/类
public TreeViewControls(Composite parent) {
    super(parent, SWT.NONE);
    GridLayout layout = new GridLayout(5, false);
    layout.marginWidth = layout.marginHeight = 2;
    layout.verticalSpacing = layout.horizontalSpacing = 4;
    setLayout(layout);

    Label filterLabel = new Label(this, SWT.NONE);
    filterLabel.setText("Filter by class or id:");
    filterLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, true));

    mFilterText = new Text(this, SWT.LEFT | SWT.SINGLE);
    mFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    mFilterText.addModifyListener(mFilterTextModifyListener);
    mFilterText.setText(HierarchyViewerDirector.getDirector().getFilterText());

    Label smallZoomLabel = new Label(this, SWT.NONE);
    smallZoomLabel.setText(" 20%");
    smallZoomLabel
            .setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, true));

    mZoomSlider = new Slider(this, SWT.HORIZONTAL);
    GridData zoomSliderGridData = new GridData(GridData.CENTER, GridData.CENTER, false, false);
    zoomSliderGridData.widthHint = 190;
    mZoomSlider.setLayoutData(zoomSliderGridData);
    mZoomSlider.setMinimum((int) (TreeViewModel.MIN_ZOOM * 10));
    mZoomSlider.setMaximum((int) (TreeViewModel.MAX_ZOOM * 10 + 1));
    mZoomSlider.setThumb(1);
    mZoomSlider.setSelection((int) Math.round(TreeViewModel.getModel().getZoom() * 10));

    mZoomSlider.addSelectionListener(mZoomSliderSelectionListener);

    Label largeZoomLabel = new Label(this, SWT.NONE);
    largeZoomLabel
            .setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, true));
    largeZoomLabel.setText("200%");

    addDisposeListener(mDisposeListener);

    TreeViewModel.getModel().addTreeChangeListener(this);
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:42,代码来源:TreeViewControls.java


注:本文中的org.eclipse.swt.widgets.Slider.setMaximum方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。