Commit 7ecd673d authored by Eric Seigne's avatar Eric Seigne
Browse files

change default font size because of screen resolutions in 2019 is not the same as 2010 years :)

parent 46d1435a
......@@ -53,7 +53,7 @@ public class AboutDialog extends JDialog {
setResources();
oldCursor=getCursor();
infoTextLabel.setText(info);
java.awt.Font infoFont = new java.awt.Font("Tahoma", 0, 11);
java.awt.Font infoFont = new java.awt.Font("Tahoma", 0, 14);
infoTextLabel.setFont(infoFont);
updateLabel1.setFont(infoFont);
updateLabel2.setFont(infoFont);
......
......@@ -52,7 +52,7 @@ public class ConditionsAcceptance extends javax.swing.JDialog {
agreeButton.setToolTipText( MvplanInstance.getMvplan().getResource("mvplan.gui.TermsAcceptance.agreeButton.tip") );
exitButton.setToolTipText( MvplanInstance.getMvplan().getResource("mvplan.gui.TermsAcceptance.exitButton.tip") );
// Display T&Cs
termsTextArea.setFont(new Font("MONOSPACED",Font.PLAIN,12));
termsTextArea.setFont(new Font("MONOSPACED",Font.PLAIN,16));
new ConditionsDisplay(termsTextArea);
// Position at start
......
......@@ -119,8 +119,10 @@ public class MainFrame extends JFrame
File lastModelFile; // Saves last file name used in Save command
boolean repetitiveMode=false; // Controls repetitive mode
boolean updateAvailable=false; // Saves update available state
//erics : default font size
java.awt.Font bigFont = new Font("Arial",Font.PLAIN,16);
// Components
JPanel mainContentPane;
JFrame mainFrame;
......@@ -200,8 +202,7 @@ public class MainFrame extends JFrame
private ProgressIndicator progress = new ProgressIndicator(12,15, null); // Was 12,15
private PageFormat pageFormat; // Remember page setup
public MainFrame()
{
mainFrame=(this);
......@@ -227,7 +228,7 @@ public class MainFrame extends JFrame
}
// Create GUI
guiInit();
// Display DEBUG mode warning
if(Mvplan.DEBUG>0) {
if ( Mvplan.preferredLocale != null)
......@@ -321,7 +322,7 @@ public class MainFrame extends JFrame
textArea = new JTextArea("",25,80);
textArea.setMargin(new Insets(10,10,10,10));
textArea.setEditable(false);
textArea.setFont(new Font("MONOSPACED",Font.PLAIN,12));
textArea.setFont(new Font("MONOSPACED",Font.PLAIN,16));
rightScrollPane = new JScrollPane();
rightPanel.add(rightScrollPane,new GridBagConstraints(0,0,1,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH, new Insets(10,10,10,10),0,0));
rightScrollPane.getViewport().add(textArea);
......@@ -718,6 +719,7 @@ public class MainFrame extends JFrame
saveButton.setText(MvplanInstance.getMvplan().getResource("mvplan.gui.MainFrame.saveButton.text"));
saveButton.setToolTipText(MvplanInstance.getMvplan().getResource("mvplan.gui.MainFrame.saveButton.tip"));
exitButton.setText(MvplanInstance.getMvplan().getResource("mvplan.gui.MainFrame.exitButton.text"));
//erics exitButton.setFont(bigFont);
exitButton.setToolTipText(MvplanInstance.getMvplan().getResource("mvplan.gui.MainFrame.exitButton.tip"));
printButton.setText(MvplanInstance.getMvplan().getResource("mvplan.gui.MainFrame.printButton.text"));
printButton.setToolTipText(MvplanInstance.getMvplan().getResource("mvplan.gui.MainFrame.printButton.tip"));
......
......@@ -39,7 +39,7 @@ public class ModelDisplayComponent extends JComponent implements MouseMotionLis
public ModelDisplayComponent(mvplan.model.AbstractModel model) {
setModel(model);
addMouseMotionListener(this);
infoFont=new Font(Mvplan.prefs.getPrintFontName(),Font.BOLD,12);
infoFont=new Font(Mvplan.prefs.getPrintFontName(),Font.BOLD,18);
}
public synchronized void setModel(mvplan.model.AbstractModel model) {
......
......@@ -37,6 +37,9 @@ import mvplan.prefs.PrefsXStreamDAO;
import mvplan.util.*;
import javax.swing.UIManager;
//erics
import java.awt.Font;
public class Mvplan implements IMvplan
{
private static final float MIN_JVM = 1.5f; // Minimum Java JVM requirement. Checked on startup.
......@@ -66,6 +69,17 @@ public class Mvplan implements IMvplan
}
}
//erics from https://stackoverflow.com/questions/7434845/setting-the-default-font-of-swing-program
public static void setUIFont (javax.swing.plaf.FontUIResource f){
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get (key);
if (value instanceof javax.swing.plaf.FontUIResource)
UIManager.put (key, f);
}
}
public void init(){
float vmVersion=0.0f; // For Virtual Machine version
ArrayList<Locale> availableLocales = new ArrayList<Locale>(); // Stores available locales
......@@ -84,7 +98,8 @@ public class Mvplan implements IMvplan
try {
UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.PlasticXPLookAndFeel");
} catch (Exception e) {}
// Check Java JVM version
try {
// Check JVM Version
......@@ -150,7 +165,10 @@ public class Mvplan implements IMvplan
}
MvplanInstance.setPrefs(prefs);
initProxy(prefs);
//erics
setUIFont (new javax.swing.plaf.FontUIResource("Ubuntu",Font.PLAIN,16));
// Open main screen
frame = new MainFrame();
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
......
......@@ -186,22 +186,22 @@ public class Prefs implements Serializable
showStopTime=true;
showRunTime=true;
showGasFirst=false;
frameSizeX=800; // Display state
frameSizeY=600;
frameSplit=320;
frameSizeX=1280; // Display state
frameSizeY=900;
frameSplit=460;
gfMultilevelMode=false;
prefGases = new ArrayList<Gas>();
prefSegments = new ArrayList<SegmentAbstract>();
prefGases.add(new Gas (0.0,0.21,66.0));
prefSegments.add(new SegmentDive(30.0,20.0,(Gas)prefGases.get(0),1.3));
maxDepth=100.0; // Default maximums
maxDepth=130.0; // Default maximums
maxSegmentTime=100.0;
maxSetpoint=1.6;
maxMOD=1.607;
maxPO2=1.6;
printFontName="Arial"; // Defaults for printing laminated dive plans
printFontBodySize=9;
printFontHeaderSize=8;
printFontBodySize=18;
printFontHeaderSize=14;
agreedToTerms=false;
lastUpdateCheck=Calendar.getInstance().getTime();
updateCheckDisable=false;
......@@ -308,8 +308,8 @@ public class Prefs implements Serializable
if (prefSegments.isEmpty()) prefSegments.add(new SegmentDive(30.0,20.0,(Gas)prefGases.get(0),1.3));
if (printFontName==null || printFontName.contains("Dialog") ) printFontName="Arial";
if (printFontBodySize<8 || printFontBodySize>18) printFontBodySize=9;
if (printFontHeaderSize<6 || printFontHeaderSize>18) printFontHeaderSize=8;
if (printFontBodySize<8 || printFontBodySize>18) printFontBodySize=14;
if (printFontHeaderSize<6 || printFontHeaderSize>18) printFontHeaderSize=16;
if (lastUpdateCheck==null) lastUpdateCheck=Calendar.getInstance().getTime();
if (updateCheckFrequency<0 || updateCheckFrequency>365) updateCheckFrequency=7;
if(debug>0)
......@@ -470,8 +470,8 @@ public class Prefs implements Serializable
public void setPH2O(double d) { pH2O=d; }
public void setAgreedToTerms(boolean b) { agreedToTerms=b; }
public void setPrintFontName(String s) { printFontName=s;}
public void setPrintFontBodySize(int i) { if (i>=8 && i<=18) printFontBodySize=i; }
public void setPrintFontHeaderSize(int i) { if (i>=6 && i<=18) printFontHeaderSize=i; }
public void setPrintFontBodySize(int i) { if (i>=8 && i<=28) printFontBodySize=i; }
public void setPrintFontHeaderSize(int i) { if (i>=6 && i<=28) printFontHeaderSize=i; }
public void setLastUpdateCheck(Date d) { lastUpdateCheck=d; }
public void setUpdateCheckDisable(boolean b) { updateCheckDisable=b; }
public void setUpdateCheckFrequency(int i) { updateCheckFrequency=i; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment