Java Code Examples for java.awt.event.MouseEvent.BUTTON3_MASK

The following are Jave code examples for showing how to use BUTTON3_MASK of the java.awt.event.MouseEvent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AgentWorkbench   File: GraphEnvironmentPopupPlugin.java   Source Code and License Vote up 5 votes
/** 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);
}
 
Example 2
Project: sstore-soft   File: MarkovViewer.java   Source Code and License Vote up 4 votes
public PopupMousePlugin(){
    this.modifiers = MouseEvent.BUTTON3_MASK;    
}
 
Example 3
Project: 2D-Elliptic-Mesh-Generator   File: PlotCanvas.java   Source Code and License Vote up 4 votes
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;
    }
}
 
Example 4
Project: s-store   File: MarkovViewer.java   Source Code and License Vote up 4 votes
public PopupMousePlugin(){
    this.modifiers = MouseEvent.BUTTON3_MASK;    
}
 
Example 5
Project: cuttlefish   File: PopupMousePlugin.java   Source Code and License Vote up 4 votes
public PopupMousePlugin(NetworkPanel networkPanel) {
    this(MouseEvent.BUTTON3_MASK);
    this.networkPanel = networkPanel;
}
 
Example 6
Project: cuttlefish   File: PluggableRendererDemo.java   Source Code and License Vote up 4 votes
public PopupGraphMousePlugin() {
    this(MouseEvent.BUTTON3_MASK);
}