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

92 lines
3.1 KiB
Java

/*
* MIT License
*
* Copyright (c) 2020-2020 Niklas Schütrumpf (Gurkengewuerz)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
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;
}
}