M .build.yml => .build.yml +9 -1
@@ 1,10 1,18 @@
image: debian/stable
packages:
- - openjdk-11-jdk
+ - wget
+ - tar
sources:
- https://github.com/swissChili/chat
tasks:
+ - jdk: |
+ wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u275-b01/OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz
+ tar xzf OpenJDK8U-jdk_x64_linux_hotspot_8u275b01.tar.gz
+ export PATH=$PWD/jdk8u275-b01/bin:$PATH
+ java -version
- jar: |
+ export PATH=$PWD/jdk8u275-b01/bin:$PATH
+ java -version
cd chat
./gradlew shadowJar
cp client/build/libs/*.jar client.jar
A .idea/java-chat.iml => .idea/java-chat.iml +9 -0
@@ 0,0 1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module external.linked.project.id="chat:main" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="sh.swisschili.chat" external.system.module.version="1.1-SNAPSHOT" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$" />
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module><
\ No newline at end of file
A .idea/modules.xml => .idea/modules.xml +8 -0
@@ 0,0 1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/java-chat.iml" filepath="$PROJECT_DIR$/.idea/java-chat.iml" />
+ </modules>
+ </component>
+</project><
\ No newline at end of file
M client/src/main/java/sh/swisschili/chat/client/MessageCell.java => client/src/main/java/sh/swisschili/chat/client/MessageCell.java +7 -1
@@ 27,8 27,11 @@ import org.slf4j.LoggerFactory;
import sh.swisschili.chat.util.ChatProtos.Message;
import javax.swing.*;
+import javax.swing.plaf.FontUIResource;
+import javax.swing.text.StyleContext;
import java.awt.*;
import java.util.Date;
+import java.util.Locale;
public class MessageCell implements ListCellRenderer<Message> {
private JPanel rootPanel;
@@ 110,7 113,10 @@ public class MessageCell implements ListCellRenderer<Message> {
resultName = currentFont.getName();
}
}
- return new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize());
+ Font font = new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize());
+ boolean isMac = System.getProperty("os.name", "").toLowerCase(Locale.ENGLISH).startsWith("mac");
+ Font fontWithFallback = isMac ? new Font(font.getFamily(), font.getStyle(), font.getSize()) : new StyleContext().getFont(font.getFamily(), font.getStyle(), font.getSize());
+ return fontWithFallback instanceof FontUIResource ? fontWithFallback : new FontUIResource(fontWithFallback);
}
/**