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


Java SWT.MOD1属性代码示例

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


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

示例1: apply

@Override
public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
	initIfNeeded();
	IDocument document = viewer.getDocument();
	if (fTextViewer == null) {
		fTextViewer = viewer;
	}
	// don't eat if not in preferences, XOR with modifier key 1 (Ctrl)
	// but: if there is a selection, replace it!
	Point selection = viewer.getSelectedRange();
	fToggleEating = (stateMask & SWT.MOD1) != 0;
	int newLength = selection.x + selection.y - getReplacementOffset();
	if ((insertCompletion() ^ fToggleEating) && newLength >= 0) {
		setReplacementLength(newLength);
	}
	apply(document, trigger, offset);
	fToggleEating = false;
}
 
开发者ID:angelozerr,项目名称:ec4e,代码行数:18,代码来源:EditorConfigCompletionProposal.java

示例2: mouseScrolled

@Override
public void mouseScrolled(MouseEvent e) {
	if ((e.stateMask & SWT.MOD1) != 0) {
		zoom(e);
	} else {
		scroll(e);
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:8,代码来源:AbstractTimelineView.java

示例3: addConfigurableMenuItem

private MenuItem addConfigurableMenuItem(Menu menu, final String orgText,
		final String acceleratorKey, SelectionListener listener) {
	char accelerator = Config.getInstance().getString(acceleratorKey)
			.toUpperCase().charAt(0);
	int acc = SWT.MOD1 + (accelerator == ' ' ? SWT.SPACE : accelerator);
	String text = orgText + " \t Ctrl+"
			+ (accelerator == ' ' ? "[space]" : accelerator);

	final MenuItem item = addMenuItem(menu, text, acc, listener);

	Config.getInstance().addPropertyChangeListener(
			new IPropertyChangeListener() {
				public void propertyChange(PropertyChangeEvent arg0) {
					if (arg0.getProperty().equals(acceleratorKey))
						updateAccelerator(item, orgText, Config
								.getInstance().getString(acceleratorKey)
								.toUpperCase().charAt(0));
				}
			});

	return item;
}
 
开发者ID:juanerasmoe,项目名称:pmTrans,代码行数:22,代码来源:MenuManager.java

示例4: updateAccelerator

private void updateAccelerator(MenuItem item, String itemText,
		char newAccelerator) {
	itemText += " \t Ctrl+"
			+ (newAccelerator == ' ' ? "[space]" : newAccelerator);
	int acc = SWT.MOD1
			+ (newAccelerator == ' ' ? SWT.SPACE : newAccelerator);
	item.setText(itemText);
	item.setAccelerator(acc);
}
 
开发者ID:juanerasmoe,项目名称:pmTrans,代码行数:9,代码来源:MenuManager.java

示例5: onMouseDown

@Override
public void onMouseDown ( final MouseState e )
{
    if ( e.button != 1 || e.state != SWT.MOD1 )
    {
        return;
    }

    final Rectangle rect = this.chartArea.getClientAreaProxy ().getClientRectangle ();

    // check if we are outside the chart area
    if ( e.x < rect.x || e.x > rect.x + rect.width )
    {
        return;
    }
    if ( e.y < rect.y || e.y > rect.y + rect.height )
    {
        return;
    }

    // now start dragging

    this.active = true;

    this.startX = e.x;
    this.startY = e.y;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:27,代码来源:MouseTransformer.java

示例6: mouseMove

@Override
public void mouseMove(MouseEvent e) {
	if (originMousePosition != null) {
		final FigureCanvas canvas = (FigureCanvas)timelineViewer.getControl();
		canvas.scrollTo(offset.x, offset.y - e.y + originMousePosition.y);
		final int shift = (int)((-e.x + originMousePosition.x)
				/ (PossibleStepEditPart.SIZE + BranchEditPart.SPACING) / rootEditPart
				.getZoomManager().getZoom())
				- doneShift;
		final int multiplier;
		if ((e.stateMask & SWT.MOD1) != 0) {
			multiplier = timelineWindow.getLength();
		} else {
			multiplier = 1;
		}
		if (follow && shift < 0) {
			toggleFollow();
		}
		if (timelineWindow.getStart() + shift * multiplier < 0) {
			timelineWindow.setStart(0);
		} else if (provider != null
				&& timelineWindow.getStart() + timelineWindow.getLength() + shift * multiplier > timelineWindow
						.getMaxTimelineIndex()
						+ nbVirtualChoices) {
			timelineWindow.setStart(Math.max(timelineWindow.getMaxTimelineIndex() + nbVirtualChoices
					- timelineWindow.getLength(), 0));
		} else if (shift != 0) {
			doneShift += shift;
			timelineWindow.setStart(timelineWindow.getStart() + shift * multiplier);
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:32,代码来源:AbstractTimelineView.java


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