當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。