本文整理汇总了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());
}
}
示例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());
}
}
}
}
示例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;
}
示例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());
}
}
}
示例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());
}
}
示例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);
}
}
}
示例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());
}
}
示例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());
}
}
示例9: mousePressed
import java.awt.event.MouseEvent; //导入方法依赖的package包/类
public void mousePressed(final MouseEvent e) {
if (e.isPopupTrigger()) showPopup(e);
}
示例10: maybeShowPopup
import java.awt.event.MouseEvent; //导入方法依赖的package包/类
private void maybeShowPopup(MouseEvent e) {
if (e.isPopupTrigger()) {
notesPPMenu.show(e.getComponent(), e.getX(), e.getY());
}
}
示例11: maybeShowPopup
import java.awt.event.MouseEvent; //导入方法依赖的package包/类
private void maybeShowPopup(MouseEvent e) {
if (e.isPopupTrigger()) {
projectsPPMenu.show(e.getComponent(), e.getX(), e.getY());
}
}
示例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);
}
示例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;
}
示例14: evaluateClick
import java.awt.event.MouseEvent; //导入方法依赖的package包/类
private void evaluateClick(MouseEvent e) {
if (e.isPopupTrigger()) {
showPopup(e.getPoint());
}
}
示例15: maybeShowPopup
import java.awt.event.MouseEvent; //导入方法依赖的package包/类
private void maybeShowPopup(MouseEvent e) {
if (e.isPopupTrigger()) {
projectsPPMenu.show(e.getComponent(), e.getX(), e.getY());
}
}