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


Java Scale.setMinimum方法代码示例

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


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

示例1: renderTransparency

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
private void renderTransparency(final Shell shell) {
	Group group = new Group(shell, SWT.NONE);
	group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 6, 1));
	group.setLayout(new GridLayout(1, false));
	group.setText("Transparency");
	final Scale transparencySlider = new Scale(group, SWT.HORIZONTAL);
	transparencySlider.setMinimum(20);
	transparencySlider.setMaximum(100);
	transparencySlider.setPageIncrement(90);
	transparencySlider.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
	transparencySlider.setSelection(100);
	transparencySlider.addListener(SWT.Selection, new Listener() {

		@Override
		public void handleEvent(Event event) {
			shell.setAlpha(255 * transparencySlider.getSelection() / 100);
		}
	});
}
 
开发者ID:juanerasmoe,项目名称:pmTrans,代码行数:20,代码来源:FindReplaceDialog.java

示例2: fillSynthGainScale

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
protected void fillSynthGainScale( Scale scale ){
	double[] range = getSynth().getDoublePropertyRange( MidiSettings.SYNTH_GAIN );
	if( range.length == 2 ){
		int value = (int)Math.round( getDoubleValue( MidiSettings.SYNTH_GAIN ) * 10f );
		int minimum = (int)Math.round( range[0] * 10 );
		int maximum = (int)Math.round( range[1] * 10 );
		if( minimum < maximum ){
			scale.setMinimum( minimum );
			scale.setMaximum( maximum );
			scale.setIncrement(1);
			scale.setPageIncrement(10);
			if( value >= minimum && value <= maximum ){
				scale.setSelection( value );
			}
		}
	}
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:18,代码来源:MidiOutputPortSettings.java

示例3: IntValue

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
public IntValue(Composite parent, int initialValue) {
	inputField = new Text(parent, SWT.BORDER | SWT.SINGLE);
	outputField = new Label(parent, SWT.NONE);
	scale = new Scale(parent, SWT.HORIZONTAL);

	inputField.setText(Integer.toString(initialValue));
	outputField.setText(msgForValue(initialValue));
	scale.setMinimum(0);
	scale.setMaximum(100);
	scale.setSelection(initialValue);

	Layouts.setGrid(parent);
	Layouts.setGridData(inputField).grabHorizontal();
	Layouts.setGridData(outputField).grabHorizontal();
	Layouts.setGridData(scale).grabHorizontal();
}
 
开发者ID:diffplug,项目名称:rxjava-and-swt,代码行数:17,代码来源:EventVsFrpTwoWay.java

示例4: createScale

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
/**
 * Creates the scale or slider widget that can be used to quickly traverse
 * the timesteps.
 * 
 * @param parent
 *            The parent Composite for this widget. Assumed not to be
 *            {@code null}.
 * @return The new widget.
 */
private Scale createScale(Composite parent) {

	final Scale scale = new Scale(this, SWT.HORIZONTAL);
	scale.setMinimum(0);
	scale.setIncrement(1);
	scale.setMaximum(0);
	scale.setToolTipText("Traverses the timesteps");

	scale.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			// Disable playback.
			setPlayback(false, e);

			// Get the timestep from the scale widget.
			if (setValidTimestep(scale.getSelection())) {
				notifyListeners(e);
			}
		}
	});

	return scale;
}
 
开发者ID:eclipse,项目名称:eavp,代码行数:33,代码来源:TimeSliderComposite.java

示例5: SliderImpl

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
public SliderImpl(final Object parentUiReference, final ISliderSetupSpi setup, final SwtImageRegistry imageRegistry) {
    super(new Scale((Composite) parentUiReference, getStyle(setup)), imageRegistry);

    this.orientation = setup.getOrientation();

    final Scale scale = getUiReference();

    scale.setMaximum(setup.getMaximum());
    scale.setMinimum(setup.getMinimum());
    scale.setSelection(setup.getMinimum());
    scale.setPageIncrement(setup.getTickSpacing());
    scale.setToolTipText(setup.getToolTipText());

    scale.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            fireInputChanged(getSelection());
        }
    });
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:21,代码来源:SliderImpl.java

