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


Java MouseEvent.isPopupTrigger方法代码示例

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


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

示例1: maybeShowPopup

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
private void maybeShowPopup(MouseEvent e) {
	if (e.isPopupTrigger()) {
		JPopupMenu popupMenu = new JPopupMenu();
		popupMenu.setFocusable(false);

		popupMenu.add(jMenuItemUndo);
		popupMenu.add(jMenuItemRedo);
		popupMenu.addSeparator();
		popupMenu.add(jMenuItemCut);
		popupMenu.add(jMenuItemCopy);
		popupMenu.add(jMenuItemPaste);
		popupMenu.addSeparator();
		if (jMenuItemInsCell.getAction().isEnabled()) {
			popupMenu.add(jMenuItemInsCell);
			jMenuItemInsCell.setEnabled(true);
			popupMenu.add(jMenuItemInsRow);
			jMenuItemInsRow.setEnabled(true);
			popupMenu.addSeparator();
		}
		popupMenu.add(jMenuItemProp);
		popupMenu.show(e.getComponent(), e.getX(), e.getY());

	}
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:25,代码来源:HTMLEditor.java

示例2: mousePressed

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * Handles a 'mouse pressed' event.
 * <P>
 * This event is the popup trigger on Unix/Linux.  For Windows, the popup
 * trigger is the 'mouse released' event.
 *
 * @param e  The mouse event.
 */
public void mousePressed(MouseEvent e) {

    if (this.zoomRectangle == null) {

        this.zoomPoint = RefineryUtilities.getPointInRectangle(
            e.getX(), e.getY(), getScaledDataArea()
        );
        LOGGER.debug("In mousePressed()");
        LOGGER.debug("getScaledDataArea() = " + getScaledDataArea());
        LOGGER.debug("this.zoomPoint = " + this.zoomPoint);

        // check for popup trigger...
        if (e.isPopupTrigger()) {
            if (this.popup != null) {
                displayPopupMenu(e.getX(), e.getY());
            }
        }
    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:29,代码来源:ChartPanel.java

示例3: mouseClicked

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mouseClicked(MouseEvent e) {
	if (e.isPopupTrigger()) {
		showContextMenu(e.getPoint());
	} else {
		click(e);
	}
	armed = null;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:10,代码来源:ExtendedMouseClickedAdapter.java

示例4: tryPopUp

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
public void tryPopUp(MouseEvent evt){
	String osName = System.getProperty("os.name");
	if ( !evt.isControlDown() ) {
		if ( osName.startsWith("Mac OS") && evt.isShiftDown() ) {
			pm.show(evt.getComponent(), evt.getX(), evt.getY() );
		}
		else if ( evt.isPopupTrigger() ) {
			pm.show(evt.getComponent(), evt.getX(), evt.getY());
		}
	}
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:MGGData.java

示例5: mouseReleased

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
public void mouseReleased(MouseEvent e) {
	if (e.isPopupTrigger() && e.getSource() instanceof JTextField) {
		JTextField textfield = (JTextField) e.getSource();
		if (Boolean.TRUE.equals(textfield
				.getClientProperty("DisablePopupMenu"))) {
			return;
		}
		textfield.requestFocusInWindow();
		show(textfield, e.getX(), e.getY());
	}
}
 
开发者ID:jonasxiao,项目名称:FinalSpeed,代码行数:12,代码来源:TextComponentPopupMenu.java

示例6: mouseClicked

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
public void mouseClicked(MouseEvent e) {
    if (!e.isPopupTrigger()) {
        HotSpot spot = getHotspotAt(e.getPoint());
        if (spot != null) {
            performAction(spot);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:LineNumbersActionsBar.java

示例7: mousePressed

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
@Override
public void mousePressed(MouseEvent e) {
  if(e.isPopupTrigger()) {
    createPopup(e);
    mousePopup.show(e.getComponent(), e.getX(), e.getY());
  }
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:8,代码来源:LuceneDataStoreSearchGUI.java

示例8: maybeShowPopup

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
private void maybeShowPopup(MouseEvent evt) {
    if (evt.isPopupTrigger()) {
        TreePath selectedPath = getPathForLocation(evt.getX(), evt.getY());
        TreeNode selectedNode =
            selectedPath == null ? null : (TreeNode) selectedPath.getLastPathComponent();
        RuleTree.this.requestFocus();
        createPopupMenu(selectedNode).show(evt.getComponent(), evt.getX(), evt.getY());
    }
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:10,代码来源:RuleTree.java

示例9: mousePressed

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
public void mousePressed(final MouseEvent e) {
    if (e.isPopupTrigger()) showPopup(e);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ComponentDetailsProvider.java

示例10: maybeShowPopup

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
private void maybeShowPopup(MouseEvent e) {
    if (e.isPopupTrigger()) {
        notesPPMenu.show(e.getComponent(), e.getX(), e.getY());
    }
}
 
开发者ID:ser316asu,项目名称:SER316-Aachen,代码行数:6,代码来源:NotesControlPanel.java

示例11: maybeShowPopup

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
private void maybeShowPopup(MouseEvent e) {
	if (e.isPopupTrigger()) {
		projectsPPMenu.show(e.getComponent(), e.getX(), e.getY());
	}
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:6,代码来源:ProjectsPanel.java

示例12: isLeftMouseButtonExt

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
private boolean isLeftMouseButtonExt(MouseEvent evt) {
    return (SwingUtilities.isLeftMouseButton(evt)
            && !(evt.isPopupTrigger())
            && (evt.getModifiers() & (InputEvent.META_MASK | InputEvent.ALT_MASK)) == 0);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:BaseCaret.java

示例13: isCellEditable

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
/**
 * Overridden to return false, and if the event is a mouse event it is
 * forwarded to the tree.
 * <p>
 * The behavior for this is debatable, and should really be offered as a
 * property. By returning false, all keyboard actions are implemented in
 * terms of the table. By returning true, the tree would get a chance to
 * do something with the keyboard events. For the most part this is ok.
 * But for certain keys, such as left/right, the tree will
 * expand/collapse where as the table focus should really move to a
 * different column. Page up/down should also be implemented in terms of
 * the table. By returning false this also has the added benefit that
 * clicking outside of the bounds of the tree node, but still in the
 * tree column will select the row, whereas if this returned true that
 * wouldn't be the case.
 * <p>
 * By returning false we are also enforcing the policy that the tree
 * will never be editable (at least by a key sequence).
 */
public boolean isCellEditable(EventObject e) {
	if (e instanceof MouseEvent) {
		for (int counter = getColumnCount() - 1; counter >= 0; counter--) {
			if (getColumnClass(counter) == TreeTableModel.class) {
				MouseEvent me = (MouseEvent) e;
				MouseEvent newME = new MouseEvent(tree, me.getID(), me
						.getWhen(), me.getModifiers(), me.getX()
						- getCellRect(0, counter, true).x, me.getY(),
						me.getClickCount(), me.isPopupTrigger());
				tree.dispatchEvent(newME);
				break;
			}
		}
	}
	return false;
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:36,代码来源:JTreeTable.java

示例14: evaluateClick

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
private void evaluateClick(MouseEvent e) {
	if (e.isPopupTrigger()) {
		showPopup(e.getPoint());
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:6,代码来源:TextFieldUI.java

示例15: maybeShowPopup

import java.awt.event.MouseEvent; //导入方法依赖的package包/类
private void maybeShowPopup(MouseEvent e) {
	if (e.isPopupTrigger()) {
		projectsPPMenu.show(e.getComponent(), e.getX(), e.getY());				
	}
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:6,代码来源:ProjectsPanel.java


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