diff --git a/src/main/java/ai/nets/samj/gui/ImageSelection.java b/src/main/java/ai/nets/samj/gui/ImageSelection.java index 29b25a9..6eb874d 100644 --- a/src/main/java/ai/nets/samj/gui/ImageSelection.java +++ b/src/main/java/ai/nets/samj/gui/ImageSelection.java @@ -39,6 +39,8 @@ protected static ImageSelection create(ConsumerInterface consumer, ImageSelectio } protected Object getSelectedObject() { + if (this.cmbBox.getSelectedItem() == null) + return null; return ((ComboBoxItem) this.cmbBox.getSelectedItem()).getValue(); } diff --git a/src/main/java/ai/nets/samj/gui/components/ModelDrawerPanel.java b/src/main/java/ai/nets/samj/gui/components/ModelDrawerPanel.java index 0d4cc50..62c2335 100644 --- a/src/main/java/ai/nets/samj/gui/components/ModelDrawerPanel.java +++ b/src/main/java/ai/nets/samj/gui/components/ModelDrawerPanel.java @@ -124,14 +124,12 @@ private void installModel() { this.model.getInstallationManger().installEverything(); SwingUtilities.invokeLater(() -> { listener.setGUIEnabled(true); - listener.setGoButtonEnabled(true); }); } catch (IOException | InterruptedException | ArchiveException | URISyntaxException | MambaInstallException e) { e.printStackTrace(); SwingUtilities.invokeLater(() -> { listener.setGUIEnabled(true); - listener.setGoButtonEnabled(false); }); } }); @@ -144,7 +142,6 @@ private void uninstallModel() { this.model.getInstallationManger().uninstall(); SwingUtilities.invokeLater(() -> { listener.setGUIEnabled(true); - listener.setGoButtonEnabled(false); }); }); } @@ -152,8 +149,6 @@ private void uninstallModel() { public interface ModelDrawerPanelListener { void setGUIEnabled(boolean enabled); - - void setGoButtonEnabled(boolean installed); } } diff --git a/src/main/java/ai/nets/samj/ui/ConsumerInterface.java b/src/main/java/ai/nets/samj/ui/ConsumerInterface.java index 16de87f..bdccac9 100644 --- a/src/main/java/ai/nets/samj/ui/ConsumerInterface.java +++ b/src/main/java/ai/nets/samj/ui/ConsumerInterface.java @@ -71,6 +71,8 @@ public abstract class ConsumerInterface { public abstract void setFocusedImage(Object image); + public abstract void deselectImage(); + public void setModel(SAMModel model) { this.selectedModel = model; }