示例6: XkcdColorPicker

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
public XkcdColorPicker(Composite parent, RGB initRGB) {
	super(new Composite(parent, SWT.NONE));
	RGB initYCbCr = ColorPicker.toYCbCr(initRGB);

	// create a scale and bind it to an RxBox<Integer>
	RxBox<Integer> luminance = RxBox.of(initYCbCr.red);

	// colorpanel in the center
	ColorPicker cbcrPanel = new ColorPicker(wrapped);
	Rx.subscribe(luminance, cbcrPanel::setY);

	// controls at the right
	Composite rightCmp = new Composite(wrapped, SWT.NONE);

	// scale below
	Scale scale = new Scale(wrapped, SWT.HORIZONTAL);
	scale.setMinimum(0);
	scale.setMaximum(255);
	Rx.subscribe(luminance, scale::setSelection);
	scale.addListener(SWT.Selection, e -> {
		luminance.set(scale.getSelection());
	});

	Layouts.setGrid(wrapped).numColumns(2);
	Layouts.setGridData(cbcrPanel).grabAll();
	Layouts.setGridData(rightCmp).grabVertical().verticalSpan(2);
	Layouts.setGridData(scale).grabHorizontal();

	// populate the bottom
	Layouts.setGrid(rightCmp).margin(0);
	XkcdColors.Lookup xkcdLookup = new XkcdColors.Lookup(rightCmp);

	Group hoverGrp = new Group(rightCmp, SWT.SHADOW_ETCHED_IN);
	hoverGrp.setText("Hover");
	createGroup(hoverGrp, cbcrPanel.rxMouseMove(), xkcdLookup);

	Group clickGrp = new Group(rightCmp, SWT.SHADOW_ETCHED_IN);
	clickGrp.setText("Click");
	createGroup(clickGrp, cbcrPanel.rxMouseDown(), xkcdLookup);
}
 
开发者ID:diffplug,项目名称:rxjava-and-swt,代码行数:41,代码来源:XkcdColorPicker.java

示例7: createComponent

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
protected void createComponent(Composite parent) {
	composite = section.getWidgetFactory().createComposite(parent);
	RowLayout layout = new RowLayout(SWT.HORIZONTAL);
	layout.wrap = true;
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.center = true;
	composite.setLayout(layout);

	scale = new Scale(composite, SWT.HORIZONTAL);
	scale.setMinimum(0);
	scale.setMaximum(100);
	scale.setIncrement(1);
	scale.setPageIncrement(5);
	RowData rd = new RowData();
	rd.width = 100;
	scale.setLayoutData(rd);
	scale.setToolTipText(pDescriptor.getDescription());
	scale.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			if (!isRefresh)
				ftext.setText("" + (scale.getSelection() / 100f));
		}
	});

	super.createComponent(composite);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:29,代码来源:SPTransparency.java

示例8: createScale

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
/**
 * 
 * @param shell : the Shell object used
 * @param intMin : the Integer minimum value of the scale bar
 * @param intMax : the Integer maximum value of the scale bar
 * @param intIncrements : the Integer number of increments
 * @param intPageIncrement : the Integer step of the scale bar
 * @param intSetSelection : the Integer initial value of the slider
 * @return Scale widget
 */
public Scale createScale(Shell shell, int intMin, int intMax, int intIncrements, int intPageIncrement, int intSetSelection) {

	Scale myScale = new Scale(shell, SWT.HORIZONTAL);

	myScale.setMinimum(intMin);
	myScale.setMaximum(intMax);
	myScale.setIncrement(intIncrements);
	myScale.setPageIncrement(intPageIncrement);
	myScale.setSelection(intSetSelection);

	return myScale;

}
 
开发者ID:MikeFot,项目名称:Java--GIS-Shapefile-Parser-and-Processor,代码行数:24,代码来源:WidgetFactory.java

