mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-28 23:35:39 +01:00
Compare commits
3 Commits
master
...
jide-oss-u
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bf64c417f | ||
|
|
bc3333bd0e | ||
|
|
e6d9d8fbda |
BIN
lib/jide-oss.jar
BIN
lib/jide-oss.jar
Binary file not shown.
@@ -65,22 +65,8 @@ public class ATContentStudio {
|
|||||||
|
|
||||||
ConfigCache.init();
|
ConfigCache.init();
|
||||||
|
|
||||||
try {
|
String laf = ConfigCache.getFavoriteLaFClassName();
|
||||||
String laf = ConfigCache.getFavoriteLaFClassName();
|
setLookAndFeel(laf);
|
||||||
if (laf == null)
|
|
||||||
laf = UIManager.getSystemLookAndFeelClassName();
|
|
||||||
UIManager.setLookAndFeel(laf);
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InstantiationException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (UnsupportedLookAndFeelException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
scaleUIFont();
|
|
||||||
|
|
||||||
// Need to keep a strong reference to it, to avoid garbage collection that'll
|
// Need to keep a strong reference to it, to avoid garbage collection that'll
|
||||||
// reset this setting.
|
// reset this setting.
|
||||||
@@ -116,7 +102,6 @@ public class ATContentStudio {
|
|||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE);
|
frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
for (File f : ConfigCache.getKnownWorkspaces()) {
|
for (File f : ConfigCache.getKnownWorkspaces()) {
|
||||||
if (workspaceRoot.equals(f)) {
|
if (workspaceRoot.equals(f)) {
|
||||||
@@ -134,6 +119,34 @@ public class ATContentStudio {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setLookAndFeel(String laf) {
|
||||||
|
if (laf == null)
|
||||||
|
{
|
||||||
|
System.out.println("No look and feel specified, using system default.");
|
||||||
|
laf = UIManager.getSystemLookAndFeelClassName();
|
||||||
|
}
|
||||||
|
System.out.println("Info: Setting look and feel to: " + laf);
|
||||||
|
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel(laf);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
System.err.println("Failed to load system look and feel. ");
|
||||||
|
System.err.println("Installed look and feel classes: ");
|
||||||
|
for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
|
||||||
|
System.err.println(" " + info.getName() + " (" + info.getClassName() + ")");
|
||||||
|
}
|
||||||
|
System.err.println("Tried to load: " + laf + " but got this error:");
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (InstantiationException | UnsupportedLookAndFeelException | IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
var newLaF = UIManager.getLookAndFeel();
|
||||||
|
System.out.println("Using look and feel: " + newLaF.getName() + " (" + newLaF.getClass().getName() + ")");
|
||||||
|
|
||||||
|
scaleUIFont();
|
||||||
|
}
|
||||||
|
|
||||||
private static void checkUpdate() {
|
private static void checkUpdate() {
|
||||||
BufferedReader in = null;
|
BufferedReader in = null;
|
||||||
try {
|
try {
|
||||||
@@ -156,13 +169,13 @@ public class ATContentStudio {
|
|||||||
style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
|
style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
|
||||||
style.append("font-size:" + font.getSize() + "pt;");
|
style.append("font-size:" + font.getSize() + "pt;");
|
||||||
style.append("background-color: rgb(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue()
|
style.append("background-color: rgb(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue()
|
||||||
+ ");");
|
+ ");");
|
||||||
|
|
||||||
JEditorPane ep = new JEditorPane("text/html",
|
JEditorPane ep = new JEditorPane("text/html",
|
||||||
"<html><body style=\"" + style + "\">" + "You are not running the latest ATCS version.<br/>"
|
"<html><body style=\"" + style + "\">" + "You are not running the latest ATCS version.<br/>"
|
||||||
+ "You can get the latest version (" + lastLine + ") by clicking the link below.<br/>"
|
+ "You can get the latest version (" + lastLine + ") by clicking the link below.<br/>"
|
||||||
+ "<a href=\"" + DOWNLOAD_URL + "\">" + DOWNLOAD_URL + "</a><br/>" + "<br/>"
|
+ "<a href=\"" + DOWNLOAD_URL + "\">" + DOWNLOAD_URL + "</a><br/>" + "<br/>"
|
||||||
+ "</body></html>");
|
+ "</body></html>");
|
||||||
|
|
||||||
ep.setEditable(false);
|
ep.setEditable(false);
|
||||||
ep.setBorder(null);
|
ep.setBorder(null);
|
||||||
|
|||||||
@@ -145,20 +145,10 @@ public class StudioFrame extends JFrame {
|
|||||||
lafItem.addActionListener(new ActionListener() {
|
lafItem.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
try {
|
String lookAndFeel = i.getClassName();
|
||||||
UIManager.setLookAndFeel(i.getClassName());
|
ATContentStudio.setLookAndFeel(lookAndFeel);
|
||||||
ATContentStudio.scaleUIFont();
|
SwingUtilities.updateComponentTreeUI(ATContentStudio.frame);
|
||||||
SwingUtilities.updateComponentTreeUI(ATContentStudio.frame);
|
ConfigCache.setFavoriteLaFClassName(lookAndFeel);
|
||||||
ConfigCache.setFavoriteLaFClassName(i.getClassName());
|
|
||||||
} catch (ClassNotFoundException e1) {
|
|
||||||
e1.printStackTrace();
|
|
||||||
} catch (InstantiationException e1) {
|
|
||||||
e1.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e1) {
|
|
||||||
e1.printStackTrace();
|
|
||||||
} catch (UnsupportedLookAndFeelException e1) {
|
|
||||||
e1.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -231,5 +221,4 @@ public class StudioFrame extends JFrame {
|
|||||||
editors.showAbout();
|
editors.showAbout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user