Skip to content

Commit 7a86afb

Browse files
committed
ADD: ModelSelection.isModelInstalled(string model name) so that...
...derived GUIs can conveniently query the state of the GUI'ed models
1 parent 11cb72a commit 7a86afb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ protected static ModelSelection create(List<SAMModel> models, ModelSelectionList
4444
protected SAMModel getSelectedModel() {
4545
return selected;
4646
}
47-
47+
48+
protected boolean isModelInstalled(String modelName) {
49+
for (SAMModel m : this.models) {
50+
if (m.getName().equals(modelName)) return m.isInstalled();
51+
}
52+
return false;
53+
}
54+
4855
protected JButton getButton() {
4956
return this.btn;
5057
}

0 commit comments

Comments
 (0)