arma3launcher/patcher/src/main/java/de/mc8051/arma3launcher/Patcher.java

85 lines
2.7 KiB
Java

/*
* This file is part of the arma3launcher distribution.
* Copyright (c) 2020-2020 Niklas Schütrumpf (Gurkengewuerz)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.mc8051.arma3launcher;
import javax.swing.*;
import java.awt.*;
/**
* Created by gurkengewuerz.de on 29.03.2020.
*/
public class Patcher {
public JPanel mainpanel;
public JProgressBar progressBar1;
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
$$$setupUI$$$();
}
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
mainpanel = new JPanel();
mainpanel.setLayout(new BorderLayout(0, 0));
progressBar1 = new JProgressBar();
progressBar1.setMinimumSize(new Dimension(10, 4));
progressBar1.setString("");
progressBar1.setValue(0);
mainpanel.add(progressBar1, BorderLayout.CENTER);
final JLabel label1 = new JLabel();
Font label1Font = this.$$$getFont$$$(null, Font.BOLD, 16, label1.getFont());
if (label1Font != null) label1.setFont(label1Font);
label1.setText("Launcher Updater");
mainpanel.add(label1, BorderLayout.NORTH);
}
/**
* @noinspection ALL
*/
private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) {
if (currentFont == null) return null;
String resultName;
if (fontName == null) {
resultName = currentFont.getName();
} else {
Font testFont = new Font(fontName, Font.PLAIN, 10);
if (testFont.canDisplay('a') && testFont.canDisplay('1')) {
resultName = fontName;
} else {
resultName = currentFont.getName();
}
}
return new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize());
}
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return mainpanel;
}
}