Example usage for java.awt.event MouseEvent getClickCount

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

Introduction

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

Prototype

public int getClickCount() 

Source Link

Document

Returns the number of mouse clicks associated with this event.

Usage

From source file:lu.fisch.unimozer.Diagram.java

private void loadClickedClass(MouseEvent e) {
    mousePoint = e.getPoint();//  w  w w.  j  av a  2  s.  c o  m
    MyClass clickClass = getMouseClass(mousePoint);

    if (e.getClickCount() <= 1) // && e.getButton()==MouseEvent.BUTTON1) // && clickClass!=mouseClass)
    {
        // assign the selected class
        mouseClass = clickClass;
        // set the codereader
        codeReader = new CodeReader(this, mouseClass, editor.getCode());
        // update the NSD
        if (mouseClass != null)
            mouseClass.updateNSD(getNsd());
        // set button states
        frame.setButtons(mouseClass != null);
        if (mouseClass != null)
            frame.setButtons(mouseClass.isValidCode());
        // update the editor
        updateEditor();
    }
}

From source file:base.BasePlayer.Main.java

@Override
public void mouseClicked(MouseEvent event) {

    if (cancelhover && drawCanvas.loading) {
        cancel();/* ww w . jav  a2  s. co m*/
    }
    if (event.getComponent().getName() != null && genomehash.containsKey(event.getComponent().getName())) {

        changeRef(event.getComponent().getName());

    }

    /*if(event.getSource() == drawScroll.getVerticalScrollBar()) {
               
       drawCanvas.drawVariables.visiblestart = (short)(drawScroll.getVerticalScrollBar().getValue()/drawCanvas.sampleHeight);
               
       drawCanvas.drawVariables.visibleend = (short)((drawCanvas.drawVariables.visiblestart + drawScroll.getHeight()/drawCanvas.sampleHeight));
            
       drawCanvas.scrollbar = true;
       Draw.updatevars = true;
               
       drawCanvas.repaint();
       drawCanvas.scrollbar = false;
    }*/
    if (event.getSource() == searchField) {
        searchField.setFocusable(true);
        searchField.requestFocus();
        if (event.getClickCount() == 2) {

            searchField.setText("");
        }
    } else {
        searchField.setFocusable(false);
    }
    if (event.getSource() == back && back.isEnabled()) {
        undoPointer--;
        if (undoPointer < 1) {
            undoPointer = 0;
            back.setEnabled(false);
        }
        forward.setEnabled(true);
        returnlist = parseSearch(undoList.get(undoPointer));
        searchField.setText(undoList.get(undoPointer));
        FileRead.search = true;
        drawCanvas.gotoPos(returnlist[0], Integer.parseInt(returnlist[1]), Integer.parseInt(returnlist[2]));

    }
    if (event.getSource() == forward && forward.isEnabled()) {
        undoPointer++;
        if (undoPointer >= undoList.size() - 1) {
            undoPointer = undoList.size() - 1;
            forward.setEnabled(false);
        }
        back.setEnabled(true);
        returnlist = parseSearch(undoList.get(undoPointer));
        FileRead.search = true;
        searchField.setText(undoList.get(undoPointer));
        drawCanvas.gotoPos(returnlist[0], Integer.parseInt(returnlist[1]), Integer.parseInt(returnlist[2]));

    }

}

From source file:v800_trainer.JCicloTronic.java

