Added Font Size Changing

Added Font Size Changing
This commit is contained in:
Konloch 2015-07-03 00:21:23 -06:00
parent dcea0a04bc
commit e5b507656c
5 changed files with 76 additions and 14 deletions

View file

@ -94,14 +94,8 @@ import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
*
* Search open doesnt append .class
*
* -----2.9.6-----:
* 05/05/2015 - Fixed a typo in the about window
* 05/28/2015 - Started importing JD-GUI Decompiler.
* 05/28/2015 - Compile on refresh and compile on save are now enabled by default.
* 05/28/2015 - Renamed the File>Save As options to be much more informative.
* 06/24/2015 - Fixed a logic error with the Field & Method searchers.
* 06/26/2015 - Updated Procyon & CFR to their latest versions.
* 07/02/2015 - Added JD-GUI Decompiler. - Huge thanks to the guys behind JD-GUI! <3
* -----2.9.7-----:
* 07/02/2015 - Added ajustable font size.
*
* @author Konloch
*
@ -110,7 +104,7 @@ import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
public class BytecodeViewer {
/*per version*/
public static String version = "2.9.6";
public static String version = "2.9.7";
public static String krakatauVersion = "2";
/*the rest*/
public static MainViewerGUI viewer = null;

View file

@ -188,6 +188,7 @@ public class Settings {
DiskWriter.writeNewLine(BytecodeViewer.settingsName, String.valueOf(BytecodeViewer.viewer.panel1JDGUI_E.isSelected()), false);
DiskWriter.writeNewLine(BytecodeViewer.settingsName, String.valueOf(BytecodeViewer.viewer.panel2JDGUI_E.isSelected()), false);
DiskWriter.writeNewLine(BytecodeViewer.settingsName, String.valueOf(BytecodeViewer.viewer.panel3JDGUI_E.isSelected()), false);
DiskWriter.writeNewLine(BytecodeViewer.settingsName, String.valueOf(BytecodeViewer.viewer.fontSpinner.getValue()), false);
} catch(Exception e) {
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
}
@ -374,6 +375,7 @@ public class Settings {
BytecodeViewer.viewer.panel1JDGUI_E.setSelected(Boolean.parseBoolean(DiskReader.loadString(BytecodeViewer.settingsName, 109, false)));
BytecodeViewer.viewer.panel2JDGUI_E.setSelected(Boolean.parseBoolean(DiskReader.loadString(BytecodeViewer.settingsName, 110, false)));
BytecodeViewer.viewer.panel3JDGUI_E.setSelected(Boolean.parseBoolean(DiskReader.loadString(BytecodeViewer.settingsName, 111, false)));
BytecodeViewer.viewer.fontSpinner.setValue(Integer.parseInt(DiskReader.loadString(BytecodeViewer.settingsName, 112, false)));
} catch(Exception e) {
//ignore because errors are expected, first start up and outdated settings.
//e.printStackTrace();

View file

@ -3,6 +3,7 @@ package the.bytecode.club.bytecodeviewer.gui;
import javax.swing.JFrame;
import java.awt.CardLayout;
import java.awt.Font;
import java.awt.Toolkit;
import javax.swing.JTextArea;
@ -38,6 +39,7 @@ public class AboutWindow extends JFrame {
@Override
public void setVisible(boolean b) {
super.setVisible(b);
txtrBytecodeViewerIs.setFont(new Font(Font.MONOSPACED, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
txtrBytecodeViewerIs
.setText("Bytecode Viewer "+BytecodeViewer.version+" is an open source program developed and maintained by Konloch (konloch@gmail.com)\r\n"+
"100% free and open sourced licensed under GPL v3 CopyLeft\r\n\r\n"+

View file

@ -4,6 +4,7 @@ import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
@ -625,6 +626,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel1.add(scrollPane);
panelArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java1 = panelArea;
}
@ -649,6 +652,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel1.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java1 = panelArea;
}
@ -674,6 +679,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel1.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java1 = panelArea;
}
@ -700,6 +707,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel1.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane1 == 5) {// hex
@ -707,6 +716,7 @@ public class ClassViewer extends Viewer {
cn.accept(cw);
JHexEditor hex = new JHexEditor(cw.toByteArray());
panel1.add(hex);
hex.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane1 == 6) {// bytecode
@ -733,6 +743,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel1.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane1 == 7) {// krakatau
@ -758,6 +770,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel1.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java1 = panelArea;
}
@ -787,6 +801,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel1.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane1 == 9) {// JD-GUI
@ -812,6 +828,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel1.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java1 = panelArea;
}
} catch(Exception e) {
@ -852,6 +870,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel2.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java2 = panelArea;
}
@ -877,6 +897,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel2.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java2 = panelArea;
}
@ -902,6 +924,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel2.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java2 = panelArea;
}
@ -926,6 +950,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel2.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane2 == 5) {
@ -933,6 +959,8 @@ public class ClassViewer extends Viewer {
cn.accept(cw);
JHexEditor hex = new JHexEditor(cw.toByteArray());
panel2.add(hex);
hex.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane2 == 6) {
@ -957,6 +985,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel2.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane2 == 7) {// krakatau
@ -982,6 +1012,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel2.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java2 = panelArea;
}
@ -1009,6 +1041,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel2.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane2 == 9) {// JD-GUI
@ -1034,6 +1068,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel2.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java2 = panelArea;
}
} catch(Exception e) {
@ -1075,6 +1111,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel3.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java3 = panelArea;
}
@ -1100,6 +1138,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel3.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java3 = panelArea;
}
@ -1125,6 +1165,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel3.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
java3 = panelArea;
}
@ -1149,6 +1191,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel3.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane3 == 5) {
@ -1156,6 +1200,8 @@ public class ClassViewer extends Viewer {
cn.accept(cw);
JHexEditor hex = new JHexEditor(cw.toByteArray());
panel3.add(hex);
hex.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane3 == 6) {
@ -1180,6 +1226,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel3.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane3 == 7) {// krakatau
@ -1206,6 +1254,8 @@ public class ClassViewer extends Viewer {
});
panel3.add(scrollPane);
java3 = panelArea;
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane3 == 8) {// kraktau bytecode
@ -1232,6 +1282,8 @@ public class ClassViewer extends Viewer {
@Override public void keyTyped(KeyEvent arg0) { }
});
panel3.add(scrollPane);
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
if (pane3 == 9) {// JD-GUI
@ -1258,6 +1310,8 @@ public class ClassViewer extends Viewer {
});
panel3.add(scrollPane);
java3 = panelArea;
panelArea.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, (int)BytecodeViewer.viewer.fontSpinner.getValue()));
}
} catch(Exception e) {
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);

