mirror of
https://github.com/Maschell/HIDtoVPADNetworkClient.git
synced 2024-11-25 15:26:53 +01:00
Center Options window
This commit is contained in:
parent
2a6d61aef5
commit
d56b344a88
@ -93,7 +93,7 @@ public final class GuiInputControls extends JPanel {
|
|||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
GuiOptionsWindow.showWindow();
|
GuiOptionsWindow.showWindow(GuiMain.getInstance());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ import javax.swing.JCheckBox;
|
|||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTabbedPane;
|
import javax.swing.JTabbedPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.border.Border;
|
import javax.swing.border.Border;
|
||||||
@ -59,6 +60,10 @@ public class GuiOptionsWindow extends JPanel {
|
|||||||
private final List<Tab> tabs = new ArrayList<Tab>();
|
private final List<Tab> tabs = new ArrayList<Tab>();
|
||||||
|
|
||||||
public static void showWindow() {
|
public static void showWindow() {
|
||||||
|
showWindow(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void showWindow(Component parent) {
|
||||||
instance.setOpaque(true);
|
instance.setOpaque(true);
|
||||||
for (Tab t : instance.tabs) {
|
for (Tab t : instance.tabs) {
|
||||||
t.updateTab();
|
t.updateTab();
|
||||||
@ -68,6 +73,7 @@ public class GuiOptionsWindow extends JPanel {
|
|||||||
//TODO: close window behaviour
|
//TODO: close window behaviour
|
||||||
window.setContentPane(instance);
|
window.setContentPane(instance);
|
||||||
window.pack();
|
window.pack();
|
||||||
|
window.setLocationRelativeTo(parent);
|
||||||
window.setVisible(true);
|
window.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +82,7 @@ public class GuiOptionsWindow extends JPanel {
|
|||||||
|
|
||||||
log.info("Hello from the Options window!");
|
log.info("Hello from the Options window!");
|
||||||
|
|
||||||
setPreferredSize(new Dimension(600, 400));
|
setPreferredSize(new Dimension(600, 300));
|
||||||
|
|
||||||
JTabbedPane tabPane = new JTabbedPane();
|
JTabbedPane tabPane = new JTabbedPane();
|
||||||
tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
|
tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
|
||||||
@ -131,8 +137,10 @@ public class GuiOptionsWindow extends JPanel {
|
|||||||
|
|
||||||
innerPanel = new JPanel();
|
innerPanel = new JPanel();
|
||||||
innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.PAGE_AXIS));
|
innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.PAGE_AXIS));
|
||||||
innerPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
|
|
||||||
add(innerPanel, BorderLayout.CENTER);
|
JScrollPane innerPanelWrap = new JScrollPane(innerPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
||||||
|
innerPanelWrap.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
|
||||||
|
add(innerPanelWrap, BorderLayout.CENTER);
|
||||||
|
|
||||||
JLabel controllerFilterText = new JLabel("Controllers to show:");
|
JLabel controllerFilterText = new JLabel("Controllers to show:");
|
||||||
controllerFilterText.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
|
controllerFilterText.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
|
||||||
@ -193,7 +201,7 @@ public class GuiOptionsWindow extends JPanel {
|
|||||||
infoText.setEditable(false);
|
infoText.setEditable(false);
|
||||||
infoText.setText("WIP");
|
infoText.setText("WIP");
|
||||||
JPanel infoTextWrap = new JPanel(new GridLayout(1, 1));
|
JPanel infoTextWrap = new JPanel(new GridLayout(1, 1));
|
||||||
infoTextWrap.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
infoTextWrap.setBorder(BorderFactory.createEmptyBorder(5, 5, 10, 5));
|
||||||
infoTextWrap.add(infoText);
|
infoTextWrap.add(infoText);
|
||||||
infoTextWrap.setAlignmentX(Component.CENTER_ALIGNMENT);
|
infoTextWrap.setAlignmentX(Component.CENTER_ALIGNMENT);
|
||||||
add(infoTextWrap);
|
add(infoTextWrap);
|
||||||
|
Loading…
Reference in New Issue
Block a user