Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
KatatsumuriPan committed Feb 19, 2024
1 parent f963503 commit 6d0e1fb
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
Expand Down Expand Up @@ -193,10 +194,10 @@ private UndoHelper(JTextComponent textComponent) {
class UndoAction extends AbstractAction {
UndoAction() {
super("Undo(U)");
putValue(MNEMONIC_KEY, new Integer('U'));
putValue(MNEMONIC_KEY, (int)'U');
putValue(SHORT_DESCRIPTION, "Undo");
putValue(LONG_DESCRIPTION, "Undo");
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('Z', Event.CTRL_MASK));
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('Z', InputEvent.CTRL_DOWN_MASK));
}
public void actionPerformed(ActionEvent e) {
if (undoManager.canUndo()) {
Expand All @@ -208,10 +209,10 @@ public void actionPerformed(ActionEvent e) {
class RedoAction extends AbstractAction {
RedoAction() {
super("Redo(R)");
putValue(MNEMONIC_KEY, new Integer('R'));
putValue(MNEMONIC_KEY, (int) 'R');
putValue(SHORT_DESCRIPTION, "Redo");
putValue(LONG_DESCRIPTION, "Redo");
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('Y', Event.CTRL_MASK));
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke('Y', InputEvent.CTRL_DOWN_MASK));
}
public void actionPerformed(ActionEvent e) {
if (undoManager.canRedo()) {
Expand Down

0 comments on commit 6d0e1fb

Please sign in to comment.