Example usage for java.awt.event KeyEvent VK_ENTER

List of usage examples for java.awt.event KeyEvent VK_ENTER

Introduction

In this page you can find the example usage for java.awt.event KeyEvent VK_ENTER.

Prototype

int VK_ENTER

To view the source code for java.awt.event KeyEvent VK_ENTER.

Click Source Link

Document

Constant for the ENTER virtual key.

Usage

From source file:com.hexidec.ekit.EkitCore.java

public void keyReleased(KeyEvent ke) {

    // log.debug("> keyReleased");

    if (ke.getKeyChar() == KeyEvent.VK_ENTER && (enterIsBreak || inlineEdit)) {
        ke.consume();//from  ww w .j a va  2  s . com
    }

    // Verifica se est em tabela
    if (DocumentUtil.getElementByTag(htmlDoc, jtpMain.getCaretPosition(), Tag.TD) != null) {
        refreshOnUpdate();
    }

    // log.debug("< keyReleased");
}

From source file:CSSDFarm.UserInterface.java

private void jButton1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jButton1KeyPressed
    if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
        System.out.println("Hello");
    }//  w  ww . jav a2  s .  c  o m
    logIn();
}

From source file:osu.beatmapdownloader.JFrame.java

private void T_PassKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_T_PassKeyPressed
       if (evt.getKeyCode() == KeyEvent.VK_ENTER)
           login();/*from   w w w . j a  v  a  2s  . c  om*/
   }

From source file:osu.beatmapdownloader.JFrame.java

private void T_UserKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_T_UserKeyPressed
       if (evt.getKeyCode() == KeyEvent.VK_ENTER)
           login();//from w w w. j  a va  2s.  c  om
   }

From source file:pt.ua.dicoogle.rGUI.client.windows.MainWindow.java

private void jTextFieldQueryKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldQueryKeyPressed

    if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
        search();/*from w  w w  . j  a v a 2 s.com*/
    }

}

From source file:org.signserver.admin.gui.MainView.java

private void auditLogTableKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_auditLogTableKeyReleased
    if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
        displayLogEntryAction();/*from   w ww.j  a  v a 2  s.com*/
    }
}

From source file:edu.ku.brc.specify.tasks.subpane.wb.wbuploader.Uploader.java

public void keyPressed(KeyEvent e) {
    logDebug("keyPressed");
    int key = e.getKeyCode();
    if (key == KeyEvent.VK_ENTER || key == KeyEvent.VK_TAB || key == KeyEvent.VK_DOWN || key == KeyEvent.VK_UP
            || (key == KeyEvent.VK_TAB && e.isShiftDown()) || key == KeyEvent.VK_HOME
            || key == KeyEvent.VK_END) {
        editInvalidCell(e);// w w w  .  j av a2s.  co m
        e.consume();
    }
}

From source file:edu.ku.brc.specify.tasks.subpane.wb.wbuploader.Uploader.java

/**
 * @param e/*w  ww.ja v a2s . c  om*/
 * 
 * Moves to WB cell for appropriate InvalidValue and starts editing it.
 */
protected void editInvalidCell(KeyEvent e) {
    logDebug("editing invalid cell");
    int key = e.getKeyCode();
    if (key == KeyEvent.VK_ENTER || key == KeyEvent.VK_TAB || key == KeyEvent.VK_DOWN)
        goToNextInvalidCell();
    else if (key == KeyEvent.VK_UP || (key == KeyEvent.VK_TAB && e.isShiftDown()))
        goToPrevInvalidCell();
    else if (key == KeyEvent.VK_HOME)
        goToFirstInvalidCell();
    else if (key == KeyEvent.VK_END)
        goToLastInvalidCell();
}

From source file:app.RunApp.java

/**
 * Action when key pressed on textChoose
 * //from   ww  w.  j  a va  2 s  .  c  o  m
 * @param evt Event
 */
private void textChooseFileKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_textChooseFileKeyPressed
    if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
        String arffFilename = textChooseFile.getText();
        xmlFilename = DataIOUtils.getXMLString(arffFilename);
        xmlFilename = DataIOUtils.getFilePath(xmlFilename);
        loadDataset(arffFilename, xmlFilename);
    }
}

From source file:src.gui.ItSIMPLE.java

/**
 * This method initializes tree/*  w w w.ja v  a  2s. c  om*/
 *
 * @return javax.swing.JTree
 */
