This refactored code addresses the following problems that make it difficult for other programmers to understand the code:
- Poor variable naming, such us: ans.
- Magic Numbers, like: 500 in this line of code: "setSize(500, 500);".
- No needed classes and methods (not used), such as: method saveAsText.
- No needed libraries, such as: "java.awt.BorderLayout".
Also in this refractory code , there are these functions:
- showSaveConfirmDialog()
- savePressed()
- newPressed()
- cutPressed()
- copyPressed()
- pastePressed()
- filePressed()
- quitePressed()
- openPressed()
- selectAllPressed()
All strings are placed in one file called: "Strings.java" you can reach it through:
Code-Refactory/SimpleEditor/src/edu/najah/cap/utils/Strings.java