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);
}
});
}
java类org.eclipse.swt.widgets.Scale的实例源码
FindReplaceDialog.java 文件源码
项目:pmTrans
阅读 33
收藏 0
点赞 0
评论 0
FXCanvasTest.java 文件源码
项目:openjfx-8u-dev-tests
阅读 30
收藏 0
点赞 0
评论 0
@ScreenshotCheck
@Test(timeout = 300000)
@Keywords(keywords = "swt")
public void transparencyTest() throws Throwable {
final Scale scale = alphaSlider.getControl();
final AtomicInteger scaleProp = new AtomicInteger();
scale.getDisplay().syncExec(new Runnable() {
public void run() {
scaleProp.set((scale.getMaximum() - scale.getMinimum()) / 2);
}
});
setScale(scale, scaleProp.get());
checkScreenshot("SWTInteropTest-transparency", contentPane);
scale.getDisplay().syncExec(new Runnable() {
public void run() {
scaleProp.set(scale.getMaximum());
}
});
setScale(scale, scaleProp.get());
throwScreenshotError();
}
MidiOutputPortSettings.java 文件源码
项目:TuxGuitar-1.3.1-fork
阅读 29
收藏 0
点赞 0
评论 0
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 );
}
}
}
}
TGScalePopup.java 文件源码
项目:TuxGuitar-1.3.1-fork
阅读 33
收藏 0
点赞 0
评论 0
public void showShell() {
if( isShellDisposed() ){
this.shell = new Shell( this.item.getShell(), SWT.NO_TRIM );
this.shell.setVisible(false);
this.shell.setLayout(getGridLayout());
this.composite = new Composite(this.shell, SWT.BORDER);
this.composite.setLayout(getGridLayout());
this.composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
this.scale = new Scale(this.composite, SWT.VERTICAL );
this.scale.setMaximum(127);
this.scale.setMinimum(0);
this.scale.setIncrement(1);
this.scale.setPageIncrement(64);
this.scale.setLayoutData(getScaleLayoutData());
this.setValueToScale();
this.addDefaultListeners();
this.shell.pack();
this.moveShell();
this.shell.setVisible(true);
}
}
EventVsFrpTwoWay.java 文件源码
项目:rxjava-and-swt
阅读 75
收藏 0
点赞 0
评论 0
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();
}
ColorPickerTest.java 文件源码
项目:rxjava-and-swt
阅读 32
收藏 0
点赞 0
评论 0
@Test
public void testControl() {
InteractiveTest.testCoat("Should show the YCbCr plane at various values of Y", cmp -> {
Layouts.setGrid(cmp);
Scale scale = new Scale(cmp, SWT.HORIZONTAL);
scale.setMinimum(0);
scale.setMaximum(255);
scale.setSelection(128);
Layouts.setGridData(scale).grabHorizontal();
ColorPicker colors = new ColorPicker(cmp);
Layouts.setGridData(colors).grabAll();
scale.addListener(SWT.Selection, e -> {
colors.setY(scale.getSelection());
});
});
}
TimeSliderComposite.java 文件源码
项目:eavp
阅读 31
收藏 0
点赞 0
评论 0
/**
* 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;
}
UI.java 文件源码
项目:mytourbook
阅读 51
收藏 0
点赞 0
评论 0
public static void adjustScaleValueOnMouseScroll(final MouseEvent event) {
boolean isCtrlKey;
boolean isShiftKey;
if (IS_OSX) {
isCtrlKey = (event.stateMask & SWT.MOD1) > 0;
isShiftKey = (event.stateMask & SWT.MOD3) > 0;
// isAltKey = (event.stateMask & SWT.MOD3) > 0;
} else {
isCtrlKey = (event.stateMask & SWT.MOD1) > 0;
isShiftKey = (event.stateMask & SWT.MOD2) > 0;
// isAltKey = (event.stateMask & SWT.MOD3) > 0;
}
// accelerate with Ctrl + Shift key
int accelerator = isCtrlKey ? 10 : 1;
accelerator *= isShiftKey ? 5 : 1;
final Scale scale = (Scale) event.widget;
final int increment = scale.getIncrement();
final int oldValue = scale.getSelection();
final int valueDiff = ((event.count > 0 ? increment : -increment) * accelerator);
scale.setSelection(oldValue + valueDiff);
}
SliderImpl.java 文件源码
项目:jo-widgets
阅读 30
收藏 0
点赞 0
评论 0
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());
}
});
}
MidiOutputPortSettings.java 文件源码
项目:totallicks-tuxguitar
阅读 28
收藏 0
点赞 0
评论 0
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 );
}
}
}
}
FXCanvasTest.java 文件源码
项目:openjfx-8u-dev-tests
阅读 20
收藏 0
点赞 0
评论 0
@BeforeClass
public static void setUpClass() throws Exception {
System.setProperty("javafx.swtinteroperability", "true");
FXCanvasApp.main(null);
JemmyProperties.setCurrentDispatchingModel(JemmyProperties.ROBOT_MODEL_MASK);
frame = Shells.SHELLS.lookup().wrap();
frameAsParent = frame.as(Parent.class);
menuBtn = frameAsParent.lookup(org.eclipse.swt.widgets.Button.class, new ByText(FXCanvasApp.MENU_POPUP_BTN)).wrap();
alphaSlider = frameAsParent.lookup(Scale.class).wrap();
fxpane = frameAsParent.lookup(FXCanvas.class).wrap();
}
FXCanvasTest.java 文件源码
项目:openjfx-8u-dev-tests
阅读 29
收藏 0
点赞 0
评论 0
protected static void setScale(final Scale scale, final int value) {
final Event event = new Event();
event.type = SWT.Selection;
event.widget = scale;
scale.getDisplay().syncExec(new Runnable() {
public void run() {
scale.setSelection(value);
scale.notifyListeners(SWT.Selection, event);
}
});
}
XkcdColorPicker.java 文件源码
项目:rxjava-and-swt
阅读 53
收藏 0
点赞 0
评论 0
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);
}
SPTransparency.java 文件源码
项目:PDFReporter-Studio
阅读 33
收藏 0
点赞 0
评论 0
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);
}
TimeScaleBar.java 文件源码
项目:synergyview
阅读 26
收藏 0
点赞 0
评论 0
/**
* Creates the controls.
*
* @param parent
* the parent
* @param initialPixelsPerSecond
* the initial pixels per second
*/
protected void createControls(Composite parent, double initialPixelsPerSecond) {
this.setLayout(new GridLayout(1, false));
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
this.setLayoutData(gd);
pixPerSecondsScale = new Scale(this, SWT.HORIZONTAL);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
pixPerSecondsScale.setLayoutData(gd);
this.setPixelsPerSecond(initialPixelsPerSecond);
pixPerSecondsScale.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent arg0) {
}
public void widgetSelected(SelectionEvent ev) {
int val = pixPerSecondsScale.getSelection();
double pps = (((double) val) * pixelsPerSecond) / 100;
for (TimeScaleListener l : listeners) {
l.timeScaleChanged(pps);
}
}
});
}
WidgetFactory.java 文件源码
项目:Java--GIS-Shapefile-Parser-and-Processor
阅读 36
收藏 0
点赞 0
评论 0
/**
*
* @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;
}
SomoxConfigurationComposite.java 文件源码
项目:Environment
阅读 28
收藏 0
点赞 0
评论 0
public void load()
{
for (String key : mapScales.keySet())
{
Scale scale = mapScales.get(key);
int value = (int)(100*SomoxConfigurationUtil.getMetricValueByKey(key, alternative.getSomoxConfiguration()));
scale.setSelection(value);
}
bindingContext.updateTargets();
}
ReportConfigurationTab.java 文件源码
项目:FindBug-for-Domino-Designer
阅读 30
收藏 0
点赞 0
评论 0
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();
}
TGMixerTrack.java 文件源码
项目:totallicks-tuxguitar
阅读 22
收藏 0
点赞 0
评论 0
public void init(Composite parent, int style, int pageIncrement, int type, Object layoutData){
this.scale = new Scale(parent, style);
this.scale.setMaximum(127);
this.scale.setMinimum(0);
this.scale.setIncrement(1);
this.scale.setPageIncrement(pageIncrement);
this.scale.setLayoutData(layoutData);
this.type = type;
this.value = -1;
this.inverted = ((style & SWT.VERTICAL) != 0 );
this.addDefaultListeners();
}
CWDataBaseTimeScaleController.java 文件源码
项目:clickwatch
阅读 28
收藏 0
点赞 0
评论 0
public void init(Scale scale, CWDataBaseEditor editor, TreeViewer viewer) {
this.scale = scale;
this.viewer = viewer;
this.editor = editor;
installListeners();
selectionChanged(viewer.getSelection());
}
SankeyMiniViewAction.java 文件源码
项目:olca-app
阅读 27
收藏 0
点赞 0
评论 0
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);
}
LocatedInPage.java 文件源码
项目:geoprism
阅读 29
收藏 0
点赞 0
评论 0
@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");
}
LocatedInPage.java 文件源码
项目:geoprism
阅读 18
收藏 0
点赞 0
评论 0
private void bind(Scale scale, String attribute)
{
IObservableValue uiElement = SWTObservables.observeSelection(scale);
IObservableValue modelElement = BeanProperties.value(LocatedInBean.class, attribute).observe(bean);
bindingContext.bindValue(uiElement, modelElement, null, null);
}
SelectionAdapter.java 文件源码
项目:RxSWT
阅读 28
收藏 0
点赞 0
评论 0
static SelectionAdapter create(Widget widget) {
if (widget instanceof Button) {
return create((Button) widget);
} else if (widget instanceof CCombo) {
return create((CCombo) widget);
} else if (widget instanceof Combo) {
return create((Combo) widget);
} else if (widget instanceof CoolItem) {
return create((CoolItem) widget);
} else if (widget instanceof CTabFolder) {
return create((CTabFolder) widget);
} else if (widget instanceof DateTime) {
return create((DateTime) widget);
} else if (widget instanceof Link) {
return create((Link) widget);
} else if (widget instanceof List) {
return create((List) widget);
} else if (widget instanceof MenuItem) {
return create((MenuItem) widget);
} else if (widget instanceof Sash) {
return create((Sash) widget);
} else if (widget instanceof Scale) {
return create((Scale) widget);
} else if (widget instanceof Slider) {
return create((Slider) widget);
} else if (widget instanceof Spinner) {
return create((Spinner) widget);
} else if (widget instanceof StyledText) {
return create((StyledText) widget);
} else if (widget instanceof TabFolder) {
return create((TabFolder) widget);
} else if (widget instanceof Table) {
return create((Table) widget);
} else if (widget instanceof TableColumn) {
return create((TableColumn) widget);
} else if (widget instanceof TableCursor) {
return create((TableCursor) widget);
} else if (widget instanceof Text) {
return create((Text) widget);
} else if (widget instanceof ToolItem) {
return create((ToolItem) widget);
} else if (widget instanceof ToolTip) {
return create((ToolTip) widget);
} else if (widget instanceof TrayItem) {
return create((TrayItem) widget);
} else if (widget instanceof Tree) {
return create((Tree) widget);
} else if (widget instanceof TreeColumn) {
return create((TreeColumn) widget);
} else if (widget instanceof TreeCursor) {
return create((TreeCursor) widget);
}
throw new IllegalArgumentException("The given widget (" + widget.getClass().getName() + ") is not supported.");
}
TGChannelManagerDialog.java 文件源码
项目:TuxGuitar-1.3.1-fork
阅读 19
收藏 0
点赞 0
评论 0
private void createRightComposite(Composite composite){
Composite rightComposite = new Composite(composite, SWT.NONE);
rightComposite.setLayout(createGridLayout(1,false, true, false));
rightComposite.setLayoutData(new GridData(SWT.RIGHT,SWT.FILL,false,true));
Composite toolbarComposite = new Composite(rightComposite, SWT.BORDER);
toolbarComposite.setLayout(createGridLayout(1,false, true, true));
toolbarComposite.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));
this.addChannelButton = new Button(toolbarComposite, SWT.PUSH);
this.addChannelButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
this.addChannelButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
getHandle().addChannel();
}
});
Composite volumeComposite = new Composite(rightComposite, SWT.BORDER);
volumeComposite.setLayout(createGridLayout(1,false, true, true));
volumeComposite.setLayoutData(new GridData(SWT.CENTER,SWT.FILL,true,true));
this.volumeScale = new Scale(volumeComposite, SWT.VERTICAL);
this.volumeScale.setMaximum(10);
this.volumeScale.setMinimum(0);
this.volumeScale.setIncrement(1);
this.volumeScale.setPageIncrement(1);
this.volumeScale.setLayoutData(new GridData(SWT.CENTER,SWT.FILL,true,true));
Label separator = new Label(volumeComposite, SWT.HORIZONTAL | SWT.SEPARATOR);
separator.setLayoutData(new GridData(SWT.FILL,SWT.BOTTOM,true,false));
Composite volumeValueComposite = new Composite(volumeComposite, SWT.NONE);
volumeValueComposite.setLayout(createGridLayout(2,false, true, true));
this.volumeValueTitleLabel = new Label(volumeValueComposite, SWT.NONE);
this.volumeValueLabel = new Label(volumeValueComposite, SWT.CENTER);
this.volumeValueLabel.setLayoutData(createGridData(SWT.CENTER,SWT.NONE,true,false,1,1,40,0));
this.volumeScale.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
changeVolume();
}
});
}
SpinnerWithScale.java 文件源码
项目:ermasterr
阅读 23
收藏 0
点赞 0
评论 0
public SpinnerWithScale(final Spinner spinner, final Scale scale, final int diff) {
this.spinner = spinner;
this.scale = scale;
this.diff = diff;
}
SpinnerWithScale.java 文件源码
项目:ermaster-k
阅读 22
收藏 0
点赞 0
评论 0
public SpinnerWithScale(Spinner spinner, Scale scale, int diff) {
this.spinner = spinner;
this.scale = scale;
this.diff = diff;
}
ThemeColorDetailsPage.java 文件源码
项目:yamcs-studio
阅读 26
收藏 0
点赞 0
评论 0
@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);
}
ReportTemplatesWizardPage.java 文件源码
项目:PDFReporter-Studio
阅读 28
收藏 0
点赞 0
评论 0
/**
* 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));
}
SpinnerWithScale.java 文件源码
项目:erflute
阅读 35
收藏 0
点赞 0
评论 0
public SpinnerWithScale(Spinner spinner, Scale scale, int diff) {
this.spinner = spinner;
this.scale = scale;
this.diff = diff;
}