Search in sources :

Example 1 with Attribute

use of org.cytoscape.property.bookmark.Attribute in project cytoscape-impl by cytoscape.

the class OntologyPanelBuilder method setAnnotationComboBox.

@SuppressWarnings("unchecked")
protected void setAnnotationComboBox() throws JAXBException, IOException {
    final CyProperty<Bookmarks> bookmarksProp = serviceRegistrar.getService(CyProperty.class, "(cyPropertyName=bookmarks)");
    final BookmarksUtil bkUtil = serviceRegistrar.getService(BookmarksUtil.class);
    final Bookmarks bookmarks = bookmarksProp.getProperties();
    final List<DataSource> annotations = bkUtil.getDataSourceList("annotation", bookmarks.getCategory());
    String key = null;
    panel.annotationComboBox.addItem(DEF_ANNOTATION_ITEM);
    for (DataSource source : annotations) {
        key = source.getName();
        panel.annotationComboBox.addItem(key);
        annotationUrlMap.put(key, source.getHref());
        annotationFormatMap.put(key, source.getFormat());
        final Map<String, String> attrMap = new HashMap<String, String>();
        for (Attribute attr : source.getAttribute()) attrMap.put(attr.getName(), attr.getContent());
        annotationAttributesMap.put(key, attrMap);
    }
    panel.annotationComboBox.setToolTipText(getAnnotationTooltip());
}
Also used : Bookmarks(org.cytoscape.property.bookmark.Bookmarks) HashMap(java.util.HashMap) Attribute(org.cytoscape.property.bookmark.Attribute) BookmarksUtil(org.cytoscape.property.bookmark.BookmarksUtil) DataSource(org.cytoscape.property.bookmark.DataSource)

Aggregations

HashMap (java.util.HashMap)1 Attribute (org.cytoscape.property.bookmark.Attribute)1 Bookmarks (org.cytoscape.property.bookmark.Bookmarks)1 BookmarksUtil (org.cytoscape.property.bookmark.BookmarksUtil)1 DataSource (org.cytoscape.property.bookmark.DataSource)1