Skip to content

Commit

Permalink
renamed method
Browse files Browse the repository at this point in the history
  • Loading branch information
raydac committed Nov 11, 2021
1 parent 34a20e1 commit 5921034
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public class JapagogeFrame extends JFrame {
public JapagogeFrame(final GraphicsConfiguration gc) {
super("Japagoge", gc);

this.borderSize = isHiDpi(gc) ? 10 : 5;
this.titleHeight = isHiDpi(gc) ? 72 : 36;
this.borderSize = isBigRes(gc) ? 10 : 5;
this.titleHeight = isBigRes(gc) ? 72 : 36;

this.imageConvert = loadIcon(gc, "button-convert.png");
this.imageClose = loadIcon(gc, "button-close.png");
Expand All @@ -91,12 +91,12 @@ public JapagogeFrame(final GraphicsConfiguration gc) {
uiManagerFont = new Font(Font.SANS_SERIF, Font.BOLD, 12);
}

this.setFont(isHiDpi(gc) ? fontX2(uiManagerFont) : uiManagerFont);
this.setFont(isBigRes(gc) ? fontX2(uiManagerFont) : uiManagerFont);

this.getRootPane().putClientProperty("Window.shadow", Boolean.FALSE);
this.getRootPane().getRootPane().putClientProperty("apple.awt.draggableWindowBackground", Boolean.FALSE);

final Dimension initialSize = isHiDpi(gc) ? new Dimension(640, 512) : new Dimension(320, 256);
final Dimension initialSize = isBigRes(gc) ? new Dimension(640, 512) : new Dimension(320, 256);

this.setUndecorated(true);
this.setBackground(Color.ORANGE);
Expand Down Expand Up @@ -231,7 +231,7 @@ public void mouseDragged(final MouseEvent e) {
this.statisticWindow.getContentPane().setForeground(COLOR_SELECT_POSITION);
this.statisticWindow.getContentPane().setLayout(new BoxLayout(this.statisticWindow.getContentPane(), BoxLayout.Y_AXIS));

final Font labelFont = new Font(Font.MONOSPACED, Font.BOLD, isHiDpi(gc) ? 28 : 14);
final Font labelFont = new Font(Font.MONOSPACED, Font.BOLD, isBigRes(gc) ? 28 : 14);

this.labelStatX = new JLabel(" X= ");
this.labelStatX.setFont(labelFont);
Expand Down Expand Up @@ -265,7 +265,7 @@ public void mouseDragged(final MouseEvent e) {

private static Image loadIcon(final GraphicsConfiguration gc, final String resourceName) {
try (final InputStream in = Objects.requireNonNull(JapagogeFrame.class.getResourceAsStream("/icons/" + resourceName))) {
return isHiDpi(gc) ? imageX2(ImageIO.read(in)) : ImageIO.read(in);
return isBigRes(gc) ? imageX2(ImageIO.read(in)) : ImageIO.read(in);
} catch (Exception ex) {
throw new Error("Can't load resource image: " + resourceName, ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ private SystemUtils() {

}

public static boolean isHiDpi(final GraphicsConfiguration gc) {
public static boolean isBigRes(final GraphicsConfiguration gc) {
final double displayWidth = gc.getDevice().getDisplayMode().getWidth();
final double displayBoundsWidth = gc.getDevice().getDefaultConfiguration().getBounds().width;
return displayBoundsWidth / displayWidth >= 1.5d || displayBoundsWidth > 3000;
Expand Down

0 comments on commit 5921034

Please sign in to comment.