private ItTree getProjectsTree() {
    if (projectsTree == null) {
        treeRoot = new ItTreeNode("itSIMPLE Projects");
        treeRoot.setIcon(new ImageIcon("resources/images/projects.png"));
        projectsTree = new ItTree(treeRoot);
        projectsTree.setCellRenderer(new ItTreeCellRenderer());
        projectsTree.setShowsRootHandles(true);
        projectsTree.setVisible(true);
        projectsTree.setEditable(false);
        projectsTree.add(getTreePopupMenu());
        projectsTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
            public void valueChanged(javax.swing.event.TreeSelectionEvent e) {
                ItTreeNode selectedNode = (ItTreeNode) projectsTree.getLastSelectedPathComponent();
                if (treeRoot.getChildCount() == 1) {
                    saveMenuItem.setEnabled(true);
                    saveAsMenuItem.setEnabled(true);
                } else {
                    saveMenuItem.setEnabled(false);
                    saveAsMenuItem.setEnabled(false);
                }

                if (selectedNode != null) {
                    if (selectedNode != treeRoot) {
                        saveMenuItem.setEnabled(true);
                        saveAsMenuItem.setEnabled(true);
                        Element selected = selectedNode.getData();
                        if (selected.getName().equals("repositoryDiagram")) {
                            setDiagramRespository(selected);
                            setTypeDiagram(0);
                        }
                        if (selected.getName().equals("objectDiagram")) {
                            setObjectDiagram(selected);
                            setTypeDiagram(1);
                        }

                        if (selected != null) {
                            propertiesPane.showProperties(selectedNode, projectsTree);
                        } else {
                            propertiesPane.setNoSelection();
                        }
                    } else {
                        propertiesPane.setNoSelection();
                    }

                }

            }
        });
        projectsTree.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent e) {
                if (e.getClickCount() == 2) {
                    TreePath path = projectsTree.getPathForLocation(e.getX(), e.getY());
                    if (path != null && projectsTree.getLastSelectedPathComponent() != projectsTree.getModel()
                            .getRoot()) {
                        ItTreeNode selectedNode = (ItTreeNode) projectsTree.getLastSelectedPathComponent();
                        String projectType = selectedNode.getData().getDocument().getRootElement().getName();

                        //check if this is a UML project
                        if (projectType.equals("project")) {
                            //Diagrams
                            if (selectedNode.getLevel() == 2) {
                                if (!selectedNode.getData().getName().equals("problem")
                                        && !selectedNode.getData().getName().equals("domain")) {
                                    openDiagramAction.actionPerformed(null);
                                }
                            }
                            //Planning Problems
                            else if (selectedNode.getData().getName().equals("objectDiagram")
                                    || selectedNode.getData().getName().equals("repositoryDiagram")) {
                                openDiagramAction.actionPerformed(null);
                            }
                        }
                        //check if this is a PDDL project
                        else if (projectType.equals("pddlproject")) {
                            //open pddl text for edit

                        }

                    }
                }
            }

            public void mouseReleased(java.awt.event.MouseEvent e) {// this is for Windows
                if (e.isPopupTrigger()) {
                    TreePath path = projectsTree.getPathForLocation(e.getX(), e.getY());
                    if (path != null) {
                        projectsTree.setSelectionPath(path);
                        getTreePopupMenu().show(projectsTree, e.getX(), e.getY());
                    }
                }
            }

            public void mousePressed(java.awt.event.MouseEvent e) {// this is for Linux
                if (e.isPopupTrigger()) {
                    TreePath path = projectsTree.getPathForLocation(e.getX(), e.getY());
                    if (path != null) {
                        projectsTree.setSelectionPath(path);
                        getTreePopupMenu().show(projectsTree, e.getX(), e.getY());
                    }
                }
            }
        });
        projectsTree.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent e) {
                if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                    if (projectsTree.getLastSelectedPathComponent() != projectsTree.getModel().getRoot()) {
                        ItTreeNode selectedNode = (ItTreeNode) projectsTree.getLastSelectedPathComponent();

                        if ((selectedNode.getLevel() == 2 && !selectedNode.getData().getName().equals("domain"))
                                || selectedNode.getData().getName().equals("repositoryDiagram")
                                || selectedNode.getData().getName().equals("objectDiagram")) {
                            openDiagramAction.actionPerformed(null);
                        }
                    }
                }
            }
        });
        projectsTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    }
    return projectsTree;
}