当前位置: 首页>>代码示例>>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;未经允许,请勿转载。