示例9: createRankGroup

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
private void createRankGroup(Composite parent) {
    Composite prioGroup = new Composite(parent, SWT.NONE);
    prioGroup.setLayout(new GridLayout(2, false));

    Label minRankLabel = new Label(prioGroup, SWT.NONE);
    minRankLabel.setText(getMessage("property.minRank") + System.getProperty("line.separator")
            + getMessage("property.minRank.line2"));
    minRankLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));

    minRankSlider = new Scale(prioGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
    minRankSlider.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false));
    minRankSlider.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            int rank = minRankSlider.getSelection();
            getCurrentProps().getFilterSettings().setMinRank(rank);
            updateRankValueLabel();
        }
    });
    minRankSlider.setMinimum(BugRanker.VISIBLE_RANK_MIN);
    minRankSlider.setMaximum(BugRanker.VISIBLE_RANK_MAX);
    minRankSlider.setSelection(getCurrentProps().getFilterSettings().getMinRank());
    minRankSlider.setIncrement(1);
    minRankSlider.setPageIncrement(5);
    Label dummyLabel = new Label(prioGroup, SWT.NONE);
    dummyLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));

    rankValueLabel = new Label(prioGroup, SWT.NONE);
    rankValueLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
    updateRankValueLabel();
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:32,代码来源:ReportConfigurationTab.java

示例10: createScale

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
private void createScale(Composite composite) {
	Scale scale = new Scale(composite, SWT.NONE);
	scale.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
	double[] values = new double[] { 0.25, 0.5, 0.75, 1.0, 1.5,
			2.0, 2.5, 3.0, 4.0, 5.0, 10.0, 20.0 };
	scale.setIncrement(9);
	scale.setMinimum(0);
	scale.setMaximum(99);
	Controls.onSelect(scale, (e) -> {
		ZoomManager zoom = part.getZoomManager();
		zoom.setZoom(values[scale.getSelection() / 9]);
	});
	scale.setSelection(33);
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:15,代码来源:SankeyMiniViewAction.java

示例11: createControl

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent)
{
  Composite composite = new Composite(parent, SWT.NULL);
  composite.setLayout(new GridLayout(2, false));

  new Label(composite, SWT.NULL).setText(Localizer.getMessage("ALGORITHM") + ": ");
  option = new ComboViewer(composite, SWT.BORDER | SWT.READ_ONLY);
  option.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  option.setContentProvider(new OptionContentProvider());
  option.setLabelProvider(new LabelProvider());
  option.setInput(bean);

  new Label(composite, SWT.NULL).setText(Localizer.getMessage("OVERLAP_PERCENT") + ": ");
  overlapPercent = new Scale(composite, SWT.HORIZONTAL);
  overlapPercent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  overlapPercent.setMinimum(0);
  overlapPercent.setMaximum(100);
  overlapPercent.setIncrement(1);
  overlapPercent.setPageIncrement(10);

  currentPercent = new Label(composite, SWT.LEFT | SWT.FILL);
  currentPercent.setText(this.bean.getOverlapPercent() + "%     ");

  overlapPercent.addListener(SWT.Selection, new OverlapListener());

  this.setControl(composite);

  this.bind(option, "option");
  this.bind(overlapPercent, "overlapPercent");
}
 
开发者ID:terraframe,项目名称:geoprism,代码行数:32,代码来源:LocatedInPage.java

