summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/gui/panels
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cuchaz/enigma/gui/panels')
-rw-r--r--src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java7
-rw-r--r--src/main/java/cuchaz/enigma/gui/panels/PanelIdentifier.java3
2 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java b/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java
index 1a34edf..8296842 100644
--- a/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java
+++ b/src/main/java/cuchaz/enigma/gui/panels/PanelEditor.java
@@ -7,6 +7,7 @@ import cuchaz.enigma.gui.BrowserCaret;
7import cuchaz.enigma.gui.Gui; 7import cuchaz.enigma.gui.Gui;
8import cuchaz.enigma.translation.representation.entry.ClassEntry; 8import cuchaz.enigma.translation.representation.entry.ClassEntry;
9import cuchaz.enigma.translation.representation.entry.Entry; 9import cuchaz.enigma.translation.representation.entry.Entry;
10import cuchaz.enigma.gui.util.ScaleUtil;
10 11
11import javax.swing.*; 12import javax.swing.*;
12import java.awt.*; 13import java.awt.*;
@@ -23,7 +24,7 @@ public class PanelEditor extends JEditorPane {
23 this.setEditable(false); 24 this.setEditable(false);
24 this.setSelectionColor(new Color(31, 46, 90)); 25 this.setSelectionColor(new Color(31, 46, 90));
25 this.setCaret(new BrowserCaret()); 26 this.setCaret(new BrowserCaret());
26 this.setFont(new Font(this.getFont().getFontName(), Font.PLAIN, this.fontSize)); 27 this.setFont(ScaleUtil.getFont(this.getFont().getFontName(), Font.PLAIN, this.fontSize));
27 this.addCaretListener(event -> gui.onCaretMove(event.getDot(), mouseIsPressed)); 28 this.addCaretListener(event -> gui.onCaretMove(event.getDot(), mouseIsPressed));
28 final PanelEditor self = this; 29 final PanelEditor self = this;
29 this.addMouseListener(new MouseAdapter() { 30 this.addMouseListener(new MouseAdapter() {
@@ -154,13 +155,13 @@ public class PanelEditor extends JEditorPane {
154 int newResult = this.fontSize + zoomAmount; 155 int newResult = this.fontSize + zoomAmount;
155 if (newResult > 8 && newResult < 72) { 156 if (newResult > 8 && newResult < 72) {
156 this.fontSize = newResult; 157 this.fontSize = newResult;
157 this.setFont(new Font(this.getFont().getFontName(), Font.PLAIN, this.fontSize)); 158 this.setFont(ScaleUtil.getFont(this.getFont().getFontName(), Font.PLAIN, this.fontSize));
158 } 159 }
159 } 160 }
160 161
161 public void resetEditorZoom() { 162 public void resetEditorZoom() {
162 this.fontSize = 12; 163 this.fontSize = 12;
163 this.setFont(new Font(this.getFont().getFontName(), Font.PLAIN, this.fontSize)); 164 this.setFont(ScaleUtil.getFont(this.getFont().getFontName(), Font.PLAIN, this.fontSize));
164 } 165 }
165 166
166 @Override 167 @Override
diff --git a/src/main/java/cuchaz/enigma/gui/panels/PanelIdentifier.java b/src/main/java/cuchaz/enigma/gui/panels/PanelIdentifier.java
index 0cca40d..de069bc 100644
--- a/src/main/java/cuchaz/enigma/gui/panels/PanelIdentifier.java
+++ b/src/main/java/cuchaz/enigma/gui/panels/PanelIdentifier.java
@@ -2,6 +2,7 @@ package cuchaz.enigma.gui.panels;
2 2
3import cuchaz.enigma.gui.Gui; 3import cuchaz.enigma.gui.Gui;
4import cuchaz.enigma.utils.I18n; 4import cuchaz.enigma.utils.I18n;
5import cuchaz.enigma.gui.util.ScaleUtil;
5import cuchaz.enigma.utils.Utils; 6import cuchaz.enigma.utils.Utils;
6 7
7import javax.swing.*; 8import javax.swing.*;
@@ -15,7 +16,7 @@ public class PanelIdentifier extends JPanel {
15 this.gui = gui; 16 this.gui = gui;
16 17
17 this.setLayout(new GridLayout(4, 1, 0, 0)); 18 this.setLayout(new GridLayout(4, 1, 0, 0));
18 this.setPreferredSize(new Dimension(0, 100)); 19 this.setPreferredSize(ScaleUtil.getDimension(0, 100));
19 this.setBorder(BorderFactory.createTitledBorder(I18n.translate("info_panel.identifier"))); 20 this.setBorder(BorderFactory.createTitledBorder(I18n.translate("info_panel.identifier")));
20 } 21 }
21 22