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


Java SWT.MouseDown方法代码示例

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


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

示例1: handleEvent

import org.eclipse.swt.SWT; //导入方法依赖的package包/类
/**
 * Receives an event when the registered event occurs.
 * @param event the event which occurred
 */
@Override
public void handleEvent(Event event) {
    boolean cursorMoved = false;
    if (event.type == SWT.KeyDown) {
        cursorMoved = cursorMoved(event);
        
    } else if (event.type == SWT.MouseDown || event.type == SWT.MouseDoubleClick) {
        cursorMoved = true;
    }
    
    if (cursorMoved) {
        long time = Time.getCurrentTime();
        String path = recorder.getPath();
        
        String commandId = "Cursor.position.change";
        TriggerMacro trigger = new TriggerMacro(time, commandId, path, TriggerMacro.Kind.CURSOR_CHANGE);
        recorder.recordTriggerMacro(trigger);
        
        recorder.setParentMacro(null);
    }
}
 
开发者ID:liaoziyang,项目名称:ContentAssist,代码行数:26,代码来源:DocumentManager.java

示例2: handleEvent

import org.eclipse.swt.SWT; //导入方法依赖的package包/类
@Override
public void handleEvent(Event event) {
    Label label = (Label) event.widget;
    Shell shell = label.getShell();
    switch (event.type) {
        case SWT.MouseDown:
            Event e = new Event();
            e.item = (TableItem) label.getData("_TABLEITEM");
            // Assuming table is single select, set the selection as if
            // the mouse down event went through to the table
            table.setSelection(new TableItem[]{(TableItem) e.item});
            table.notifyListeners(SWT.Selection, e);
            shell.dispose();
            break;
        case SWT.MouseExit:
            shell.dispose();
            break;
    }
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:20,代码来源:SuperTable.java

示例3: addMouseListener

import org.eclipse.swt.SWT; //导入方法依赖的package包/类
private void addMouseListener(SWTSkinObject tab, Control control) {
	if (tabMouseListener == null) {
		tabMouseListener = new Listener() {
			boolean bDownPressed = false;

			@Override
			public void handleEvent(Event event) {
				if (event.type == SWT.MouseDown) {
					bDownPressed = true;
					return;
				} else if (!bDownPressed) {
					return;
				}

				bDownPressed = false;

				Control control = (Control) event.widget;
				setActiveTab((SWTSkinObjectTab) control.getData("Tab"), true);
			}
		};
	}

	control.setData("Tab", tab);
	control.addListener(SWT.MouseUp, tabMouseListener);
	control.addListener(SWT.MouseDown, tabMouseListener);

	if (control instanceof Composite) {
		Control[] children = ((Composite) control).getChildren();
		for (int i = 0; i < children.length; i++) {
			addMouseListener(tab, children[i]);
		}
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:34,代码来源:SWTSkinTabSet.java

示例4: handleEvent

import org.eclipse.swt.SWT; //导入方法依赖的package包/类
public void handleEvent(Event event) {
    switch (event.type) {
        case SWT.MouseDown:
        case SWT.Deactivate:
            this.close();
            Display.getCurrent().wake();
            break;
        case SWT.Dispose:
            PaintShop.disposeImage(splashname);
            break;
        default:
            break;
    }
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:15,代码来源:AboutDialog.java

示例5: getListenerType

import org.eclipse.swt.SWT; //导入方法依赖的package包/类
@Override
public int getListenerType() {
	return SWT.MouseDown;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:5,代码来源:MouseDownSchemaGridListener.java

示例6: getListenerType

import org.eclipse.swt.SWT; //导入方法依赖的package包/类
@Override
public int getListenerType() {
	// TODO Auto-generated method stub
	return SWT.MouseDown;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:6,代码来源:ELTMouseDownListener.java

示例7: createDeviceTemplateList2

import org.eclipse.swt.SWT; //导入方法依赖的package包/类
private void createDeviceTemplateList2(SWTSkinObjectContainer soList) {
	DeviceTemplate[] devices = mf.getDeviceTemplates();

	if (devices.length == 0) {
		noDevices();
		return;
	}

	Arrays.sort(devices, new Comparator<DeviceTemplate>() {
		@Override
		public int compare(DeviceTemplate o1, DeviceTemplate o2) {
			return o1.getName().compareToIgnoreCase(o2.getName());
		}
	});

	Composite parent = soList.getComposite();
	if (parent.getChildren().length > 0) {
		Utils.disposeComposite(parent, false);
	}

	SWTSkin skin = skinnedDialog.getSkin();

	RowLayout layout = new RowLayout(SWT.HORIZONTAL);
	layout.spacing = 0;
	layout.marginLeft = layout.marginRight = 0;
	layout.wrap = true;
	layout.justify = true;
	layout.fill = true;
	parent.setLayout(layout);


	Listener clickListener = new Listener() {
		boolean down = false;

		@Override
		public void handleEvent(Event event) {
			if (event.type == SWT.MouseDown) {
				down = true;
			} else if (event.type == SWT.MouseUp && down) {
				Widget widget = (event.widget instanceof Label)
						? ((Label) event.widget).getParent() : event.widget;
				selectedDeviceTemplate = (DeviceTemplate) widget.getData("obj");
				if (selectedDeviceTemplate == null) {
					Debug.out("selectedDeviceTemplate is null!");
				}
				skinnedDialog.close();
				down = false;
			}
		}
	};

	for (DeviceTemplate deviceTemplate : devices) {
		if (deviceTemplate.isAuto()) {
			continue;
		}
		String iconURL = null; // deviceTemplate.getIconURL();
		TranscodeChooser.addImageBox(parent, clickListener, null, deviceTemplate,
				iconURL, deviceTemplate.getName());
	}

	SWTSkinObjectText soTitle = (SWTSkinObjectText) skin.getSkinObject("title");
	if (soTitle != null) {
		soTitle.setTextID("devices.choose.device.title");
	}

	SWTSkinObjectText soSubTitle = (SWTSkinObjectText) skin.getSkinObject("subtitle");
	if (soSubTitle != null) {
		soSubTitle.setTextID("label.clickone");
	}

	Shell shell = skinnedDialog.getShell();
	Point computeSize = shell.computeSize(shell.getSize().x, SWT.DEFAULT, true);
	shell.setSize(computeSize);
	UIFunctionsSWT uiFunctionsSWT = UIFunctionsManagerSWT.getUIFunctionsSWT();
	if (uiFunctionsSWT != null) {
		Shell mainShell = uiFunctionsSWT.getMainShell();
		Utils.centerWindowRelativeTo(shell, mainShell);
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:80,代码来源:DeviceTemplateChooser.java


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