From 7a86afb9ad2ea2fbacf632c723b8eb5324585d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Ulman?= Date: Wed, 18 Dec 2024 12:17:08 +0100 Subject: [PATCH] ADD: ModelSelection.isModelInstalled(string model name) so that... ...derived GUIs can conveniently query the state of the GUI'ed models --- src/main/java/ai/nets/samj/gui/ModelSelection.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/ai/nets/samj/gui/ModelSelection.java b/src/main/java/ai/nets/samj/gui/ModelSelection.java index e7bc442..5614d29 100644 --- a/src/main/java/ai/nets/samj/gui/ModelSelection.java +++ b/src/main/java/ai/nets/samj/gui/ModelSelection.java @@ -44,7 +44,14 @@ protected static ModelSelection create(List models, ModelSelectionList protected SAMModel getSelectedModel() { return selected; } - + + protected boolean isModelInstalled(String modelName) { + for (SAMModel m : this.models) { + if (m.getName().equals(modelName)) return m.isInstalled(); + } + return false; + } + protected JButton getButton() { return this.btn; }