示例12: createContents

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
@Override
public void createContents(Composite parent) {
    TableWrapLayout layout = new TableWrapLayout();
    layout.topMargin = 5;
    layout.leftMargin = 5;
    layout.rightMargin = 2;
    layout.bottomMargin = 2;
    parent.setLayout(layout);

    FormToolkit tk = mform.getToolkit();
    Section s1 = tk.createSection(parent, Section.NO_TITLE);
    // s1.marginWidth = 10;

    TableWrapData td = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP);
    td.grabHorizontal = true;
    s1.setLayoutData(td);
    Composite client = tk.createComposite(s1);
    GridLayout gl = new GridLayout();
    client.setLayout(gl);

    colorLabel = tk.createLabel(client, "   yy        ", SWT.BORDER);
    colorLabel.setBackground(selectedColor);

    Composite rgbScales = tk.createComposite(client);
    GridData gd = new GridData();
    rgbScales.setLayoutData(gd);
    gl = new GridLayout(3, false);
    rgbScales.setLayout(gl);

    tk.createLabel(rgbScales, "Red");
    redScale = new Scale(rgbScales, SWT.NONE);
    redScale.setMinimum(0);
    redScale.setMaximum(255);
    redScale.setIncrement(1);
    redScale.addListener(SWT.Selection, evt -> {
        redText.setText("" + redScale.getSelection());
        updateSelectedColor();
    });
    redText = tk.createText(rgbScales, "                ", SWT.RIGHT);
    redText.setEnabled(false);
    gd = new GridData();
    gd.widthHint = 50;
    redText.setLayoutData(gd);

    tk.createLabel(rgbScales, "Green");
    greenScale = new Scale(rgbScales, SWT.NONE);
    greenScale.setMinimum(0);
    greenScale.setMaximum(255);
    greenScale.setIncrement(1);
    greenScale.addListener(SWT.Selection, evt -> {
        greenText.setText("" + greenScale.getSelection());
        updateSelectedColor();
    });
    greenText = tk.createText(rgbScales, "                ", SWT.RIGHT);
    greenText.setEnabled(false);
    gd = new GridData();
    gd.widthHint = 50;
    greenText.setLayoutData(gd);

    tk.createLabel(rgbScales, "Blue");
    blueScale = new Scale(rgbScales, SWT.NONE);
    blueScale.setMinimum(0);
    blueScale.setMaximum(255);
    blueScale.setIncrement(1);
    blueScale.addListener(SWT.Selection, evt -> {
        blueText.setText("" + blueScale.getSelection());
        updateSelectedColor();
    });
    blueText = tk.createText(rgbScales, "                ", SWT.RIGHT);
    blueText.setEnabled(false);
    gd = new GridData();
    gd.widthHint = 50;
    blueText.setLayoutData(gd);

    tk.paintBordersFor(s1);
    s1.setClient(client);
}
 
开发者ID:yamcs,项目名称:yamcs-studio,代码行数:78,代码来源:ThemeColorDetailsPage.java

示例13: createControl

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
/**
 * Create contents of the wizard.
 * 
 * @param parent
 */
public void createControl(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	setControl(container);
	container.setLayout(new GridLayout(2, false));

	Label lbl = new Label(container, SWT.NONE);
	lbl.setText(Messages.ReportTemplatesWizardPage_zoom);
	GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.FILL_HORIZONTAL);
	lbl.setLayoutData(gd);

	scale = new Scale(container, SWT.NONE);
	scale.setMinimum(1);
	scale.setMaximum(50);
	scale.setIncrement(1);
	scale.setPageIncrement(5);

	SashForm sashForm = new SashForm(container, SWT.NONE);
	sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));

	// list = new org.eclipse.swt.widgets.List(sashForm, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);
	Table table = new Table(sashForm, SWT.V_SCROLL | SWT.SINGLE | SWT.BORDER);

	table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));

	gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
	gd.widthHint = 150;
	scale.setLayoutData(gd);

	galleryComposite = new Composite(sashForm, SWT.NONE);
	layout = new StackLayout();
	galleryComposite.setLayout(layout);

	categoryList = BuiltInCategories.getCategoriesList();
	for (String cat : categoryList) {
		cachedGalleries.put(cat, null);
	}
	bundles = StudioTemplateManager.getInstance().getTemplateBundles();
	findTemplates();
	// initializeBackgroundData();

	sashForm.setWeights(new int[] { 20, 80 });
	
	
	
	scale.addListener(SWT.Selection, new Listener() {

		public void handleEvent(Event event) {
			zoomModified();
		}
	});

	container.addMouseWheelListener(scaleListener);
	//galleryComposite.addMouseWheelListener(scaleListener);

	scale.setSelection(6);
	// Manually fire the event because the invocation
	// of #Scale.selection() does not fire it.
	zoomModified();

	createTableColumn(table);
	showGallery(categoryList.get(0));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:68,代码来源:ReportTemplatesWizardPage.java

