diff options
3 files changed, 41 insertions, 38 deletions
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java index 2d0c30b..323d304 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java | |||
| @@ -894,6 +894,7 @@ public class Gui implements LanguageChangeListener { | |||
| 894 | this.obfPanel.retranslateUi(); | 894 | this.obfPanel.retranslateUi(); |
| 895 | this.deobfPanel.retranslateUi(); | 895 | this.deobfPanel.retranslateUi(); |
| 896 | this.infoPanel.retranslateUi(); | 896 | this.infoPanel.retranslateUi(); |
| 897 | this.editors.values().forEach(EditorPanel::retranslateUi); | ||
| 897 | } | 898 | } |
| 898 | 899 | ||
| 899 | public void setConnectionState(ConnectionState state) { | 900 | public void setConnectionState(ConnectionState state) { |
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/elements/EditorPopupMenu.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/elements/EditorPopupMenu.java index 86d920e..ed3a32f 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/elements/EditorPopupMenu.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/elements/EditorPopupMenu.java | |||
| @@ -21,19 +21,19 @@ public class EditorPopupMenu { | |||
| 21 | 21 | ||
| 22 | private final JPopupMenu ui = new JPopupMenu(); | 22 | private final JPopupMenu ui = new JPopupMenu(); |
| 23 | 23 | ||
| 24 | private final JMenuItem renameItem = new JMenuItem(I18n.translate("popup_menu.rename")); | 24 | private final JMenuItem renameItem = new JMenuItem(); |
| 25 | private final JMenuItem editJavadocItem = new JMenuItem(I18n.translate("popup_menu.javadoc")); | 25 | private final JMenuItem editJavadocItem = new JMenuItem(); |
| 26 | private final JMenuItem showInheritanceItem = new JMenuItem(I18n.translate("popup_menu.inheritance")); | 26 | private final JMenuItem showInheritanceItem = new JMenuItem(); |
| 27 | private final JMenuItem showImplementationsItem = new JMenuItem(I18n.translate("popup_menu.implementations")); | 27 | private final JMenuItem showImplementationsItem = new JMenuItem(); |
| 28 | private final JMenuItem showCallsItem = new JMenuItem(I18n.translate("popup_menu.calls")); | 28 | private final JMenuItem showCallsItem = new JMenuItem(); |
| 29 | private final JMenuItem showCallsSpecificItem = new JMenuItem(I18n.translate("popup_menu.calls.specific")); | 29 | private final JMenuItem showCallsSpecificItem = new JMenuItem(); |
| 30 | private final JMenuItem openEntryItem = new JMenuItem(I18n.translate("popup_menu.declaration")); | 30 | private final JMenuItem openEntryItem = new JMenuItem(); |
| 31 | private final JMenuItem openPreviousItem = new JMenuItem(I18n.translate("popup_menu.back")); | 31 | private final JMenuItem openPreviousItem = new JMenuItem(); |
| 32 | private final JMenuItem openNextItem = new JMenuItem(I18n.translate("popup_menu.forward")); | 32 | private final JMenuItem openNextItem = new JMenuItem(); |
| 33 | private final JMenuItem toggleMappingItem = new JMenuItem(I18n.translate("popup_menu.mark_deobfuscated")); | 33 | private final JMenuItem toggleMappingItem = new JMenuItem(); |
| 34 | private final JMenuItem zoomInItem = new JMenuItem(I18n.translate("popup_menu.zoom.in")); | 34 | private final JMenuItem zoomInItem = new JMenuItem(); |
| 35 | private final JMenuItem zoomOutMenu = new JMenuItem(I18n.translate("popup_menu.zoom.out")); | 35 | private final JMenuItem zoomOutMenu = new JMenuItem(); |
| 36 | private final JMenuItem resetZoomItem = new JMenuItem(I18n.translate("popup_menu.zoom.reset")); | 36 | private final JMenuItem resetZoomItem = new JMenuItem(); |
| 37 | 37 | ||
| 38 | private final EditorPanel editor; | 38 | private final EditorPanel editor; |
| 39 | private final Gui gui; | 39 | private final Gui gui; |
| @@ -42,6 +42,8 @@ public class EditorPopupMenu { | |||
| 42 | this.editor = editor; | 42 | this.editor = editor; |
| 43 | this.gui = gui; | 43 | this.gui = gui; |
| 44 | 44 | ||
| 45 | this.retranslateUi(); | ||
| 46 | |||
| 45 | this.ui.add(this.renameItem); | 47 | this.ui.add(this.renameItem); |
| 46 | this.ui.add(this.editJavadocItem); | 48 | this.ui.add(this.editJavadocItem); |
| 47 | this.ui.add(this.showInheritanceItem); | 49 | this.ui.add(this.showInheritanceItem); |
| @@ -167,6 +169,22 @@ public class EditorPopupMenu { | |||
| 167 | } | 169 | } |
| 168 | } | 170 | } |
| 169 | 171 | ||
| 172 | public void retranslateUi() { | ||
| 173 | this.renameItem.setText(I18n.translate("popup_menu.rename")); | ||
| 174 | this.editJavadocItem.setText(I18n.translate("popup_menu.javadoc")); | ||
| 175 | this.showInheritanceItem.setText(I18n.translate("popup_menu.inheritance")); | ||
| 176 | this.showImplementationsItem.setText(I18n.translate("popup_menu.implementations")); | ||
| 177 | this.showCallsItem.setText(I18n.translate("popup_menu.calls")); | ||
| 178 | this.showCallsSpecificItem.setText(I18n.translate("popup_menu.calls.specific")); | ||
| 179 | this.openEntryItem.setText(I18n.translate("popup_menu.declaration")); | ||
| 180 | this.openPreviousItem.setText(I18n.translate("popup_menu.back")); | ||
| 181 | this.openNextItem.setText(I18n.translate("popup_menu.forward")); | ||
| 182 | this.toggleMappingItem.setText(I18n.translate("popup_menu.mark_deobfuscated")); | ||
| 183 | this.zoomInItem.setText(I18n.translate("popup_menu.zoom.in")); | ||
| 184 | this.zoomOutMenu.setText(I18n.translate("popup_menu.zoom.out")); | ||
| 185 | this.resetZoomItem.setText(I18n.translate("popup_menu.zoom.reset")); | ||
| 186 | } | ||
| 187 | |||
| 170 | public JPopupMenu getUi() { | 188 | public JPopupMenu getUi() { |
| 171 | return ui; | 189 | return ui; |
| 172 | } | 190 | } |
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java index bd1fae0..f324567 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java | |||
| @@ -1,40 +1,21 @@ | |||
| 1 | package cuchaz.enigma.gui.panels; | 1 | package cuchaz.enigma.gui.panels; |
| 2 | 2 | ||
| 3 | import java.awt.Color; | 3 | import java.awt.*; |
| 4 | import java.awt.Component; | 4 | import java.awt.event.*; |
| 5 | import java.awt.Font; | ||
| 6 | import java.awt.GridBagConstraints; | ||
| 7 | import java.awt.GridBagLayout; | ||
| 8 | import java.awt.GridLayout; | ||
| 9 | import java.awt.Rectangle; | ||
| 10 | import java.awt.event.ActionEvent; | ||
| 11 | import java.awt.event.ActionListener; | ||
| 12 | import java.awt.event.KeyAdapter; | ||
| 13 | import java.awt.event.KeyEvent; | ||
| 14 | import java.awt.event.MouseAdapter; | ||
| 15 | import java.awt.event.MouseEvent; | ||
| 16 | import java.util.ArrayList; | 5 | import java.util.ArrayList; |
| 17 | import java.util.Collection; | 6 | import java.util.Collection; |
| 18 | import java.util.List; | 7 | import java.util.List; |
| 19 | import java.util.Map; | 8 | import java.util.Map; |
| 20 | 9 | ||
| 21 | import javax.annotation.Nullable; | 10 | import javax.annotation.Nullable; |
| 22 | import javax.swing.JButton; | 11 | import javax.swing.*; |
| 23 | import javax.swing.JComponent; | ||
| 24 | import javax.swing.JEditorPane; | ||
| 25 | import javax.swing.JLabel; | ||
| 26 | import javax.swing.JPanel; | ||
| 27 | import javax.swing.JProgressBar; | ||
| 28 | import javax.swing.JScrollPane; | ||
| 29 | import javax.swing.JSeparator; | ||
| 30 | import javax.swing.JTextArea; | ||
| 31 | import javax.swing.SwingUtilities; | ||
| 32 | import javax.swing.Timer; | ||
| 33 | import javax.swing.text.BadLocationException; | 12 | import javax.swing.text.BadLocationException; |
| 34 | import javax.swing.text.Document; | 13 | import javax.swing.text.Document; |
| 35 | import javax.swing.text.Highlighter; | 14 | import javax.swing.text.Highlighter; |
| 36 | import javax.swing.text.Highlighter.HighlightPainter; | 15 | import javax.swing.text.Highlighter.HighlightPainter; |
| 37 | 16 | ||
| 17 | import de.sciss.syntaxpane.DefaultSyntaxKit; | ||
| 18 | |||
| 38 | import cuchaz.enigma.EnigmaProject; | 19 | import cuchaz.enigma.EnigmaProject; |
| 39 | import cuchaz.enigma.analysis.EntryReference; | 20 | import cuchaz.enigma.analysis.EntryReference; |
| 40 | import cuchaz.enigma.classhandle.ClassHandle; | 21 | import cuchaz.enigma.classhandle.ClassHandle; |
| @@ -63,7 +44,6 @@ import cuchaz.enigma.translation.representation.entry.ClassEntry; | |||
| 63 | import cuchaz.enigma.translation.representation.entry.Entry; | 44 | import cuchaz.enigma.translation.representation.entry.Entry; |
| 64 | import cuchaz.enigma.utils.I18n; | 45 | import cuchaz.enigma.utils.I18n; |
| 65 | import cuchaz.enigma.utils.Result; | 46 | import cuchaz.enigma.utils.Result; |
| 66 | import de.sciss.syntaxpane.DefaultSyntaxKit; | ||
| 67 | 47 | ||
| 68 | public class EditorPanel { | 48 | public class EditorPanel { |
| 69 | 49 | ||
| @@ -624,6 +604,10 @@ public class EditorPanel { | |||
| 624 | return classEntry.getSimpleName(); | 604 | return classEntry.getSimpleName(); |
| 625 | } | 605 | } |
| 626 | 606 | ||
| 607 | public void retranslateUi() { | ||
| 608 | this.popupMenu.retranslateUi(); | ||
| 609 | } | ||
| 610 | |||
| 627 | private enum DisplayMode { | 611 | private enum DisplayMode { |
| 628 | INACTIVE, | 612 | INACTIVE, |
| 629 | IN_PROGRESS, | 613 | IN_PROGRESS, |