-added optional flatlaf themes
AboutDialog:
-show detailed LAF infos
GraphicalUserInterfaceSettings:
-added optional flatlaf themes, minim java 1.8


git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@42718 ebf7c1c2-ba36-0410-9fe8-c592906822b4

Former-commit-id: a2013829386fb029fe743c60b0468f72b26ddbc2
This commit is contained in:
jiaz 2020-08-12 08:29:53 +00:00
parent 69efa9ceca
commit e6a7b9dc95
5 changed files with 51 additions and 14 deletions

View File

@ -79,5 +79,6 @@
<classpathentry kind="lib" path="ressourcen/libs/bcpkix-jdk15on.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/bcprov-jdk15on.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/bctls-jdk15on.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/flatlaf.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

Binary file not shown.

View File

@ -0,0 +1,6 @@
FlatLaf
Version: https://bintray.com/jformdesigner/flatlaf/flatlaf/0.40
Homepage: https://www.formdev.com/flatlaf/
GitHub: https://github.com/JFormDesigner/FlatLaf
FlatLaf is open source licensed under the Apache 2.0 License

View File

@ -52,6 +52,7 @@ import org.appwork.swing.components.ExtButton;
import org.appwork.uio.UIOManager;
import org.appwork.utils.Application;
import org.appwork.utils.IO;
import org.appwork.utils.Regex;
import org.appwork.utils.StringUtils;
import org.appwork.utils.formatter.SizeFormatter;
import org.appwork.utils.formatter.TimeFormatter;
@ -253,10 +254,25 @@ public class AboutDialog extends AbstractDialog<Integer> {
stats.add(disable("7ZipJBindings", "https://github.com/borisbrodski/sevenzipjbinding"));
stats.add(disable("Zip4J", "https://github.com/srikanth-lingala/zip4j"), "skip");
final LookAndFeel laf = UIManager.getLookAndFeel();
if (laf != null && StringUtils.containsIgnoreCase(laf.getID(), "Synthetica")) {
if (laf != null) {
stats.add(new JLabel(_GUI.T.jd_gui_swing_components_AboutDialog_laf()), "");
stats.add(disable("Synthetica", "http://www.jyloo.com/synthetica/"));
stats.add(disable(_GUI.T.jd_gui_swing_components_AboutDialog_synthetica2("(#112044)")), "skip");
if (StringUtils.containsIgnoreCase(laf.getID(), "FlatLaf")) {
stats.add(disable(laf.getName(), "https://www.formdev.com/flatlaf/"));
} else if (StringUtils.containsIgnoreCase(laf.getID(), "Synthetica")) {
stats.add(disable(laf.getName(), "http://www.jyloo.com/synthetica/"));
try {
final Object info = UIManager.get("Synthetica.license.info");
if (info instanceof String[]) {
final String license = StringUtils.join(Arrays.asList((String[]) info), "\r");
final String Licensee = new Regex(license, "Licensee\\s*=\\s*([^\r\n]+)").getMatch(0);
final String LicenseRegistrationNumber = new Regex(license, "LicenseRegistrationNumber\\s*=\\s*([^\r\n]+)").getMatch(0);
stats.add(disable(_GUI.T.jd_gui_swing_components_AboutDialog_synthetica2(Licensee + "(#" + LicenseRegistrationNumber + ")")), "skip");
}
} catch (Throwable ignore) {
}
} else {
stats.add(disable(laf.getName(), ""));
}
}
stats.add(new JLabel(_GUI.T.jd_gui_swing_components_AboutDialog_icons()), "");
stats.add(disable("See /themes/* folder for Icon Licenses"), "");

View File

@ -25,6 +25,7 @@ import org.appwork.storage.config.annotations.RequiresRestart;
import org.appwork.storage.config.annotations.SpinnerValidator;
import org.appwork.storage.config.handler.KeyHandler;
import org.appwork.utils.Application;
import org.appwork.utils.JVMVersion;
import org.appwork.utils.os.CrossSystem;
import org.appwork.utils.swing.dialog.View;
import org.appwork.utils.swing.windowmanager.WindowManager.FrameState;
@ -628,11 +629,10 @@ public interface GraphicalUserInterfaceSettings extends ConfigInterface {
// org.jdownloader.gui.laf.jddefault.JDDefaultLookAndFeel
public static enum LookAndFeelType {
// https://github.com/JFormDesigner/FlatLaf https://www.formdev.com/flatlaf
FLATLAF_LIGHT(null, "com.formdev.flatlaf.FlatLightLaf"),
FLATLAF_DARK(null, "com.formdev.flatlaf.FlatDarkLaf"),
FLATLAF_INTELLIJ(null, "com.formdev.flatlaf.FlatIntelliJLaf"),
FLATLAF_DRACULA(null, "com.formdev.flatlaf.FlatDarculaLaf"),
FLATLAF_LIGHT("flatlaf-themes", "com.formdev.flatlaf.FlatLightLaf", JVMVersion.JAVA_1_8),
FLATLAF_DARK("flatlaf-themes", "com.formdev.flatlaf.FlatDarkLaf", JVMVersion.JAVA_1_8),
FLATLAF_INTELLIJ("flatlaf-themes", "com.formdev.flatlaf.FlatIntelliJLaf", JVMVersion.JAVA_1_8),
FLATLAF_DRACULA("flatlaf-themes", "com.formdev.flatlaf.FlatDarculaLaf", JVMVersion.JAVA_1_8),
ALU_OXIDE("synthetica-themes", "de.javasoft.plaf.synthetica.SyntheticaAluOxideLookAndFeel"),
BLACK_EYE("synthetica-themes", "de.javasoft.plaf.synthetica.SyntheticaBlackEyeLookAndFeel"),
BLACK_MOON("synthetica-themes", "de.javasoft.plaf.synthetica.SyntheticaBlackMoonLookAndFeel"),
@ -655,6 +655,7 @@ public interface GraphicalUserInterfaceSettings extends ConfigInterface {
DEFAULT(null, "org.jdownloader.gui.laf.jddefault.JDDefaultLookAndFeel");
private final String clazz;
private final String extensionID;
private final long minimumJVMVersoin;
public final String getExtensionID() {
return extensionID;
@ -664,21 +665,34 @@ public interface GraphicalUserInterfaceSettings extends ConfigInterface {
return clazz;
}
private LookAndFeelType(String extensionID, String clazz) {
public final long getMinimumJVMVersion() {
return minimumJVMVersoin;
}
private LookAndFeelType(String extensionID, String clazz, long minimumJVMVersoin) {
this.clazz = clazz;
this.extensionID = extensionID;
this.minimumJVMVersoin = minimumJVMVersoin;
}
private LookAndFeelType(String extensionID, String clazz) {
this(extensionID, clazz, JVMVersion.JAVA_1_6);
}
public boolean isAvailable() {
try {
// do not use Class.forName here since this would load the class
final String path = "/" + getClazz().replace(".", "/") + ".class";
final URL classPath = getClass().getResource(path);
return classPath != null;
if (JVMVersion.isMinimum(getMinimumJVMVersion())) {
// do not use Class.forName here since this would load the class
final String path = "/" + getClazz().replace(".", "/") + ".class";
final URL classPath = getClass().getResource(path);
return classPath != null;
} else {
return false;
}
} catch (Throwable e) {
e.printStackTrace();
return false;
}
return false;
}
}