use of java.awt.event.KeyListener in project com.revolsys.open by revolsys.
the class MouseOverlay method keyTyped.
@Override
public void keyTyped(final KeyEvent e) {
for (final Component overlay : getOverlays()) {
if (overlay instanceof KeyListener) {
final KeyListener listener = (KeyListener) overlay;
listener.keyTyped(e);
if (e.isConsumed()) {
return;
}
}
}
}
use of java.awt.event.KeyListener in project SeqMonk by s-andrews.
the class SmoothingQuantitation method getOptionsPanel.
/* (non-Javadoc)
* @see uk.ac.babraham.SeqMonk.Quantitation.Quantitation#getOptionsPanel(uk.ac.babraham.SeqMonk.SeqMonkApplication)
*/
public JPanel getOptionsPanel() {
if (optionPanel != null) {
// We've done this already
return optionPanel;
}
optionPanel = new JPanel();
optionPanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 1;
gbc.weightx = 0.5;
gbc.weighty = 0.1;
gbc.fill = GridBagConstraints.HORIZONTAL;
optionPanel.add(new JLabel("Smoothing method"), gbc);
gbc.gridx = 2;
correctionActions = new JComboBox(new String[] { "Adjacent Probes", "Window Size" });
optionPanel.add(correctionActions, gbc);
gbc.gridx = 1;
gbc.gridy++;
optionPanel.add(new JLabel("Size"), gbc);
distanceField = new JTextField("" + distance);
distanceField.addKeyListener(new NumberKeyListener(false, false));
distanceField.addKeyListener(new KeyListener() {
public void keyTyped(KeyEvent arg0) {
}
public void keyReleased(KeyEvent arg0) {
optionsChanged();
}
public void keyPressed(KeyEvent arg0) {
}
});
gbc.gridx++;
optionPanel.add(distanceField, gbc);
return optionPanel;
}
use of java.awt.event.KeyListener in project JFramework by gugumall.
the class BeanGen method init.
/**
*/
private void init() {
this.gui.connect.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
connect();
}
});
this.gui.choose.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
choosePath();
}
});
this.gui.gen.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
gen();
}
});
this.gui.showTables.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
showTable();
}
});
this.gui.db.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {
}
public void keyReleased(KeyEvent e) {
if (gui.dbms.getSelectedIndex() == 0) {
return;
}
String dbms = gui.dbms.getSelectedItem().toString();
String url = BeanGen.DBMS_URL_PATTERN.get(dbms).toString();
url = url.replaceAll("HOST", gui.host.getText().trim());
url = url.replaceAll("DATABASE", gui.db.getText().trim());
gui.info.setText(url);
}
public void keyTyped(KeyEvent e) {
}
});
this.gui.host.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {
}
public void keyReleased(KeyEvent e) {
if (gui.dbms.getSelectedIndex() == 0) {
return;
}
String dbms = gui.dbms.getSelectedItem().toString();
String url = BeanGen.DBMS_URL_PATTERN.get(dbms).toString();
url = url.replaceAll("HOST", gui.host.getText().trim());
url = url.replaceAll("DATABASE", gui.db.getText().trim());
gui.info.setText(url);
}
public void keyTyped(KeyEvent e) {
}
});
}
use of java.awt.event.KeyListener in project abstools by abstools.
the class TextArea method undo.
/**
* Undoes the last action, if any has been performed.
*/
public void undo() {
try {
if (undoManager.canUndo()) {
undoManager.undo();
for (KeyListener kl : getKeyListeners()) {
kl.keyTyped(null);
kl.keyReleased(null);
}
}
} catch (CannotUndoException e) {
}
}
use of java.awt.event.KeyListener in project abstools by abstools.
the class TextArea method redo.
/**
* Redoes the last action, if any has been performed.
*/
public void redo() {
try {
if (undoManager.canRedo()) {
undoManager.redo();
for (KeyListener kl : getKeyListeners()) {
kl.keyTyped(null);
kl.keyReleased(null);
}
}
} catch (CannotRedoException e) {
}
}
Aggregations