當前位置: 首頁>>代碼示例>>Java>>正文


Java MouseEvent.BUTTON3_MASK屬性代碼示例

本文整理匯總了Java中java.awt.event.MouseEvent.BUTTON3_MASK屬性的典型用法代碼示例。如果您正苦於以下問題:Java MouseEvent.BUTTON3_MASK屬性的具體用法?Java MouseEvent.BUTTON3_MASK怎麽用?Java MouseEvent.BUTTON3_MASK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.awt.event.MouseEvent的用法示例。


在下文中一共展示了MouseEvent.BUTTON3_MASK屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: mouseClicked

public void mouseClicked(MouseEvent e) {
    //System.out.println("PlotCanvas.mouseClicked");

    /*
     * System.out.println("PlotCanvas.mouseClicked"); System.out.println("
     * mouseClick = [" + mouseClick[0] + " " + mouseClick[1] + "]");
     * System.out.println(" mouseCurent = [" + mouseCurent[0] + " " +
     * mouseCurent[1] + "]");
     */
    mouseCurent[0] = e.getX();
    mouseCurent[1] = e.getY();
    e.consume();
    mouseClick[0] = mouseCurent[0];
    mouseClick[1] = mouseCurent[1];

    if (allowEdit) {
        if (e.getModifiers() == MouseEvent.BUTTON1_MASK && e.getClickCount() > 1) {
            for (int i = 0; i < grid.getAxis().length; i++) {
                if (grid.getAxis(i).isSelected(mouseClick, draw) != null) {
                    grid.getAxis(i).edit(this);
                    return;
                }
            }

            for (int i = 0; i < plots.size(); i++) {
                if (getPlot(i).isSelected(mouseClick, draw) != null) {
                    getPlot(i).edit(this);
                    return;
                }
            }
        }
    }

    if (!dragging && allowNote) {
        for (int i = 0; i < plots.size(); i++) {
            double[] _coordNoted = getPlot(i).isSelected(mouseClick, draw);
            if (e.getModifiers() == MouseEvent.BUTTON1_MASK) {
                if (_coordNoted != null) {
                    getPlot(i).noted = !getPlot(i).noted;
                } else {
                    getPlot(i).noted = false;
                }
            } else if (e.getModifiers() == MouseEvent.BUTTON3_MASK) {
                if (_coordNoted != null) {
                    if (getPlot(i).coordNoted != null) {
                        boolean alreadyNoted = true;
                        for (int j = 0; j < _coordNoted.length; j++) {
                            alreadyNoted = alreadyNoted && _coordNoted[j] == getPlot(i).coordNoted[j];
                        }
                        if (alreadyNoted) {
                            getPlot(i).coordNoted = null;
                        } else {
                            getPlot(i).coordNoted = _coordNoted;
                        }
                    } else {
                        getPlot(i).coordNoted = _coordNoted;
                    }
                }
            }
        }
        repaint();
    } else {
        dragging = false;
    }
}
 
開發者ID:Cvarier,項目名稱:2D-Elliptic-Mesh-Generator,代碼行數:65,代碼來源:PlotCanvas.java

示例2: GraphEnvironmentPopupPlugin

/** Creates a new instance of GraphPopupMenuMousePlugin */
public GraphEnvironmentPopupPlugin(BasicGraphGui parentGUI) {
    super(MouseEvent.BUTTON3_MASK);
    this.basicGraphGui = parentGUI;
    this.graphController = this.basicGraphGui.getGraphEnvironmentController();
    this.graphController.addObserver(this);
}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:7,代碼來源:GraphEnvironmentPopupPlugin.java

示例3: PopupMousePlugin

public PopupMousePlugin(){
    this.modifiers = MouseEvent.BUTTON3_MASK;    
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:3,代碼來源:MarkovViewer.java

示例4: PopupMousePlugin

public PopupMousePlugin(NetworkPanel networkPanel) {
    this(MouseEvent.BUTTON3_MASK);
    this.networkPanel = networkPanel;
}
 
開發者ID:dev-cuttlefish,項目名稱:cuttlefish,代碼行數:4,代碼來源:PopupMousePlugin.java

示例5: PopupGraphMousePlugin

public PopupGraphMousePlugin() {
    this(MouseEvent.BUTTON3_MASK);
}
 
開發者ID:dev-cuttlefish,項目名稱:cuttlefish,代碼行數:3,代碼來源:PluggableRendererDemo.java


注:本文中的java.awt.event.MouseEvent.BUTTON3_MASK屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。