PDF editing software for teachers, focused on productivity. PDF4Teachers keeps recorded previous annotations, and offers features like marking scale, PDF conversion, vectorial drawing...
This PR refactors various parts of the codebase to improve readability and maintainability. Key updates include replacing index-based access with more readable collection methods, simplifying conditional checks, and leveraging streams for concise collection manipulation.
Changes
SliderWithoutPopup.java
Updated conditional checks for special keys using Stream.of.
Document.java
Replaced index-based access with getFirst in getPageNonNull and getLastCursorOverPageObject.
Edition.java and SkillTableElement.java
Utilized Stream.of for counting sections and checking cursor types.
GradeElement.java
Refactored sorting using method references for better readability.
SkillTableGridPane.java and TextElement.java
Improved readability of collection manipulation using getFirst.
PDFPagesEditor.java
Replaced index-based element access with getFirst.
Streamlined PDF page addition with getFirst.
PDFPagesRender.java and PageRenderer.java
Simplified pending render queue handling and page element access with getFirst.
ExportWindow.java
Utilized getFirst for setting initial directory and file name text field.
AutoHideNotificationPane.java
Refactored notification handling to use addFirst and getFirst.
AutoTipsManager.java
Replaced explicit loops with streams for tip handling.
AlternativeWindow.java
Utilized addFirst for button and info box handling.
MainWindow.java
Replaced index-based screen access with getFirst.
BookletEngine.java
Simplified element access with getFirst.
GalleryWindow.java
Updated filter item addition with addFirst.
TR.java
Used Stream.of for settings version code checks.
SettingGroupPane.java
Utilized addFirst for icon container handling.
SplitEngine.java
Replaced index-based access with getFirst.
MainScreen.java
Simplified file handling with getFirst.
SideBar.java
Updated sidebar handling with addFirst.
FileTab.java
Replaced index-based file access with getFirst.
GradeCopyGradeScaleDialog.java
Streamlined grade elements string building with Collectors.joining.
GradeTab.java and GradeTreeItem.java
Improved readability by using getLast and getFirst for tree item access.
GradeTreeView.java
Simplified initial grade item access with getFirst.
GradeExportRenderer.java
Streamlined rows content building with Collectors.joining.
ListPane.java
Utilized addFirst and removeFirst for sort panel handling.
SACocheParser.java and SACocheWriter.java
Replaced explicit loops with streams for skill and student handling.
TextTreeSection.java
Improved readability with addFirst and removeFirst for sort cell handling.
FilesChooserManager.java
Used getFirst for setting path from sync variable.
ErrorAlert.java
Simplified error message check with Stream.of.
KeyCodeCombinaisonInputAlert.java
Refactored key code combination check using Stream.of.
LockMessage.java
Replaced index-based type access with getFirst.
Impact
These changes will improve the maintainability and readability of the codebase without affecting existing functionality. Potential side effects are minimal, as the core logic remains unchanged.
Summary
This PR refactors various parts of the codebase to improve readability and maintainability. Key updates include replacing index-based access with more readable collection methods, simplifying conditional checks, and leveraging streams for concise collection manipulation.
Changes
SliderWithoutPopup.java
Stream.of
.Document.java
getFirst
ingetPageNonNull
andgetLastCursorOverPageObject
.Edition.java and SkillTableElement.java
Stream.of
for counting sections and checking cursor types.GradeElement.java
SkillTableGridPane.java and TextElement.java
getFirst
.PDFPagesEditor.java
getFirst
.getFirst
.PDFPagesRender.java and PageRenderer.java
getFirst
.ExportWindow.java
getFirst
for setting initial directory and file name text field.AutoHideNotificationPane.java
addFirst
andgetFirst
.AutoTipsManager.java
AlternativeWindow.java
addFirst
for button and info box handling.MainWindow.java
getFirst
.BookletEngine.java
getFirst
.GalleryWindow.java
addFirst
.TR.java
Stream.of
for settings version code checks.SettingGroupPane.java
addFirst
for icon container handling.SplitEngine.java
getFirst
.MainScreen.java
getFirst
.SideBar.java
addFirst
.FileTab.java
getFirst
.GradeCopyGradeScaleDialog.java
Collectors.joining
.GradeTab.java and GradeTreeItem.java
getLast
andgetFirst
for tree item access.GradeTreeView.java
getFirst
.GradeExportRenderer.java
Collectors.joining
.ListPane.java
addFirst
andremoveFirst
for sort panel handling.SACocheParser.java and SACocheWriter.java
TextTreeSection.java
addFirst
andremoveFirst
for sort cell handling.FilesChooserManager.java
getFirst
for setting path from sync variable.ErrorAlert.java
Stream.of
.KeyCodeCombinaisonInputAlert.java
Stream.of
.LockMessage.java
getFirst
.Impact
These changes will improve the maintainability and readability of the codebase without affecting existing functionality. Potential side effects are minimal, as the core logic remains unchanged.