本文整理匯總了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
);
}
});
}
示例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);
}
}
}
示例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 );
}
示例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();
}
}
示例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();
}
}
示例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());
}
}
}
示例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));
}
}
}
}
示例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());
}
}
}
示例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();
}
}
示例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();
}
}
示例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));
}
}
}
}
示例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);
}
});
}
示例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());
}
}
}
示例14: mouseUp
import org.eclipse.swt.events.MouseEvent; //導入依賴的package包/類
@Override
public void mouseUp(MouseEvent event) {
if (armed && inRange(event)) {
action.run();
}
armed = false;
}
示例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;
}