示例14: createUI_70_Option_GeoPosition

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
private Composite createUI_70_Option_GeoPosition(final PageBook parent) {

		final PixelConverter pc = new PixelConverter(parent);
		final int valueWidth = pc.convertWidthInCharsToPixels(4);
		Label label;

		final Group group = new Group(parent, SWT.NONE);
		GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
		group.setText(Messages.Adjust_Altitude_Group_GeoPosition);
		GridLayoutFactory.swtDefaults().numColumns(3).applyTo(group);
		{
			/*
			 * label: adjusted slices
			 */
			label = new Label(group, SWT.NONE);
			label.setText(Messages.Adjust_Altitude_Label_GeoPosition_Slices);

			/*
			 * label: slice value
			 */
			_lblSliceValue = new Label(group, SWT.TRAIL);
			GridDataFactory
					.fillDefaults()
					.align(SWT.END, SWT.CENTER)
					.hint(valueWidth, SWT.DEFAULT)
					.applyTo(_lblSliceValue);

			/*
			 * scale: slice position
			 */
			_scaleSlicePos = new Scale(group, SWT.HORIZONTAL);
			GridDataFactory.fillDefaults().grab(true, false).applyTo(_scaleSlicePos);
			_scaleSlicePos.setMinimum(0);
			_scaleSlicePos.setMaximum(MAX_ADJUST_GEO_POS_SLICES * 2);
			_scaleSlicePos.setPageIncrement(5);
			_scaleSlicePos.addSelectionListener(new SelectionAdapter() {
				@Override
				public void widgetSelected(final SelectionEvent e) {
					onSelectSlicePosition();
				}
			});
			_scaleSlicePos.addListener(SWT.MouseDoubleClick, new Listener() {
				@Override
				public void handleEvent(final Event event) {
					onDoubleClickGeoPos(event.widget);
				}
			});
		}

		return group;
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:52,代码来源:DialogAdjustAltitude.java

示例15: createParameterArea

import org.eclipse.swt.widgets.Scale; //导入方法依赖的package包/类
protected void createParameterArea(Composite parent) {
    GridLayout gl = new GridLayout();
    gl.numColumns = 2;
    parent.setLayout(gl);

    _repeatHeader = new Button(parent, SWT.CHECK);
    _repeatHeader.setSelection(_configuration.getRepeatHeader());
    _repeatHeader.setText("Repeat header");
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    _repeatHeader.setLayoutData(gd);

    final Label scaleText = new Label(parent, SWT.RIGHT);
    scaleText.setText(getScaleText());
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    scaleText.setLayoutData(gd);

    final Scale scale = new Scale(parent, SWT.HORIZONTAL);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    scale.setLayoutData(gd);
    scale.setMaximum(1000);
    scale.setMinimum(10);
    scale.setSelection((int) (_configuration.getScale() * 100));
    scale.addSelectionListener(new SelectionListener() {
        public void widgetSelected(SelectionEvent ev) {
            int val = scale.getSelection();
            double s = (double) val / 100.0;
            _configuration.setScale(s);
            scaleText.setText(getScaleText());
            updateConf();
        }

        public void widgetDefaultSelected(SelectionEvent arg0) {
        }
    });

    _pagesLabel = new Label(parent, SWT.RIGHT);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    _pagesLabel.setLayoutData(gd);
    _printerData = _pdatas[_printerCombo.getSelectionIndex()];
    Printer printer = new Printer(_printerData);
    _tablePrinter.setPrinter(printer);
    Point pages = _tablePrinter.calculatePageCount(_configuration);
    printer.dispose();
    _pagesLabel.setText(getPagesText(pages));

}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:51,代码来源:JaretTablePrintDialog.java


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