From 812f4ea3cd9d8843637480ca89b09bcac0194145 Mon Sep 17 00:00:00 2001 From: Konloch Date: Mon, 28 Jun 2021 18:25:24 -0700 Subject: [PATCH] Code Cleanup --- .../gui/util/PaneUpdaterThread.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/PaneUpdaterThread.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/PaneUpdaterThread.java index 4e995478..bbdc9d2f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/PaneUpdaterThread.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/util/PaneUpdaterThread.java @@ -42,6 +42,7 @@ import static the.bytecode.club.bytecodeviewer.gui.resourceviewer.TabbedPane.BLA * Allows us to run a background thread * * @author Konloch + * @author WaterWolf * @author DreamSworK */ public abstract class PaneUpdaterThread implements Runnable @@ -83,22 +84,25 @@ public abstract class PaneUpdaterThread implements Runnable attachCtrlMouseWheelZoom(updateUpdaterTextArea.getScrollPane(), updateUpdaterTextArea)); } - public void attachCtrlMouseWheelZoom(RTextScrollPane scrollPane, RSyntaxTextArea panelArea) { + public void attachCtrlMouseWheelZoom(RTextScrollPane scrollPane, RSyntaxTextArea panelArea) + { if (scrollPane == null) return; - - scrollPane.addMouseWheelListener(e -> { + + scrollPane.addMouseWheelListener(e -> + { if (panelArea == null || panelArea.getText().isEmpty()) return; - if ((e.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0) { + if ((e.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0) + { Font font = panelArea.getFont(); int size = font.getSize(); - if (e.getWheelRotation() > 0) { //Up + + if (e.getWheelRotation() > 0) //Up panelArea.setFont(new Font(font.getName(), font.getStyle(), --size >= 2 ? --size : 2)); - } else { //Down + else //Down panelArea.setFont(new Font(font.getName(), font.getStyle(), ++size)); - } } e.consume(); });