Removed lombok.

This commit is contained in:
Andrew Lalis 2022-08-01 10:27:01 +02:00
parent 67915ffdf1
commit 0ad1cef2d0
11 changed files with 76 additions and 42 deletions

View File

@ -42,14 +42,6 @@
</build> </build>
<dependencies> <dependencies>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.14</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.1stleg/jnativehook --> <!-- https://mvnrepository.com/artifact/com.1stleg/jnativehook -->
<dependency> <dependency>
<groupId>com.1stleg</groupId> <groupId>com.1stleg</groupId>

View File

@ -1,6 +1,5 @@
package nl.andrewlalis.blockbookbinder.control.export; package nl.andrewlalis.blockbookbinder.control.export;
import lombok.Setter;
import nl.andrewlalis.blockbookbinder.model.Book; import nl.andrewlalis.blockbookbinder.model.Book;
import nl.andrewlalis.blockbookbinder.util.ApplicationProperties; import nl.andrewlalis.blockbookbinder.util.ApplicationProperties;
import nl.andrewlalis.blockbookbinder.view.export.ExportStatusPanel; import nl.andrewlalis.blockbookbinder.view.export.ExportStatusPanel;
@ -33,10 +32,7 @@ public class BookExporter implements Runnable {
private final boolean autoPaste; private final boolean autoPaste;
private final int autoPasteDelay; private final int autoPasteDelay;
@Setter
private volatile boolean running; private volatile boolean running;
@Setter
private volatile boolean nextPageRequested; private volatile boolean nextPageRequested;
private final ExporterKeyListener exporterKeyListener; private final ExporterKeyListener exporterKeyListener;
@ -125,6 +121,22 @@ public class BookExporter implements Runnable {
} }
} }
public boolean isRunning() {
return running;
}
public void setRunning(boolean running) {
this.running = running;
}
public boolean isNextPageRequested() {
return nextPageRequested;
}
public void setNextPageRequested(boolean nextPageRequested) {
this.nextPageRequested = nextPageRequested;
}
/** /**
* Loads the given page onto the system clipboard so either a user or this * Loads the given page onto the system clipboard so either a user or this
* program can paste it into a minecraft book. * program can paste it into a minecraft book.

View File

@ -1,7 +1,5 @@
package nl.andrewlalis.blockbookbinder.control.export; package nl.andrewlalis.blockbookbinder.control.export;
import lombok.Getter;
import lombok.Setter;
import nl.andrewlalis.blockbookbinder.model.Book; import nl.andrewlalis.blockbookbinder.model.Book;
import nl.andrewlalis.blockbookbinder.view.book.BookPreviewPanel; import nl.andrewlalis.blockbookbinder.view.book.BookPreviewPanel;
import nl.andrewlalis.blockbookbinder.view.export.ExportToBookDialog; import nl.andrewlalis.blockbookbinder.view.export.ExportToBookDialog;
@ -10,7 +8,6 @@ import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
public class ExportBookToMinecraftAction extends AbstractAction { public class ExportBookToMinecraftAction extends AbstractAction {
@Getter
private static final ExportBookToMinecraftAction instance = new ExportBookToMinecraftAction(); private static final ExportBookToMinecraftAction instance = new ExportBookToMinecraftAction();
public ExportBookToMinecraftAction() { public ExportBookToMinecraftAction() {
@ -18,7 +15,6 @@ public class ExportBookToMinecraftAction extends AbstractAction {
this.putValue(SHORT_DESCRIPTION, "Export the current book to Minecraft."); this.putValue(SHORT_DESCRIPTION, "Export the current book to Minecraft.");
} }
@Setter
private BookPreviewPanel bookPreviewPanel; private BookPreviewPanel bookPreviewPanel;
@Override @Override
@ -36,4 +32,12 @@ public class ExportBookToMinecraftAction extends AbstractAction {
ExportToBookDialog dialog = new ExportToBookDialog(SwingUtilities.getWindowAncestor(this.bookPreviewPanel), bookPreviewPanel.getBook()); ExportToBookDialog dialog = new ExportToBookDialog(SwingUtilities.getWindowAncestor(this.bookPreviewPanel), bookPreviewPanel.getBook());
dialog.setupAndShow(); dialog.setupAndShow();
} }
public void setBookPreviewPanel(BookPreviewPanel bookPreviewPanel) {
this.bookPreviewPanel = bookPreviewPanel;
}
public static ExportBookToMinecraftAction getInstance() {
return instance;
}
} }

View File

@ -1,17 +1,13 @@
package nl.andrewlalis.blockbookbinder.control.source; package nl.andrewlalis.blockbookbinder.control.source;
import lombok.Getter;
import lombok.Setter;
import nl.andrewlalis.blockbookbinder.view.SourceTextPanel; import nl.andrewlalis.blockbookbinder.view.SourceTextPanel;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
public class CleanSourceAction extends AbstractAction { public class CleanSourceAction extends AbstractAction {
@Getter
private final static CleanSourceAction instance = new CleanSourceAction(); private final static CleanSourceAction instance = new CleanSourceAction();
@Setter
private SourceTextPanel sourceTextPanel; private SourceTextPanel sourceTextPanel;
public CleanSourceAction() { public CleanSourceAction() {
@ -46,4 +42,12 @@ public class CleanSourceAction extends AbstractAction {
} }
return sb.toString(); return sb.toString();
} }
public static CleanSourceAction getInstance() {
return instance;
}
public void setSourceTextPanel(SourceTextPanel sourceTextPanel) {
this.sourceTextPanel = sourceTextPanel;
}
} }

View File

@ -1,7 +1,5 @@
package nl.andrewlalis.blockbookbinder.control.source; package nl.andrewlalis.blockbookbinder.control.source;
import lombok.Getter;
import lombok.Setter;
import nl.andrewlalis.blockbookbinder.model.build.BookBuilder; import nl.andrewlalis.blockbookbinder.model.build.BookBuilder;
import nl.andrewlalis.blockbookbinder.view.SourceTextPanel; import nl.andrewlalis.blockbookbinder.view.SourceTextPanel;
import nl.andrewlalis.blockbookbinder.view.book.BookPreviewPanel; import nl.andrewlalis.blockbookbinder.view.book.BookPreviewPanel;
@ -10,12 +8,9 @@ import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
public class CompileFromSourceAction extends AbstractAction { public class CompileFromSourceAction extends AbstractAction {
@Getter
private static final CompileFromSourceAction instance = new CompileFromSourceAction(); private static final CompileFromSourceAction instance = new CompileFromSourceAction();
@Setter
private SourceTextPanel sourceTextPanel; private SourceTextPanel sourceTextPanel;
@Setter
private BookPreviewPanel bookPreviewPanel; private BookPreviewPanel bookPreviewPanel;
public CompileFromSourceAction() { public CompileFromSourceAction() {
@ -29,4 +24,16 @@ public class CompileFromSourceAction extends AbstractAction {
new BookBuilder().build(this.sourceTextPanel.getSourceText()) new BookBuilder().build(this.sourceTextPanel.getSourceText())
); );
} }
public static CompileFromSourceAction getInstance() {
return instance;
}
public void setSourceTextPanel(SourceTextPanel sourceTextPanel) {
this.sourceTextPanel = sourceTextPanel;
}
public void setBookPreviewPanel(BookPreviewPanel bookPreviewPanel) {
this.bookPreviewPanel = bookPreviewPanel;
}
} }

View File

@ -1,12 +1,9 @@
package nl.andrewlalis.blockbookbinder.control.source; package nl.andrewlalis.blockbookbinder.control.source;
import lombok.Getter;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
public class ImportSourceAction extends AbstractAction { public class ImportSourceAction extends AbstractAction {
@Getter
private static final ImportSourceAction instance = new ImportSourceAction(); private static final ImportSourceAction instance = new ImportSourceAction();
public ImportSourceAction() { public ImportSourceAction() {
@ -18,4 +15,8 @@ public class ImportSourceAction extends AbstractAction {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
} }
public static ImportSourceAction getInstance() {
return instance;
}
} }

View File

@ -1,13 +1,11 @@
package nl.andrewlalis.blockbookbinder.model; package nl.andrewlalis.blockbookbinder.model;
import lombok.Getter;
import nl.andrewlalis.blockbookbinder.util.ApplicationProperties; import nl.andrewlalis.blockbookbinder.util.ApplicationProperties;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class Book { public class Book {
@Getter
private final List<BookPage> pages; private final List<BookPage> pages;
public Book() { public Book() {
@ -18,6 +16,10 @@ public class Book {
return this.pages.size(); return this.pages.size();
} }
public List<BookPage> getPages() {
return pages;
}
public void addPage(BookPage page) { public void addPage(BookPage page) {
this.pages.add(page); this.pages.add(page);
} }

View File

@ -1,15 +1,17 @@
package nl.andrewlalis.blockbookbinder.model; package nl.andrewlalis.blockbookbinder.model;
import lombok.Getter;
import nl.andrewlalis.blockbookbinder.util.ApplicationProperties; import nl.andrewlalis.blockbookbinder.util.ApplicationProperties;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class CharWidthMapper { public class CharWidthMapper {
@Getter
private static final CharWidthMapper instance = new CharWidthMapper(); private static final CharWidthMapper instance = new CharWidthMapper();
public static CharWidthMapper getInstance() {
return instance;
}
private final Map<Character, Integer> charWidthMap; private final Map<Character, Integer> charWidthMap;
public CharWidthMapper() { public CharWidthMapper() {

View File

@ -1,7 +1,5 @@
package nl.andrewlalis.blockbookbinder.util; package nl.andrewlalis.blockbookbinder.util;
import lombok.Getter;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -13,7 +11,6 @@ import java.util.Properties;
*/ */
public class ApplicationProperties { public class ApplicationProperties {
private static ApplicationProperties instance; private static ApplicationProperties instance;
@Getter
private final Properties properties; private final Properties properties;
private final Map<String, Integer> intPropCache; private final Map<String, Integer> intPropCache;
@ -30,6 +27,10 @@ public class ApplicationProperties {
return instance; return instance;
} }
public Properties getProperties() {
return properties;
}
/** /**
* Shortcut for getting a property. * Shortcut for getting a property.
* @param key The property's key. * @param key The property's key.

View File

@ -1,6 +1,5 @@
package nl.andrewlalis.blockbookbinder.view.book; package nl.andrewlalis.blockbookbinder.view.book;
import lombok.Getter;
import nl.andrewlalis.blockbookbinder.model.Book; import nl.andrewlalis.blockbookbinder.model.Book;
import nl.andrewlalis.blockbookbinder.model.BookPage; import nl.andrewlalis.blockbookbinder.model.BookPage;
import nl.andrewlalis.blockbookbinder.util.IconLoader; import nl.andrewlalis.blockbookbinder.util.IconLoader;
@ -15,7 +14,6 @@ import java.io.InputStream;
* A customized panel that's dedicated to showing a book's contents. * A customized panel that's dedicated to showing a book's contents.
*/ */
public class BookPreviewPanel extends JPanel { public class BookPreviewPanel extends JPanel {
@Getter
private Book book; private Book book;
private int currentPage = 0; private int currentPage = 0;
@ -134,6 +132,10 @@ public class BookPreviewPanel extends JPanel {
this.displayCurrentPage(); this.displayCurrentPage();
} }
public Book getBook() {
return book;
}
public void updateCurrentPageModel() { public void updateCurrentPageModel() {
ignoreCurrentPageChange = true; ignoreCurrentPageChange = true;
currentPageNumberModel.setValue(currentPage + 1); currentPageNumberModel.setValue(currentPage + 1);

View File

@ -1,7 +1,5 @@
package nl.andrewlalis.blockbookbinder.view.export; package nl.andrewlalis.blockbookbinder.view.export;
import lombok.Getter;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -10,11 +8,8 @@ import java.awt.*;
* job. * job.
*/ */
public class ExportStatusPanel extends JPanel { public class ExportStatusPanel extends JPanel {
@Getter
private final JLabel statusLabel; private final JLabel statusLabel;
@Getter
private final JTextArea outputTextArea; private final JTextArea outputTextArea;
@Getter
private final JProgressBar exportProgressBar; private final JProgressBar exportProgressBar;
public ExportStatusPanel() { public ExportStatusPanel() {
@ -35,4 +30,16 @@ public class ExportStatusPanel extends JPanel {
this.exportProgressBar = new JProgressBar(); this.exportProgressBar = new JProgressBar();
this.add(this.exportProgressBar, BorderLayout.SOUTH); this.add(this.exportProgressBar, BorderLayout.SOUTH);
} }
public JLabel getStatusLabel() {
return statusLabel;
}
public JTextArea getOutputTextArea() {
return outputTextArea;
}
public JProgressBar getExportProgressBar() {
return exportProgressBar;
}
} }