Example usage for java.awt.event MouseEvent BUTTON3

List of usage examples for java.awt.event MouseEvent BUTTON3

Introduction

In this page you can find the example usage for java.awt.event MouseEvent BUTTON3.

Prototype

int BUTTON3

To view the source code for java.awt.event MouseEvent BUTTON3.

Click Source Link

Document

Indicates mouse button #3; used by #getButton .

Usage

From source file:net.ytbolg.mcxa.MCLaucherXA.java

private void jList1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jList1MouseClicked
    if (jList1.getSelectedIndex() == -1) {
        return;/*from  w ww  .ja  v  a 2s  . c o  m*/
    }

    try {
        if (MakeCmd.isChanged(
                new ZipFile(GameInfo.GameDir + tpf + "versions" + tpf + jList1.getSelectedValue().toString()
                        + tpf + jList1.getSelectedValue().toString() + ".jar"))) {
            jComboBox1.setSelectedItem(
                    "-Dfml.ignoreInvalidMinecraftCertificates=true -Dfml.ignorePatchDiscrepancies=true");
        } else {
            jComboBox1.setSelectedItem("");
        }
    } catch (IOException ex) {
        Logger.getLogger(MCLaucherXA.class.getName()).log(Level.SEVERE, null, ex);
    }

    if (evt.getButton() == MouseEvent.BUTTON3 && jList1.getSelectedIndex() != -1) {
        jPopupMenu1.show(this, evt.getX() + 25, evt.getY() + 25);
    }
    if (evt.getButton() == MouseEvent.BUTTON2 && evt.getClickCount() == 2) {
        jButton1ActionPerformed(null);
    }
    try {
        BrushLabels(jList1.getSelectedIndex());
    } catch (JSONException e) {
    } catch (Exception ex) {
        Logger.getLogger(MCLaucherXA.class.getName()).log(Level.SEVERE, null, ex);
    }
    // TODO add your handling code here:
}

From source file:com.talent.aio.examples.im.client.ui.JFrameMain.java

private void msgTextAreaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_msgTextAreaMouseClicked

    if (evt.getButton() == MouseEvent.BUTTON3) {//?
        log.error(evt.getButton() + "");
    }//from   www.  j a  v a  2  s .  c  om
}

From source file:gtu._work.ui.DirectoryCompareUI.java

private void dirCompareTableMouseClicked(MouseEvent evt) {
    try {/*from w ww.  jav  a2 s . c  o  m*/
        final JTableUtil util = JTableUtil.newInstance(dirCompareTable);
        InfoObj obj = getInfoObj(util.getSelectedRow(), util);

        if (evt.getClickCount() == 2 && evt.getButton() == MouseEvent.BUTTON1) {
            File mainFile = obj.mainFile.getFile().exists() ? obj.mainFile.getFile() : NOT_EXIST_FILE;
            File compareFile = obj.compareToFile.getFile().exists() ? obj.compareToFile.getFile()
                    : NOT_EXIST_FILE;

            File fileA = mainFile;
            File fileB = compareFile;
            if (mergeSwap) {
                File tempFile = fileA;
                fileA = fileB;
                fileB = tempFile;
            }

            DiffMergeCommand diffCommand = (DiffMergeCommand) diffToolComboBox.getSelectedItem();
            String command = diffCommand.getCommand(this, fileA, fileB);
            System.out.println(command);
            ProcessWatcher.newInstance(Runtime.getRuntime().exec(command)).getStreamSync();
        }
        if (evt.getClickCount() == 1 && evt.getButton() == MouseEvent.BUTTON3) {
            final File mainFile = obj.mainFile.getFile();
            final File compareToFile = obj.compareToFile.getFile();

            JPopupMenuUtil.newInstance(dirCompareTable).applyEvent(evt)//
                    .addJMenuItem("", new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            JCommonUtil._jOptionPane_showMessageDialog_info(//
                                    ": " + (mainFile.exists() ? mainFile.getAbsolutePath() : "?")
                                            + //
                            "\n?: " + (compareToFile.exists() ? compareToFile.getAbsolutePath()
                                    : "?"), //
                                    mainFile.getName());
                        }
                    })//
                    .addJMenuItem("merge??:" + (!mergeSwap ? "(?)" : "(?)"),
                            new ActionListener() {
                                @Override
                                public void actionPerformed(ActionEvent e) {
                                    mergeSwap = !mergeSwap;
                                }
                            })//
                    .addJMenuItem(" [open file]", new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            openFile(mainFile);
                        }
                    })//
                    .addJMenuItem(" [open dir]", new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            openFile(mainFile.getParentFile());
                        }
                    })//
                    .addJMenuItem("? [open file]", new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            openFile(compareToFile);
                        }
                    })//
                    .addJMenuItem("? [open dir]", new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            openFile(compareToFile.getParentFile());
                        }
                    })//
                    .addJMenuItem(" -> ? ()", new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            int[] rows = util.getSelectedRows();
                            if (rows != null && rows.length >= 1) {
                                if (JCommonUtil._JOptionPane_showConfirmDialog_yesNoOption(
                                        "?" + rows.length + ", ?!", "")) {
                                    List<File> fileList = new ArrayList<File>();
                                    for (int ii = 0; ii < rows.length; ii++) {
                                        InfoObj obj = getInfoObj(rows[ii], util);
                                        File mainFile = obj.mainFile.getFile();
                                        File compareToFile = obj.compareToFile.getFile();
                                        overwriteFile(mainFile, compareToFile, fileList);
                                    }
                                    StringBuilder sb = new StringBuilder();
                                    for (File f : fileList) {
                                        sb.append(f + "\n");
                                    }
                                    JCommonUtil._jOptionPane_showMessageDialog_info(sb, "?");
                                }
                            } else {
                                overwriteFile(mainFile, compareToFile, null);
                            }
                        }
                    })//
                    .addJMenuItem("? ->  ()", new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            int[] rows = util.getSelectedRows();
                            if (rows != null && rows.length >= 1) {
                                if (JCommonUtil._JOptionPane_showConfirmDialog_yesNoOption(
                                        "?" + rows.length + ", ?!", "")) {
                                    List<File> fileList = new ArrayList<File>();
                                    for (int ii = 0; ii < rows.length; ii++) {
                                        InfoObj obj = getInfoObj(rows[ii], util);
                                        File mainFile = obj.mainFile.getFile();
                                        File compareToFile = obj.compareToFile.getFile();
                                        overwriteFile(compareToFile, mainFile, fileList);
                                    }
                                    StringBuilder sb = new StringBuilder();
                                    for (File f : fileList) {
                                        sb.append(f + "\n");
                                    }
                                    JCommonUtil._jOptionPane_showMessageDialog_info(sb, "?");
                                }
                            } else {
                                overwriteFile(compareToFile, mainFile, null);
                            }
                        }
                    })//
                    .addJMenuItem("(?)", new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            pourOutFilesByOrignPath(true);
                        }
                    })//
                    .addJMenuItem("?(?)", new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            pourOutFilesByOrignPath(false);
                        }
                    }).show();
        }
    } catch (Exception e) {
        JCommonUtil.handleException(e, false);
    }
}

