Clover icon

Coverage Report

  1. Project Clover database Wed Dec 3 2025 17:03:17 GMT
  2. Package jalview.ws.jws2.jabaws2

File Jws2InstanceFactory.java

 

Coverage histogram

../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

4
13
6
1
106
52
9
0.69
2.17
6
1.5

Classes

Class Line # Actions
Jws2InstanceFactory 33 13 9
1.0100%
 

Contributing tests

This file is covered by 83 tests. .

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
7    * Jalview is free software: you can redistribute it and/or
8    * modify it under the terms of the GNU General Public License
9    * as published by the Free Software Foundation, either version 3
10    * of the License, or (at your option) any later version.
11    *
12    * Jalview is distributed in the hope that it will be useful, but
13    * WITHOUT ANY WARRANTY; without even the implied warranty
14    * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15    * PURPOSE. See the GNU General Public License for more details.
16    *
17    * You should have received a copy of the GNU General Public License
18    * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19    * The Jalview Authors are detailed in the 'AUTHORS' file.
20    */
21    package jalview.ws.jws2.jabaws2;
22   
23    import jalview.bin.ApplicationSingletonProvider;
24    import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
25   
26    import jalview.ws.uimodel.AlignAnalysisUIText;
27   
28    import java.util.HashMap;
29    import java.util.HashSet;
30   
31    import compbio.data.msa.JABAService;
32   
 
33    public class Jws2InstanceFactory implements ApplicationSingletonI
34    {
35   
 
36  7 toggle private Jws2InstanceFactory()
37    {
38    // private singleton
39    }
40   
 
41  2200 toggle private static Jws2InstanceFactory getInstance()
42    {
43  2200 return ApplicationSingletonProvider.getInstance(Jws2InstanceFactory.class);
44    }
45   
46    private HashMap<String, AlignAnalysisUIText> aaConGUI;
47   
48    private HashSet<String> ignoreGUI;
49   
 
50  550 toggle private static String category_rewrite(String cat_name)
51    {
52  550 return (cat_name != null && cat_name.equals("Prediction"))
53    ? "Secondary Structure Prediction"
54    : cat_name;
55    }
56   
 
57  1100 toggle private void init()
58    {
59  1100 if (aaConGUI == null)
60    {
61  7 aaConGUI = new HashMap<>();
62  7 aaConGUI.put(compbio.ws.client.Services.AAConWS.toString(),
63    AAConClient.getAlignAnalysisUIText());
64  7 aaConGUI.put(compbio.ws.client.Services.RNAalifoldWS.toString(),
65    RNAalifoldClient.getAlignAnalysisUIText());
66    // ignore list for JABAWS services not supported in jalview ...
67  7 ignoreGUI = new HashSet<>();
68    }
69    }
70   
71    /**
72    * exclusion list to avoid creating GUI elements for services we don't fully
73    * support
74    *
75    * @param serviceType
76    * @return
77    */
 
78  550 toggle public static boolean ignoreService(String serviceType)
79    {
80  550 getInstance().init();
81  550 return (getInstance().ignoreGUI.contains(serviceType.toString()));
82    }
83   
84    /**
85    * construct a service instance and configure it with any additional
86    * properties needed so Jalview can access it correctly
87    *
88    * @param jwsservers
89    * @param serviceType
90    * @param name
91    * @param description
92    * @param service
93    * @return
94    */
 
95  550 toggle public static Jws2Instance newJws2Instance(String jwsservers,
96    String serviceType, String name, String description,
97    JABAService service)
98    {
99  550 getInstance().init();
100  550 Jws2Instance svc = new Jws2Instance(jwsservers, serviceType,
101    category_rewrite(name), description, service);
102  550 svc.setAlignAnalysisUI(getInstance().aaConGUI.get(serviceType.toString()));
103  550 return svc;
104    }
105   
106    }