mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
+start server button
This commit is contained in:
@@ -8,6 +8,7 @@ import forge.gui.deckeditor.controllers.CEditorConstructed;
|
||||
import forge.gui.framework.EDocID;
|
||||
import forge.gui.framework.ICDoc;
|
||||
import forge.gui.home.sanctioned.VSubmenuConstructed;
|
||||
import forge.net.NetServer;
|
||||
import forge.properties.ForgePreferences;
|
||||
import forge.properties.ForgePreferences.FPref;
|
||||
|
||||
@@ -55,6 +56,8 @@ public enum CHomeUI implements ICDoc {
|
||||
/* (non-Javadoc)
|
||||
* @see forge.view.home.ICDoc#intialize()
|
||||
*/
|
||||
private final NetServer server = new NetServer();
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Override
|
||||
public void initialize() {
|
||||
@@ -73,6 +76,13 @@ public enum CHomeUI implements ICDoc {
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
VHomeUI.SINGLETON_INSTANCE.getLblStartServer().setCommand(new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
server.listen();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
||||
@@ -89,8 +89,9 @@ public enum VHomeUI implements IVTopLevelUI {
|
||||
.iconAlignX(SwingConstants.CENTER)
|
||||
.iconInBackground(true).iconScaleFactor(1.0).build();
|
||||
|
||||
private final FLabel lblExit = new FLabel.ButtonBuilder().text("Exit Forge").fontSize(16).build();
|
||||
private final FLabel lblEditor = new FLabel.ButtonBuilder().text("Deck Editor").fontSize(16).build();
|
||||
private final FLabel lblExit = new FLabel.ButtonBuilder().text("Exit Forge").fontSize(14).build();
|
||||
private final FLabel lblEditor = new FLabel.ButtonBuilder().text("Deck Editor").fontSize(14).build();
|
||||
private final FLabel lblStartServer = new FLabel.ButtonBuilder().text("Start Server").fontSize(14).build();
|
||||
|
||||
private VHomeUI() {
|
||||
pnlMenu.add(lblLogo, "w 150px!, h 150px!, gap 0 0 5px 10px, ax center");
|
||||
@@ -150,14 +151,14 @@ public enum VHomeUI implements IVTopLevelUI {
|
||||
}
|
||||
}
|
||||
|
||||
JPanel pnlButtons = new JPanel(new MigLayout("insets 0, gap 0"));
|
||||
JPanel pnlButtons = new JPanel(new MigLayout("insets 0, gap 0, wrap 2"));
|
||||
pnlButtons.setOpaque(false);
|
||||
|
||||
lblExit.setFont(FSkin.getFont(14));
|
||||
lblEditor.setFont(FSkin.getFont(14));
|
||||
pnlButtons.add(lblStartServer, "w 230px!, h 24px!, sx 2, gap 0 0 0 10px");
|
||||
pnlButtons.add(lblExit, "w 110px!, h 30px!, gap 0 10px 0 0");
|
||||
pnlButtons.add(lblEditor, "w 110px!, h 30px!");
|
||||
|
||||
|
||||
pnlMenu.add(pnlButtons, "w 230px!, gap 10px 0 10px 10px");
|
||||
pnlDisplay.setBackground(FSkin.alphaColor(l00, 100));
|
||||
}
|
||||
@@ -172,6 +173,10 @@ public enum VHomeUI implements IVTopLevelUI {
|
||||
return this.lblEditor;
|
||||
}
|
||||
|
||||
public final FLabel getLblStartServer() {
|
||||
return lblStartServer;
|
||||
}
|
||||
|
||||
/** @return {@link javax.swing.JPanel} */
|
||||
public JPanel getPnlMenu() {
|
||||
return pnlMenu;
|
||||
|
||||
Reference in New Issue
Block a user