X-Git-Url: https://git.pterodactylus.net/?p=jkeytool.git;a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjkeytool%2Fgui%2Fswing%2FSwingInterface.java;h=3190c2a426aba61306f88a3f6eb09c7f010664fa;hp=4d287d9e7893dae60f071a27ca89970a2eaa0278;hb=5e44623aa5fadee1d0c4f605aebee442330e1ae5;hpb=93811f6061a8da43bd50cf04cffcc150d465f845 diff --git a/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java b/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java index 4d287d9..3190c2a 100644 --- a/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java +++ b/src/net/pterodactylus/jkeytool/gui/swing/SwingInterface.java @@ -21,9 +21,15 @@ 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; +import net.pterodactylus.util.swing.StatusBar; /** * TODO @@ -35,6 +41,28 @@ public class SwingInterface implements Interface { /** The core to control. */ private Core core; + /** The main frame. */ + private JFrame mainFrame = new JFrame("jkeytool " + Main.getVersion()); + + /** The status bar. */ + private StatusBar statusBar = new StatusBar(); + + /** Loaded key stores and their panels. */ + private final Map keyStores = new HashMap(); + + public SwingInterface() { + createFrame(); + } + + // + // PRIVATE METHODS + // + + private void createFrame() { + mainFrame.getContentPane().add(statusBar, BorderLayout.PAGE_END); + mainFrame.pack(); + } + // // INTERFACE Interface // @@ -53,6 +81,15 @@ public class SwingInterface implements Interface { * {@inheritDoc} */ public void start() { + mainFrame.setVisible(true); + statusBar.setText("jkeytool startup complete."); + core.loadKeyStore(new File("client.p12")); + } + + /** + * {@inheritDoc} + */ + public void stop() { /* TODO */ } @@ -71,7 +108,8 @@ public class SwingInterface implements Interface { * {@inheritDoc} */ public void keyStoreLoaded(File keyStoreFile, KeyStore keyStore) { - /* TODO */ + KeyStorePanel keyStorePanel = new KeyStorePanel(keyStore); + keyStores.put(keyStore, keyStorePanel); } /**