diff --git a/src/main/java/ai/nets/samj/gui/MainGUI.java b/src/main/java/ai/nets/samj/gui/MainGUI.java index 5ed4956..fa5d9b5 100644 --- a/src/main/java/ai/nets/samj/gui/MainGUI.java +++ b/src/main/java/ai/nets/samj/gui/MainGUI.java @@ -9,7 +9,6 @@ import ai.nets.samj.communication.model.SAMModel; import ai.nets.samj.gui.ImageSelection.ImageSelectionListener; import ai.nets.samj.ui.ConsumerInterface; -import ai.nets.samj.ui.UtilityMethods; import ai.nets.samj.utils.Constants; import net.imglib2.util.Cast; @@ -41,6 +40,8 @@ public class MainGUI extends JFrame { private JButton close = new JButton("Close"); private JButton help = new JButton("Help"); private JButton export = new JButton("Export..."); + private JButton install = new JButton("Install"); + private JButton uninstall = new JButton("Uninstall"); private final ModelSelection cmbModels; private final ImageSelection cmbImages; private JLabel drawerTitle = new JLabel(); @@ -85,6 +86,7 @@ public MainGUI(List modelList, ConsumerInterface consumer) { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + cmbModels.getButton().addActionListener(e -> toggleDrawer()); go.addActionListener(e -> loadModel()); export.addActionListener(e -> consumer.exportImageLabeling()); chkInstant.addActionListener(e -> setInstantPromptsEnabled(this.chkInstant.isSelected())); @@ -95,7 +97,7 @@ public MainGUI(List modelList, ConsumerInterface consumer) { help.addActionListener(e -> consumer.exportImageLabeling()); // Use BorderLayout for the main frame - setLayout(new BorderLayout()); + //setLayout(new BorderLayout()); setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); @@ -118,6 +120,8 @@ public MainGUI(List modelList, ConsumerInterface consumer) { gbc.gridy = 3; gbc.weighty = 0.03; add(createBottomPanel(), gbc); + + createDrawerPanel(); // Set the initial size of the frame setSize(MAIN_HORIZONTAL_SIZE, MAIN_VERTICAL_SIZE); // Width x Height @@ -384,6 +388,72 @@ private JPanel createThirdComponent() { return thirdComponent; } + private void createDrawerPanel() { + drawerPanel = new JPanel(); + drawerPanel.setLayout(new BorderLayout()); + drawerPanel.setBorder(BorderFactory.createEtchedBorder()); + drawerTitle.setText("
 "); + drawerPanel.add(drawerTitle, BorderLayout.NORTH); + drawerPanel.add(createInstallModelComponent(), BorderLayout.SOUTH); + HTMLPane html = new HTMLPane("Arial", "#000", "#CCCCCC", 200, 200); + //html.append("