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