Skip to content

Commit

Permalink
Upgrade to 1.6.1
Browse files Browse the repository at this point in the history
Upgraded to use version 1.7.6 of ISAcreator.
Fixed issues with ontology browsing.
  • Loading branch information
eamonnmag committed Feb 6, 2014
1 parent c842367 commit 95ca865
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 90 deletions.
9 changes: 2 additions & 7 deletions Settings/settings.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
#settings
#Fri Oct 05 14:24:11 BST 2012
httpProxy.portNumber=
httpProxy.hostname=ASDA
httpProxy.usedLast=true
httpProxy.password=
httpProxy.useAuth=false
httpProxy.login=
#Thu Feb 06 17:12:39 GMT 2014
java.version=1.6.0_65
6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.isatools</groupId>
<artifactId>ISACreatorConfigurator</artifactId>
<packaging>jar</packaging>
<version>1.6</version>
<version>1.6.1</version>
<name>ISACreator Configurator</name>
<url>http://isa-tools.org/isaconfig.html</url>

Expand Down Expand Up @@ -263,9 +263,11 @@
<dependency>
<groupId>org.isatools</groupId>
<artifactId>ISAcreator</artifactId>
<version>1.7.3</version>
<version>1.7.6</version>

</dependency>


<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@ the UK BBSRC (http://www.bbsrc.ac.uk), the UK NERC-NEBC (http://nebc.nerc.ac.uk)
import org.isatools.isacreator.effects.components.RoundedFormattedTextField;
import org.isatools.isacreator.effects.components.RoundedJTextArea;
import org.isatools.isacreator.effects.components.RoundedJTextField;
import org.isatools.isacreator.ontologymanager.BioPortalClient;
import org.isatools.isacreator.ontologymanager.OLSClient;
import org.isatools.isacreator.ontologymanager.BioPortal4Client;
import org.isatools.isacreator.ontologymanager.OntologyService;
import org.isatools.isacreator.ontologyselectiontool.OntologySelectionTool;
import org.isatools.isacreatorconfigurator.ontologyconfigurationtool.OntologyConfigUI;
import org.isatools.isatab.configurator.schema.UnitFieldType;
import org.isatools.isatab.configurator.schema.impl.UnitFieldTypeImpl;

import org.jdesktop.fuse.InjectedResource;
import org.jdesktop.fuse.ResourceInjector;

Expand Down Expand Up @@ -131,15 +129,12 @@ public class FieldInterface extends JLayeredPane implements ActionListener,
private FieldElement field;

static {
OntologyService bpc = new BioPortalClient();
OntologyService bpc = new BioPortal4Client();
ontologiesToQuery = new ArrayList<Ontology>();
if (bpc.getAllOntologies() != null) {
ontologiesToQuery.addAll(bpc.getAllOntologies());
}

OntologyService olsClient = new OLSClient();

ontologiesToQuery.addAll(olsClient.getAllOntologies());
ontologyColumnHeaders = new String[]{"ontology", "search under"};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ ISAconfigurator is a component of the ISA software suite (http://www.isa-tools.o
ISAconfigurator is licensed under the Common Public Attribution License version 1.0 (CPAL)
EXHIBIT A. CPAL version 1.0
ÒThe contents of this file are subject to the CPAL version 1.0 (the ÒLicenseÓ); you may not use this file except
�The contents of this file are subject to the CPAL version 1.0 (the �License�); you may not use this file except
in compliance with the License. You may obtain a copy of the License at http://isa-tools.org/licenses/ISAconfigurator-license.html.
The License is based on the Mozilla Public License version 1.1 but Sections 14 and 15 have been added to cover use of software over
a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be
consistent with Exhibit B.
Software distributed under the License is distributed on an ÒAS ISÓ basis, WITHOUT WARRANTY OF ANY KIND, either express
Software distributed under the License is distributed on an �AS IS� basis, WITHOUT WARRANTY OF ANY KIND, either express
or implied. See the License for the specific language governing rights and limitations under the License.
The Original Code is ISAconfigurator.
Expand Down Expand Up @@ -87,7 +87,7 @@ public class OntologyBrowser extends JPanel implements TreeObserver, TreeSubject
*
* @param ontologyToQuery - the Ontology object representing the Ontology to be queried
*/
public OntologyBrowser(Ontology ontologyToQuery, OntologyService ontologyClient, Dimension browserSize) {
public OntologyBrowser(Ontology ontologyToQuery, Dimension browserSize) {
this.ontologyToQuery = ontologyToQuery;
this.browserSize = browserSize;
this.observers = new ArrayList<TreeObserver>();
Expand All @@ -99,8 +99,7 @@ private void instantiate() {
// add event change listener to detect when nodes are being selected in the tree. we can then update the definition in
// the ViewTermDefinitionUI to show the currently selected term.

ontologyTreeCreator = ontologyToQuery.getFormat() == OntologyFormats.OBO ? new WSOntologyTreeCreator(this, ontologyTree) :
new WSOntologyTreeCreator(this, ontologyTree);
ontologyTreeCreator = new WSOntologyTreeCreator(this, ontologyTree);

((WSOntologyTreeCreator) ontologyTreeCreator).registerObserver(this);

Expand All @@ -116,6 +115,12 @@ private void createGUI() {
DefaultMutableTreeNode root;

try {
System.out.println("Querying... ");
System.out.println(ontologyToQuery.getOntologyAbbreviation());
System.out.println(ontologyToQuery.getOntologyID());

System.out.println();
ontologyToQuery.setOntologyVersion(ontologyToQuery.getOntologyAbbreviation());
root = ontologyTreeCreator.createTree(Collections.singletonMap(ontologyToQuery.getOntologyAbbreviation(), new RecommendedOntology(ontologyToQuery, null)));
ontologyTree.setModel(new DefaultTreeModel(root));
} catch (FileNotFoundException e) {
Expand All @@ -124,8 +129,6 @@ private void createGUI() {
log.error(re.getMessage());
}



ontologyTree.setCellRenderer(new OntologyTreeRenderer());
ontologyTree.setShowsRootHandles(false);

Expand Down Expand Up @@ -167,7 +170,6 @@ public void mousePressed(MouseEvent mouseEvent) {
}
}
}

});

JScrollPane ontologyTreeScroller = new JScrollPane(ontologyTree, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
Expand All @@ -184,8 +186,6 @@ public void mousePressed(MouseEvent mouseEvent) {
selectedTreePartInfo = UIHelper.createLabel("", UIHelper.VER_11_PLAIN, UIHelper.DARK_GREEN_COLOR, SwingConstants.LEFT);
selectedTreePartInfoCont.add(selectedTreePartInfo);
add(selectedTreePartInfoCont, BorderLayout.SOUTH);


}

private JPanel createInfoPanel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ ISAconfigurator is a component of the ISA software suite (http://www.isa-tools.o
ISAconfigurator is licensed under the Common Public Attribution License version 1.0 (CPAL)
EXHIBIT A. CPAL version 1.0
ÒThe contents of this file are subject to the CPAL version 1.0 (the ÒLicenseÓ); you may not use this file except
�The contents of this file are subject to the CPAL version 1.0 (the �License�); you may not use this file except
in compliance with the License. You may obtain a copy of the License at http://isa-tools.org/licenses/ISAconfigurator-license.html.
The License is based on the Mozilla Public License version 1.1 but Sections 14 and 15 have been added to cover use of software over
a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be
consistent with Exhibit B.
Software distributed under the License is distributed on an ÒAS ISÓ basis, WITHOUT WARRANTY OF ANY KIND, either express
Software distributed under the License is distributed on an �AS IS� basis, WITHOUT WARRANTY OF ANY KIND, either express
or implied. See the License for the specific language governing rights and limitations under the License.
The Original Code is ISAconfigurator.
Expand Down Expand Up @@ -39,6 +39,7 @@ the UK BBSRC (http://www.bbsrc.ac.uk), the UK NERC-NEBC (http://nebc.nerc.ac.uk)
import com.explodingpixels.macwidgets.IAppWidgetFactory;
import org.apache.commons.collections15.map.ListOrderedMap;
import org.isatools.isacreator.autofilteringlist.ExtendedJList;
import org.isatools.isacreator.common.CommonMouseAdapter;
import org.isatools.isacreator.common.UIHelper;
import org.isatools.isacreator.configuration.Ontology;
import org.isatools.isacreator.configuration.RecommendedOntology;
Expand All @@ -47,11 +48,8 @@ the UK BBSRC (http://www.bbsrc.ac.uk), the UK NERC-NEBC (http://nebc.nerc.ac.uk)
import org.isatools.isacreator.effects.InfiniteProgressPanel;
import org.isatools.isacreator.effects.borders.RoundedBorder;
import org.isatools.isacreator.ontologybrowsingutils.TreeObserver;
import org.isatools.isacreator.ontologymanager.BioPortalClient;
import org.isatools.isacreator.ontologymanager.OLSClient;
import org.isatools.isacreator.ontologymanager.BioPortal4Client;
import org.isatools.isacreator.ontologymanager.OntologyService;
import org.isatools.isacreator.ontologymanager.bioportal.model.OntologyPortal;
import org.isatools.isacreator.ontologymanager.utils.OntologyUtils;
import org.isatools.isacreatorconfigurator.configui.notifications.NotificationWindow;
import org.jdesktop.fuse.InjectedResource;
import org.jdesktop.fuse.ResourceInjector;
Expand Down Expand Up @@ -80,8 +78,7 @@ the UK BBSRC (http://www.bbsrc.ac.uk), the UK NERC-NEBC (http://nebc.nerc.ac.uk)

public class OntologyConfigUI extends JFrame {

private static final BioPortalClient bioportalClient = new BioPortalClient();
private static final OLSClient olsClient = new OLSClient();
private static final BioPortal4Client bioportalClient = new BioPortal4Client();

@InjectedResource
private ImageIcon infoImage, confirmButton, confirmButtonOver, addOntologyButtonIcon, addOntologyButtonIconOver,
Expand Down Expand Up @@ -328,7 +325,7 @@ public void mousePressed(MouseEvent mouseEvent) {

if (!selectedOntologyList.isSelectionEmpty()) {
String ontologyToRemove = selectedOntologyList.getSelectedValue().toString();
System.out.println("Removing " + ontologyToRemove);

selectedOntologies.remove(ontologyToRemove);
setOntologySelectionPanelPlaceholder(infoImage);

Expand All @@ -352,20 +349,23 @@ public void mouseExited(MouseEvent mouseEvent) {
removeOntologyButton.setVisible(false);

viewOntologyButton = new JLabel(browseOntologyButtonIcon);
viewOntologyButton.addMouseListener(new MouseAdapter() {
viewOntologyButton.addMouseListener(new CommonMouseAdapter() {
@Override
public void mousePressed(MouseEvent mouseEvent) {
performTransition();
super.mousePressed(mouseEvent);
doOntologyDisplay();
viewOntologyButton.setIcon(browseOntologyButtonIcon);
}

@Override
public void mouseEntered(MouseEvent mouseEvent) {
super.mouseEntered(mouseEvent);
viewOntologyButton.setIcon(browseOntologyButtonIconOver);
}

@Override
public void mouseExited(MouseEvent mouseEvent) {
super.mouseExited(mouseEvent);
viewOntologyButton.setIcon(browseOntologyButtonIcon);
}
});
Expand Down Expand Up @@ -464,11 +464,10 @@ public void propertyChange(PropertyChangeEvent propertyChangeEvent) {

if (ontologiesToBrowseOn == null) {
ontologiesToBrowseOn = new ArrayList<Ontology>();
List<Ontology> bioportalQueryResult = bioportalClient.getAllOntologies();
Collection<Ontology> bioportalQueryResult = bioportalClient.getAllOntologies();
if (bioportalQueryResult != null) {
ontologiesToBrowseOn.addAll(bioportalQueryResult);
}
ontologiesToBrowseOn.addAll(olsClient.getAllOntologies());
}

// precautionary check in case of having no ontologies available to search on.
Expand Down Expand Up @@ -527,7 +526,7 @@ private void updateSelectedOntologies() {
repaint();
}

private void performTransition() {
private void doOntologyDisplay() {

Thread performer = new Thread(new Runnable() {
public void run() {
Expand All @@ -553,15 +552,10 @@ public void run() {
ontology.setSubsectionToQuery(selectedOntologies.get(ontology.getOntologyDisplayLabel()).getBranchToSearchUnder());
}

if (OntologyUtils.getSourceOntologyPortal(ontology) == OntologyPortal.BIOPORTAL) {
currentlyActiveBrowser = new OntologyBrowser(ontology, bioportalClient, getMaxBrowserSize());
configureSearchAndTermDefinitionPanel(ontology, bioportalClient);
ontologyViewContainer.add(currentlyActiveBrowser);
} else {
currentlyActiveBrowser = new OntologyBrowser(ontology, olsClient, getMaxBrowserSize());
configureSearchAndTermDefinitionPanel(ontology, olsClient);
ontologyViewContainer.add(currentlyActiveBrowser);
}

currentlyActiveBrowser = new OntologyBrowser(ontology, getMaxBrowserSize());
configureSearchAndTermDefinitionPanel(ontology, bioportalClient);
ontologyViewContainer.add(currentlyActiveBrowser);

currentlyActiveBrowser.setPreferredSize(getMaxBrowserSize());
glassPane.stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ ISAconfigurator is a component of the ISA software suite (http://www.isa-tools.o
ISAconfigurator is licensed under the Common Public Attribution License version 1.0 (CPAL)
EXHIBIT A. CPAL version 1.0
ÒThe contents of this file are subject to the CPAL version 1.0 (the ÒLicenseÓ); you may not use this file except
�The contents of this file are subject to the CPAL version 1.0 (the �License�); you may not use this file except
in compliance with the License. You may obtain a copy of the License at http://isa-tools.org/licenses/ISAconfigurator-license.html.
The License is based on the Mozilla Public License version 1.1 but Sections 14 and 15 have been added to cover use of software over
a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be
consistent with Exhibit B.
Software distributed under the License is distributed on an ÒAS ISÓ basis, WITHOUT WARRANTY OF ANY KIND, either express
Software distributed under the License is distributed on an �AS IS� basis, WITHOUT WARRANTY OF ANY KIND, either express
or implied. See the License for the specific language governing rights and limitations under the License.
The Original Code is ISAconfigurator.
Expand Down Expand Up @@ -58,8 +58,7 @@ public class OntologyListRenderer extends JPanel
static Color listForeground = UIHelper.DARK_GREEN_COLOR;

@InjectedResource
private ImageIcon olsIcon, bioPortalIcon;

private ImageIcon bioPortalIcon;

private JLabel icon;
private JLabel text;
Expand All @@ -72,7 +71,7 @@ public OntologyListRenderer() {

setLayout(new BorderLayout());

icon = new JLabel(olsIcon);
icon = new JLabel(bioPortalIcon);
add(icon, BorderLayout.WEST);

text = UIHelper.createLabel("", UIHelper.VER_10_PLAIN, listForeground);
Expand All @@ -99,12 +98,6 @@ public Component getListCellRendererComponent(JList jList, Object val,
Ontology o = (Ontology) val;

// ols versions are now like Jun 2010 rather than their previous version format 1.26
if (o.getOntologyVersion().length() > 5) {
icon.setIcon(olsIcon);
} else {
icon.setIcon(bioPortalIcon);
}

stringRepresentation = o.getOntologyAbbreviation() + " - " + o.getOntologyDisplayLabel();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ ISAconfigurator is a component of the ISA software suite (http://www.isa-tools.o
ISAconfigurator is licensed under the Common Public Attribution License version 1.0 (CPAL)
EXHIBIT A. CPAL version 1.0
ÒThe contents of this file are subject to the CPAL version 1.0 (the ÒLicenseÓ); you may not use this file except
�The contents of this file are subject to the CPAL version 1.0 (the �License�); you may not use this file except
in compliance with the License. You may obtain a copy of the License at http://isa-tools.org/licenses/ISAconfigurator-license.html.
The License is based on the Mozilla Public License version 1.1 but Sections 14 and 15 have been added to cover use of software over
a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be
consistent with Exhibit B.
Software distributed under the License is distributed on an ÒAS ISÓ basis, WITHOUT WARRANTY OF ANY KIND, either express
Software distributed under the License is distributed on an �AS IS� basis, WITHOUT WARRANTY OF ANY KIND, either express
or implied. See the License for the specific language governing rights and limitations under the License.
The Original Code is ISAconfigurator.
Expand All @@ -38,13 +38,11 @@ the UK BBSRC (http://www.bbsrc.ac.uk), the UK NERC-NEBC (http://nebc.nerc.ac.uk)

import org.isatools.isacreator.common.UIHelper;
import org.isatools.isacreator.configuration.Ontology;
import org.isatools.isacreator.configuration.OntologyBranch;
import org.isatools.isacreator.ontologybrowsingutils.OntologyTreeCreator;
import org.isatools.isacreator.ontologybrowsingutils.OntologyTreeItem;
import org.isatools.isacreator.ontologybrowsingutils.TreeObserver;
import org.isatools.isacreator.ontologybrowsingutils.WSOntologyTreeCreator;
import org.isatools.isacreator.ontologymanager.BioPortalClient;
import org.isatools.isacreator.ontologymanager.OLSClient;
import org.isatools.isacreator.ontologymanager.BioPortal4Client;
import org.isatools.isacreator.ontologymanager.OntologyService;
import org.isatools.isacreator.ontologymanager.common.OntologyTerm;
import org.jdesktop.fuse.InjectedResource;
Expand Down Expand Up @@ -254,7 +252,7 @@ public void setOntologyClient(OntologyService ontologyClient) {

public OntologyService getOntologyClient() {
if (ontologyClient == null) {
ontologyClient = ontologyTreeCreator instanceof WSOntologyTreeCreator ? new OLSClient() : new BioPortalClient();
ontologyClient = new BioPortal4Client();
}
return ontologyClient;
}
Expand Down
Loading

0 comments on commit 95ca865

Please sign in to comment.