private void DatentabelleMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_DatentabelleMouseClicked
    // Add your handling code here:
    if (evt.getButton() == MouseEvent.BUTTON3 && evt.getButton() != MouseEvent.BUTTON1) {

        int dummy = Datentabelle.rowAtPoint(evt.getPoint());
        int selection[] = Datentabelle.getSelectedRows();

        boolean isselected = false;
        for (int i = 0; i < selection.length; i++) {
            if (dummy == selection[i]) {
                isselected = true;/* w ww .  j  a  va  2  s.co  m*/
            }
        }
        ;
        Datentabelle.clearSelection();
        if (!isselected) {
            Datentabelle.addRowSelectionInterval(dummy, dummy);
        }

        for (int i = 0; i < selection.length; i++) {
            if (dummy != selection[i]) {
                Datentabelle.addRowSelectionInterval(selection[i], selection[i]);
            }

        }

    }
    SelectionChanged = true;
    Update = false;
    Datenliste_Monat.setEnabled(false);
    Datenliste_Monat.setSelectedIndex(0);
    Datenliste_Jahr.setSelectedIndex(0);
    Datenliste_Zeitabschnitt.setSelectedIndex(0);
    Datenliste_TourTyp.setSelectedIndex(0);

    Update = true;
    jLabel69_Selektiert.setText(Datentabelle.getSelectedRowCount() + " / " + Datentabelle.getRowCount());
    if (evt.getClickCount() == 2) {
        Hauptfenster.setSelectedIndex(1);
    }
}

From source file:com.peterbochs.PeterBochsDebugger.java

private void jPageTableTableMouseClicked(MouseEvent evt) {
    if (evt.getClickCount() == 2) {
        String pageAddress = jPageTableTable.getValueAt(jPageTableTable.getSelectedRow(), 1).toString();
        this.jMemoryAddressComboBox.setSelectedItem(pageAddress);
        this.jGOMemoryButtonActionPerformed(null);
    }/*  w  ww .  ja  v  a 2s . co  m*/
}

From source file:com.peterbochs.PeterBochsDebugger.java

private void jLDTTableMouseClicked(MouseEvent evt) {
    if (evt.getClickCount() == 2) {
        for (int x = 0; x < jTabbedPane2.getTabCount(); x++) {
            if (jTabbedPane2.getTitleAt(x).equals(("LDT " + jLDTTable.getSelectedRow() + 1))) {
                jTabbedPane2.setSelectedIndex(x);
                return;
            }//from   w ww . ja  v a 2 s .co m
        }
        JScrollPane temp = new JScrollPane();
        temp.setViewportView(new GDTLDTPanel(this, 1,
                CommonLib.string2BigInteger(this.registerPanel.jLDTRTextField.getText()),
                jLDTTable.getSelectedRow() + 1));
        jTabbedPane2.addTabWithCloseButton("LDT " + jLDTTable.getSelectedRow(), null, temp, null);
        jTabbedPane2.setSelectedIndex(jTabbedPane2.getTabCount() - 1);
    }
}

From source file:com.peterbochs.PeterBochsDebugger.java

private void jIDTTableMouseClicked(MouseEvent evt) {
    if (evt.getClickCount() == 2) {
        for (int x = 0; x < jTabbedPane2.getTabCount(); x++) {
            if (jTabbedPane2.getTitleAt(x)
                    .equals(("IDT " + String.format("0x%02x", jIDTTable.getSelectedRow())))) {
                jTabbedPane2.setSelectedIndex(x);
                return;
            }// www .jav a 2 s. c om
        }
        jTabbedPane2.addTabWithCloseButton("IDT " + String.format("0x%02x", jIDTTable.getSelectedRow()), null,
                new IDTDescriptorPanel(this,
                        CommonLib.string2BigInteger(this.registerPanel.jIDTRTextField.getText()),
                        jIDTTable.getSelectedRow()),
                null);
        jTabbedPane2.setSelectedIndex(jTabbedPane2.getTabCount() - 1);
    }
}

From source file:com.peterbochs.PeterBochsDebugger.java

private void jGDTTableMouseClicked(MouseEvent evt) {
    if (evt.getClickCount() == 2) {
        for (int x = 0; x < jTabbedPane2.getTabCount(); x++) {
            if (jTabbedPane2.getTitleAt(x)
                    .equals(("GDT " + String.format("0x%02x", jGDTTable.getSelectedRow() + 1)))) {
                jTabbedPane2.setSelectedIndex(x);
                return;
            }//from w  w w  .ja v a 2  s .com
        }
        jTabbedPane2.addTabWithCloseButton("GDT " + String.format("0x%02x", jGDTTable.getSelectedRow() + 1),
                null,
                new GDTLDTPanel(this, 0,
                        CommonLib.string2BigInteger(this.registerPanel.jGDTRTextField.getText()),
                        jGDTTable.getSelectedRow() + 1),
                null);
        jTabbedPane2.setSelectedIndex(jTabbedPane2.getTabCount() - 1);
    }
}

