mirror of
https://github.com/SKCraft/Launcher.git
synced 2024-11-24 12:16:28 +01:00
Switch to MigLayout for the main launcher frame.
This commit is contained in:
parent
ab6ec9ed71
commit
a67b8820e5
@ -15,6 +15,7 @@ dependencies {
|
|||||||
compile 'com.beust:jcommander:1.32'
|
compile 'com.beust:jcommander:1.32'
|
||||||
compile 'org.tukaani:xz:1.0'
|
compile 'org.tukaani:xz:1.0'
|
||||||
compile 'org.apache.commons:commons-compress:1.9'
|
compile 'org.apache.commons:commons-compress:1.9'
|
||||||
|
compile 'com.miglayout:miglayout:3.7.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
@ -27,6 +27,7 @@ import com.skcraft.launcher.util.SharedLocale;
|
|||||||
import com.skcraft.launcher.util.SwingExecutor;
|
import com.skcraft.launcher.util.SwingExecutor;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.extern.java.Log;
|
import lombok.extern.java.Log;
|
||||||
|
import net.miginfocom.swing.MigLayout;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@ -59,8 +60,6 @@ public class LauncherFrame extends JFrame {
|
|||||||
private final JScrollPane instanceScroll = new JScrollPane(instancesTable);
|
private final JScrollPane instanceScroll = new JScrollPane(instancesTable);
|
||||||
private WebpagePanel webView;
|
private WebpagePanel webView;
|
||||||
private JSplitPane splitPane;
|
private JSplitPane splitPane;
|
||||||
private final JPanel container = new JPanel();
|
|
||||||
private final LinedBoxPanel buttonsPanel = new LinedBoxPanel(true).fullyPadded();
|
|
||||||
private final JButton launchButton = new JButton(SharedLocale.tr("launcher.launch"));
|
private final JButton launchButton = new JButton(SharedLocale.tr("launcher.launch"));
|
||||||
private final JButton refreshButton = new JButton(SharedLocale.tr("launcher.checkForUpdates"));
|
private final JButton refreshButton = new JButton(SharedLocale.tr("launcher.checkForUpdates"));
|
||||||
private final JButton optionsButton = new JButton(SharedLocale.tr("launcher.options"));
|
private final JButton optionsButton = new JButton(SharedLocale.tr("launcher.options"));
|
||||||
@ -92,6 +91,8 @@ public class LauncherFrame extends JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
setLayout(new MigLayout("fill, insets dialog", "[][]push[][]", "[grow][]"));
|
||||||
|
|
||||||
webView = WebpagePanel.forURL(launcher.getNewsURL(), false);
|
webView = WebpagePanel.forURL(launcher.getNewsURL(), false);
|
||||||
splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, instanceScroll, webView);
|
splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, instanceScroll, webView);
|
||||||
selfUpdateButton.setVisible(false);
|
selfUpdateButton.setVisible(false);
|
||||||
@ -101,18 +102,13 @@ public class LauncherFrame extends JFrame {
|
|||||||
launchButton.setFont(launchButton.getFont().deriveFont(Font.BOLD));
|
launchButton.setFont(launchButton.getFont().deriveFont(Font.BOLD));
|
||||||
splitPane.setDividerLocation(200);
|
splitPane.setDividerLocation(200);
|
||||||
splitPane.setDividerSize(4);
|
splitPane.setDividerSize(4);
|
||||||
|
add(splitPane, "grow, wrap, span 5, gapbottom unrel");
|
||||||
SwingHelper.flattenJSplitPane(splitPane);
|
SwingHelper.flattenJSplitPane(splitPane);
|
||||||
buttonsPanel.addElement(refreshButton);
|
add(refreshButton);
|
||||||
buttonsPanel.addElement(updateCheck);
|
add(updateCheck);
|
||||||
buttonsPanel.addGlue();
|
add(selfUpdateButton);
|
||||||
buttonsPanel.addElement(selfUpdateButton);
|
add(optionsButton);
|
||||||
buttonsPanel.addElement(optionsButton);
|
add(launchButton);
|
||||||
buttonsPanel.addElement(launchButton);
|
|
||||||
container.setLayout(new BorderLayout());
|
|
||||||
container.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
|
|
||||||
container.add(splitPane, BorderLayout.CENTER);
|
|
||||||
add(buttonsPanel, BorderLayout.SOUTH);
|
|
||||||
add(container, BorderLayout.CENTER);
|
|
||||||
|
|
||||||
instancesModel.addTableModelListener(new TableModelListener() {
|
instancesModel.addTableModelListener(new TableModelListener() {
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user