Skip to content

Commit 2afa860

Browse files
committed
ADD: ModelSelection.getModelByName(string model name) so that...
...derived GUIs can conveniently query a SAMModel from those available with the GUI
1 parent bce3441 commit 2afa860

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/ai/nets/samj/gui/ModelSelection.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ protected boolean isModelInstalled(String modelName) {
5151
return false;
5252
}
5353

54+
protected SAMModel getModelByName(String modelName) {
55+
for (SAMModel m : this.models) {
56+
if (m.getName().equals(modelName)) return m;
57+
}
58+
return null;
59+
}
60+
5461
protected JButton getButton() {
5562
return this.btn;
5663
}

0 commit comments

Comments
 (0)