/* * (non-Javadoc) * * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent) */ public void mousePressed(MouseEvent e) { int row = charTable.rowAtPoint(e.getPoint()); charTable.setRowSelectionInterval(row, row); parent.setEditingChar(row); if (e.getButton() == MouseEvent.BUTTON3) { popup.show(charTable, e.getX(), e.getY()); } }
public void propertyChange(PropertyChangeEvent e) { // System.out.println(e); int row = charTable.getSelectedRow(); if (row != -1) { int col = charTable.getSelectedColumn(); if (col == 3) { try { int width = Integer.parseInt((String) charTable.getValueAt(row, col)); FontCharacter fc = getSelectedCharacter(); fc.changeSize(0, 0, 0, width - fc.getWidth()); setSelectedCharacter(fc); parent.editingCharSizeChanged(); } catch (NumberFormatException ex) { // ignore } } else if (col == 4) { String comment = (String) charTable.getValueAt(row, col); FontCharacter fc = getSelectedCharacter(); fc.setComment(comment); setSelectedCharacter(fc); } } }
/* * (non-Javadoc) * * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent) */ public void keyReleased(KeyEvent e) { int index = charTable.getSelectedRow(); parent.setEditingChar(index); }