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


Java MouseEvent类代码示例

本文整理汇总了Java中org.eclipse.swt.events.MouseEvent的典型用法代码示例。如果您正苦于以下问题:Java MouseEvent类的具体用法?Java MouseEvent怎么用?Java MouseEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: addSelectionListenerToOperationRadioButton

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
private void addSelectionListenerToOperationRadioButton(Button operationRadioButton) 
{
	operationRadioButton.addMouseListener(new MouseAdapter() 
	{
		@Override
		public void mouseUp(MouseEvent e) {
			outputRecordCoundText.setEnabled(false);
			editButton.setEnabled(false);
			transformMapping.setExpression(false);
			propertyDialogButtonBar.enableApplyButton(true);
			expressionValidateDecorator.hide();
			OutputRecordCountUtility.INSTANCE.removeExpressionFieldFromOutputList(transformMapping);
			OutputRecordCountUtility.INSTANCE.addOperationOutputFieldToOuterListOfMappingWindow(transformMapping);
			setSchemaUpdated(false);
			outputList.clear();
			SchemaSyncUtility.INSTANCE.unionFilter(transformMapping.getOutputFieldList(), 
					outputList);
			OutputRecordCountUtility.INSTANCE.propagateOuputFieldsToSchemaTabFromTransformWidget(
					transformMapping,getSchemaForInternalPropagation(),getComponent(),outputList
					);
		}
       });
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:24,代码来源:OutputRecordCountWidget.java

示例2: onClick

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
protected void onClick(MouseEvent event) {
	// update selection
	final Node mNode = getNodeAt(event.x, event.y);
	final boolean shiftPressed = (event.stateMask & SWT.SHIFT) != 0;
	if (!shiftPressed) {
		if (mNode == null) {
			clearSelection();
		} else {
			setSelectedNodes(mNode);
		}
	} else {
		if (mNode == null) {
			// do nothing
		} else {
			toggleSelection(mNode);
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:19,代码来源:GraphCanvas.java

示例3: addMouseMoveListener

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
@Override
public void addMouseMoveListener ( final ChartMouseMoveListener listener )
{
    removeMouseMoveListener ( listener );
    final MouseMoveListener proxyListener = new MouseMoveListener () {

        @Override
        public void mouseMove ( final MouseEvent e )
        {
            listener.onMouseMove ( convertState ( e ) );
        }

    };
    final MouseMoveListener oldListener = this.mouseMoveListenerMap.put ( listener, proxyListener );
    if ( oldListener != null )
    {
        this.control.removeMouseMoveListener ( oldListener );
    }
    this.control.addMouseMoveListener ( proxyListener );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:ChartAreaRenderer.java

示例4: onMouseDoubleClick

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
protected void onMouseDoubleClick(MouseEvent e) {
  if (m_Model == null)
    return;
  if (e.button == 1) {

    if (e.y < m_Model.getFirstRowHeight()
        + ((m_Model.getFixedRowCount() - 1) * m_Model
            .getRowHeight())) {
      // double click in header area
      int columnIndex = getColumnForResize(e.x, e.y);
      resizeColumnOptimal(columnIndex);
      return;
    } else
      openEditorInFocus();
  }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:17,代码来源:KTable.java

示例5: buildContextMenu

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
private void buildContextMenu(MouseEvent e) {
	Point point = new Point(e.x, e.y);
	TreeItem  treeItem = getTree().getItem(point);
	Menu menu = new Menu((Control)e.getSource());
	Iterator<MenuMaker> i = menuMakers.iterator();
	int cpt = 0;
	while(i.hasNext()) {
		i.next().makeMenu(this, treeItem, e, menu);
		if (i.hasNext() && menu.getItemCount() != cpt) {
			new MenuItem(menu, SWT.SEPARATOR);
			cpt = menu.getItemCount();
		}
	}
	if (menu.getItemCount() > 0) {
		menu.setVisible(true);
	} else {
		menu.dispose();
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:20,代码来源:TwsDomTree.java

示例6: glMouseDrag

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
public void glMouseDrag(double x, double y, double z,  MouseEvent e, ParamSet paramSet) {
	Feature2D feat2D = AvoGlobal.project.getActiveFeat2D();
	if(feat2D != null){
		//
		// get parameter set
		//
		//ParamSet paramSet = feat2D.paramSet;
	
		//
		// update param values
		//
		try{
			paramSet.changeParam("b", new Point2D(x,y));
			(new ToolSketchLineModel()).updateDerivedParams(paramSet);
			//navigationToolbar.showMessage("Release to finish line.");
		}catch(Exception ex){
			System.out.println(this.getClass().getCanonicalName() + " :: " + ex.getClass());
		}
	}
}
 
开发者ID:avoCADo-3d,项目名称:avoCADo,代码行数:21,代码来源:ToolSketchLineCtrl.java

示例7: mouseUp

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
@Override
public void mouseUp(MouseEvent e) {
	if (e.getSource() instanceof Button) {
		Button sel = (Button) e.getSource();
		if (sel.getText().equalsIgnoreCase("Save")) {
			try {
				String tempText = sUtil.processAdd(isEdit, editName, comp, type, editor.getDocumentProvider().getDocument(getEditorInput()).get());
				editor.getDocumentProvider().getDocument(getEditorInput()).set(tempText);
				createPage1();
				setActivePage(1);
			} catch (JAXBException ex) {
				ErrorDialog.openError(getSite().getShell(), "Error removing item", null, new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Error removing item", null));
			}
		}
	}
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:17,代码来源:ServicesEditor.java

示例8: glMouseDrag

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
public void glMouseDrag(double x, double y, double z,  MouseEvent e, ParamSet paramSet) {
	Feature2D feat2D = AvoGlobal.project.getActiveFeat2D();
	if(feat2D != null){
		//
		// get parameter set
		//
		//ParamSet paramSet = feat2D.paramSet;
	
		//
		// update param values
		//
		try{
			Point2D ptCenter = paramSet.getParam("c").getDataPoint2D();
			paramSet.changeParam("r", ptCenter.computeDist(new Point2D(x,y)));
		}catch(Exception ex){
			System.out.println("Tool2DCircle(mousedrag): " + ex.getClass());
		}
	}
}
 
开发者ID:avoCADo-3d,项目名称:avoCADo,代码行数:20,代码来源:ToolSketchCircleCtrl.java

示例9: mouseUp

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
@Override
public void mouseUp(MouseEvent e) {
	if (((Button) e.getSource()).getText().equalsIgnoreCase("Add")) {
		Parameter val = new Parameter();
		val.setName("");
		val.setType("");
		getParamArr().add(val);
		tabValues.refresh();
	} else if (((Button) e.getSource()).getText().equalsIgnoreCase("Remove")) {
		int[] items = tabValues.getTable().getSelectionIndices();
		ArrayList<Parameter> rem = new ArrayList<Parameter>();
		for (int item : items) {
			rem.add(getParamArr().get(item));
		}
		getParamArr().removeAll(rem);
		tabValues.refresh();
	} else if (((Button) e.getSource()).getText().equalsIgnoreCase("Clear")) {
		getParamArr().clear();
		tabValues.refresh();
	}
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:22,代码来源:EventServiceComposite.java

示例10: mouseUp

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
@Override
public void mouseUp(MouseEvent e) {
	if (((Button) e.getSource()).getText().equalsIgnoreCase("Add")) {
		EnumValue val = new EnumValue();
		val.setName("");
		val.setComment("");
		val.setValnum("");
		getEnumArr().add(val);
		tabValues.refresh();
	} else if (((Button) e.getSource()).getText().equalsIgnoreCase("Remove")) {
		int[] items = tabValues.getTable().getSelectionIndices();
		ArrayList<EnumValue> rem = new ArrayList<EnumValue>();
		for (int item : items) {
			rem.add(getEnumArr().get(item));
		}
		getEnumArr().removeAll(rem);
		tabValues.refresh();
	} else if (((Button) e.getSource()).getText().equalsIgnoreCase("Clear")) {
		getEnumArr().clear();
		tabValues.refresh();
	}
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:23,代码来源:EnumTypesComposite.java

示例11: mouseUp

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
@Override
public void mouseUp(MouseEvent e) {
	if (e.getSource() instanceof Button) {
		Button sel = (Button) e.getSource();
		if (sel.getText().equalsIgnoreCase("Save")) {
			try {
				String tempText = util.processAdd(isEdit, editName, comp, type, editor.getDocumentProvider().getDocument(getEditorInput()).get());
				editor.getDocumentProvider().getDocument(getEditorInput()).set(tempText);
				createPage1();
				setActivePage(1);
			} catch (JAXBException ex) {
				ErrorDialog.openError(getSite().getShell(), "Error removing item", null, new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Error removing item", null));
			}
		}
	}
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:17,代码来源:TypesEditor.java

示例12: addExportSchemaButton

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
private void addExportSchemaButton(ELTSchemaSubgroupComposite buttonSubGroup) {

		exportSchemaButton = new ELTDefaultButton("");
		SchemaButtonsSyncUtility.INSTANCE.buttonSize(exportSchemaButton, macButtonWidth, macButtonHeight,
				windowButtonWidth, windowButtonHeight);
		buttonSubGroup.attachWidget(exportSchemaButton);
		exportSchemaButton.setImage(ImagePathConstant.EXPORT_SCHEMA_BUTTON);
		exportSchemaButton.setToolTipText(Messages.EXPORT_SCHEMA_KEY_SHORTCUT_TOOLTIP);
		Button exportButton = (Button) exportSchemaButton.getSWTWidgetControl();
		exportButton.addMouseListener(new MouseAdapter() {

			@Override
			public void mouseDown(MouseEvent e) {
				exportSchemaIntoFile(exportButton);
			}
		});
	}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:ELTSchemaGridWidget.java

示例13: mouseDown

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
@Override
public void mouseDown(MouseEvent e) {
	if (editor.getItem() != null) {
		if (editor.getItem() != interfacesTable.getItem(new Point(e.x, e.y))) {
			editor.getEditor().dispose();
			interfacesTable.setItemCount(model.getInterfaces().size());
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:10,代码来源:InterfacesComponentProvider.java

示例14: mouseUp

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
@Override
public void mouseUp(MouseEvent event) {
	if (armed && inRange(event)) {
		action.run();
	}
	armed = false;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:8,代码来源:SingleClickEvent.java

示例15: onMouseDown

import org.eclipse.swt.events.MouseEvent; //导入依赖的package包/类
protected void onMouseDown(MouseEvent event) {
	mousePressed = true;
	mouseDragged = false;
	mouseDragStartX = event.x;
	mouseDragStartY = event.y;
	mouseDragBaseX = offsetX;
	mouseDragBaseY = offsetY;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:9,代码来源:VisualisationCanvas.java


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