From 2afa860322cf1d9bc95e7e33d84af83f7760faae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Ulman?= Date: Wed, 18 Dec 2024 15:53:08 +0100 Subject: [PATCH] ADD: ModelSelection.getModelByName(string model name) so that... ...derived GUIs can conveniently query a SAMModel from those available with the GUI --- src/main/java/ai/nets/samj/gui/ModelSelection.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/ai/nets/samj/gui/ModelSelection.java b/src/main/java/ai/nets/samj/gui/ModelSelection.java index ee0ad77..16d524b 100644 --- a/src/main/java/ai/nets/samj/gui/ModelSelection.java +++ b/src/main/java/ai/nets/samj/gui/ModelSelection.java @@ -51,6 +51,13 @@ protected boolean isModelInstalled(String modelName) { return false; } + protected SAMModel getModelByName(String modelName) { + for (SAMModel m : this.models) { + if (m.getName().equals(modelName)) return m; + } + return null; + } + protected JButton getButton() { return this.btn; }