From source file:org.rdv.ui.TimeSlider.java

/**
 * Called when the mouse is clicked. Used to set the time value when there is
 * a click on the time slider.//ww w .ja v  a  2  s . c o m
 * 
 * @param me  the mouse event that triggered this
 */
public void mouseClicked(MouseEvent me) {
    double time;
    if (me.getSource() == this) {
        time = getTimeFromX(me.getX());
    } else if (me.getSource() == valueButton) {
        time = getTimeFromX(valueButton.getX() + me.getX());
    } else {
        return;
    }

    if (me.getButton() == MouseEvent.BUTTON1) {
        setValue(time);
    } else if (me.getButton() == MouseEvent.BUTTON3) {
        EventMarker eventMarker = getMarkerClosestToTime(time);
        if (eventMarker != null) {
            double markerTime = Double.parseDouble(eventMarker.getProperty("timestamp"));
            setValue(markerTime);
        }
    }
}

From source file:ru.goodfil.catalog.ui.forms.FiltersPanel.java

private void tblFiltersMouseClicked(MouseEvent e) {
    if (e.getButton() == MouseEvent.BUTTON3) {
        if (filters.size() > 0) {
            tablesPopupMenu.show(tblFilters, e.getX(), e.getY());
        }//  w w  w .ja va2s. c  o m
    }
}

From source file:ru.goodfil.catalog.ui.forms.FiltersPanel.java

private void tblMotorsMouseClicked(MouseEvent e) {
    if (e.getButton() == MouseEvent.BUTTON3) {
        if (motors.size() > 0) {
            tablesPopupMenu.show(tblMotors, e.getX(), e.getY());
        }/*from ww  w.  j a  v a  2 s. c  om*/
    }
}

From source file:ru.goodfil.catalog.ui.forms.FiltersPanel.java

private void tblAllMotorsMouseClicked(MouseEvent e) {
    if (e.getButton() == MouseEvent.BUTTON3) {
        if (allMotors.size() > 0) {
            tablesPopupMenu.show(tblAllMotors, e.getX(), e.getY());
        }/*from   www  .jav a  2  s  .  co  m*/
    }
}

From source file:ru.goodfil.catalog.ui.forms.FiltersPanel.java

private void tblOesMouseClicked(MouseEvent e) {
    if (e.getButton() == MouseEvent.BUTTON3) {
        if (oes.size() > 0) {
            tablesPopupMenu.show(tblOes, e.getX(), e.getY());
        }// w  w  w  . j  a  va2 s .c om
    }
}

From source file:ru.goodfil.catalog.ui.forms.CarsPanel.java

private void vechicleTypesListMouseClicked(MouseEvent e) {
    if (e.getButton() == MouseEvent.BUTTON3) {
        if (vechicleTypes.size() > 0) {
            listsPopupMenu.show(vechicleTypesList, e.getX(), e.getY());
        }//from  w  ww  . j  a va2s . c o m
    }
}

From source file:ru.goodfil.catalog.ui.forms.FiltersPanel.java

private void tblAllOesMouseClicked(MouseEvent e) {
    if (e.getButton() == MouseEvent.BUTTON3) {
        if (allOes.size() > 0) {
            tablesPopupMenu.show(tblAllOes, e.getX(), e.getY());
        }/*from  w  ww  . j  a  v a  2 s  .com*/
    }
}