X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjkeytool%2Fgui%2Fswing%2FSwingInterface.java;h=95c8f9046b178c1cafc99a6e05bd3a6a62b45e0f;hb=b3362a471e12733c973779e7091db1a9e751220a;hp=388846d75724142cef087a82cdc594e599c2c5fd;hpb=8aa34340dda1029328137a73e42fe37995665869;p=jkeytool.git diff --git a/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java b/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java index 388846d..95c8f90 100644 --- a/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java +++ b/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java @@ -21,8 +21,14 @@ package net.pterodactylus.jkeytool.gui.swing; import java.io.File; import java.security.KeyStore; +import java.util.HashMap; +import java.util.Map; +import javax.swing.JFrame; + +import net.pterodactylus.jkeytool.core.Core; import net.pterodactylus.jkeytool.gui.Interface; +import net.pterodactylus.jkeytool.main.Main; /** * TODO @@ -31,14 +37,41 @@ import net.pterodactylus.jkeytool.gui.Interface; */ public class SwingInterface implements Interface { + /** The core to control. */ + private Core core; + + /** The main frame. */ + private JFrame mainFrame = new JFrame("jkeytool " + Main.getVersion()); + + /** Loaded key stores and their panels. */ + private final Map keyStores = new HashMap(); + // // INTERFACE Interface // /** + * Sets the core to control. + * + * @param core + * The core to control + */ + public void setCore(Core core) { + this.core = core; + } + + /** * {@inheritDoc} */ public void start() { + mainFrame.setVisible(true); + core.loadKeyStore(new File("client.p12")); + } + + /** + * {@inheritDoc} + */ + public void stop() { /* TODO */ } @@ -57,7 +90,9 @@ public class SwingInterface implements Interface { * {@inheritDoc} */ public void keyStoreLoaded(File keyStoreFile, KeyStore keyStore) { - /* TODO */ + KeyStorePanel keyStorePanel = new KeyStorePanel(keyStore); + keyStores.put(keyStore, keyStorePanel); + mainFrame.getContentPane().add(keyStorePanel); } /**