From source file:com.peterbochs.PeterBochsDebugger.java

private void jPageDirectoryTableMouseClicked(MouseEvent evt) {
    if (evt.getClickCount() == 2) {
        jStatusProgressBar.setValue(0);/*from  w  ww . j  a  va2s. c om*/
        String pageTableAddress = jPageDirectoryTable.getValueAt(jPageDirectoryTable.getSelectedRow(), 1)
                .toString();
        if (!CommonLib.isNumber(pageTableAddress)) {
            return;
        }

        // commandReceiver.setCommandNoOfLine(512);
        sendCommand("xp /4096bx " + pageTableAddress);

        float totalByte2 = 4096 - 1;
        totalByte2 = totalByte2 / 8;
        int totalByte3 = (int) Math.floor(totalByte2);
        String realEndAddressStr;
        String realStartAddressStr;
        String baseAddress = pageTableAddress;
        BigInteger realStartAddress = CommonLib.string2BigInteger(baseAddress);

        realStartAddressStr = String.format("%08x", realStartAddress);
        BigInteger realEndAddress = realStartAddress.add(BigInteger.valueOf(totalByte3 * 8));
        realEndAddressStr = String.format("%08x", realEndAddress);

        String result = commandReceiver.getCommandResult(realStartAddressStr, realEndAddressStr, null);
        String[] lines = result.split("\n");
        PageTableTableModel model = (PageTableTableModel) jPageTableTable.getModel();
        while (model.getRowCount() > 0) {
            model.removeRow(0);
        }
        jStatusProgressBar.setMaximum(lines.length - 1);
        for (int y = 0; y < lines.length; y++) {
            jStatusProgressBar.setValue(y);
            String[] b = lines[y].replaceFirst("^.*:", "").trim().split("\t");

            for (int z = 0; z < 2; z++) {
                try {
                    int bytes[] = new int[4];
                    for (int x = 0; x < 4; x++) {
                        bytes[x] = CommonLib.string2BigInteger(b[x + z * 4].substring(2).trim()).intValue();
                    }
                    long value = CommonLib.getInt(bytes, 0);
                    // "No.", "PT base", "AVL", "G",
                    // "D", "A", "PCD", "PWT",
                    // "U/S", "W/R", "P"

                    String base = "0x" + Long.toHexString(CommonLib.getValue(value, 12, 31) << 12);
                    String avl = String.valueOf((value >> 9) & 3);
                    String g = String.valueOf((value >> 8) & 1);
                    String pat = String.valueOf((value >> 7) & 1);
                    String d = String.valueOf((value >> 6) & 1);
                    String a = String.valueOf((value >> 5) & 1);
                    String pcd = String.valueOf((value >> 4) & 1);
                    String pwt = String.valueOf((value >> 3) & 1);
                    String us = String.valueOf((value >> 2) & 1);
                    String wr = String.valueOf((value >> 1) & 1);
                    String p = String.valueOf((value >> 0) & 1);
                    boolean tempB = model.isShowZeroAddress();
                    model.setShowZeroAddress(true);
                    model.addRow(new String[] { String.valueOf(y * 2 + z), base, avl, g, pat, d, a, pcd, pwt,
                            us, wr, p });
                    model.setShowZeroAddress(tempB);
                } catch (Exception ex) {
                }
            }

            jPageTableTable.setModel(model);
        }
    }
}

From source file:ECallCenter21.java

private void textLogAreaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_textLogAreaMouseClicked
    if (evt.getClickCount() == 2) {
        textLogArea.setText("");
    }/*from  ww w.ja v a  2  s.  c  om*/
}

From source file:ECallCenter21.java

private void toolsInnerPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_toolsInnerPanelMouseClicked
    if (evt.getClickCount() == 2) {
        startJConsole();// www. j a v  a 2 s  . c  om
    }
}