View file

@ -49,6 +49,8 @@ import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ShowAllStrings;
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ShowMainMethods;
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ZKMStringDecrypter;
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ZStringArrayDecrypter;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
/**
* The main file for the GUI.n
@ -149,7 +151,6 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
public final JMenuItem mntmNewMenuItem = new JMenuItem(
"Decompile & Save All Classes..");
public final JMenuItem mntmAbout = new JMenuItem("About");
public AboutWindow aboutWindow = new AboutWindow();
public final JSeparator separator_3 = new JSeparator();
public final JMenu mnNewMenu_1 = new JMenu("Plugins");
public final JMenuItem mntmStartExternalPlugin = new JMenuItem(
@ -319,6 +320,7 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
public final JMenu mnSettings = new JMenu("Settings");
public final JSeparator separator_6 = new JSeparator();
public final JCheckBoxMenuItem refreshOnChange = new JCheckBoxMenuItem("Refresh On View Change");
public AboutWindow aboutWindow = new AboutWindow();
public FileNavigationPane cn = new FileNavigationPane(this);
@ -493,6 +495,9 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
public final JRadioButtonMenuItem panel1JDGUI = new JRadioButtonMenuItem("Java");
private final JSeparator separator_35 = new JSeparator();
public final JCheckBoxMenuItem panel1JDGUI_E = new JCheckBoxMenuItem("Editable");
private final JMenu mnFontSize = new JMenu("Font Size");
public final JSpinner fontSpinner = new JSpinner();
private final JSeparator separator_36 = new JSeparator();
public MainViewerGUI() {
mnNewMenu_5.setVisible(false);
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new Test());
@ -1287,6 +1292,13 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
mnSettings.add(decodeAPKResources);
mnSettings.add(separator_36);
mnSettings.add(mnFontSize);
fontSpinner.setModel(new SpinnerNumberModel(new Integer(12), new Integer(1), null, new Integer(1)));
mnFontSize.add(fontSpinner);
mnSettings.add(separator_13);
mntmSetPythonDirectory.addActionListener(new ActionListener() {
@Override
@ -1752,8 +1764,6 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
panelGroup2.setSelected(panel2Bytecode.getModel(), true);
panelGroup3.setSelected(panel3None.getModel(), true);
this.setLocationRelativeTo(null);
}