From 9c6a862e4337919dfc5abb76275ac7f0513e040a Mon Sep 17 00:00:00 2001 From: hzzz Date: Fri, 26 May 2017 09:37:07 +0800 Subject: [PATCH] PMD --- designer/src/com/fr/grid/GridKeyListener.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/designer/src/com/fr/grid/GridKeyListener.java b/designer/src/com/fr/grid/GridKeyListener.java index a7d6eb354..8e3148bf5 100644 --- a/designer/src/com/fr/grid/GridKeyListener.java +++ b/designer/src/com/fr/grid/GridKeyListener.java @@ -16,7 +16,7 @@ import java.awt.event.KeyListener; * @since 2012-3-23上午10:55:36 */ public class GridKeyListener implements KeyListener { - + private static final int DIFF = 48; // 103 - 55 = 48, 小键盘和大键盘数字的差值 48 private Grid grid; // Keypressed last time private long keyPressedLastTime = 0; @@ -189,8 +189,7 @@ public class GridKeyListener implements KeyListener { if (grid.getCellEditor() != null && grid.editorComponent != null) { if (IS_NUM_PAD_KEY(code)) { - // 103 - 55 = 48, 小键盘和大键盘数字的差值 48 - KeyEvent ke = new KeyEvent(grid, KeyEvent.KEY_PRESSED, 0, 0, code - 48, ch); + KeyEvent ke = new KeyEvent(grid, KeyEvent.KEY_PRESSED, 0, 0, code - DIFF, ch); grid.editorComponent.dispatchEvent(ke); ke.consume(); } else {