Commit 2d1c00a6 authored by David Hoksza's avatar David Hoksza
Browse files

Annotators params tooltip help.

Decription attribute renamed to description
parent 54a99a17
......@@ -348,9 +348,6 @@ public class ModelAnnotator {
double counter = 0;
double amount = model.getElements().size() + model.getReactions().size();
logger.debug("annotatorsParams");
logger.debug(annotatorsParams);
// annotate all elements
for (Element element : model.getElements()) {
List<ElementAnnotator> list = null;
......
......@@ -9,14 +9,14 @@ package lcsb.mapviewer.annotation.services.annotators;
public class AnnotatorParamDefinition {
private String name;
private String decription;
private String description;
private Class<?> type;
public AnnotatorParamDefinition(String name, Class<?> type, String decription) {
public AnnotatorParamDefinition(String name, Class<?> type, String description) {
super();
this.name = name;
this.decription = decription;
this.description = description;
this.type = type;
}
......@@ -24,8 +24,8 @@ public class AnnotatorParamDefinition {
return name;
}
public String getDecription() {
return decription;
public String getDescription() {
return description;
}
public Class<?> getType() {
......
......@@ -222,14 +222,15 @@ public class KeggAnnotator extends ElementAnnotator implements IExternalService
if (params != null) {
String[] keggOrgnismCodes = params.get(0).getParamValue().trim().split(" +");
for (String code: keggOrgnismCodes) {
if (code.toUpperCase() != "ATH") {
logger.warn("KEGG annotator currently supports only ATH");
if (!code.equalsIgnoreCase("ATH")) {
logger.warn("KEGG annotator currently supports only ATH (" + code + " passed)" );
} else {
m = athOrthologMatcher.matcher(pageContent);
if (m.find()) {
String[] tairCodes = m.group(1).trim().split(" ");
for (String tairCode: tairCodes) {
tairCode = tairCode.split("\\(")[0]; //some codes are in the form AT1G08510(FATB)
logger.debug("Adding tair code " + tairCode);
result.add(createMiriamData(MiriamType.TAIR_LOCUS, tairCode));
}
}
......
......@@ -25,7 +25,7 @@ public class AnnotatorExceptionTest {
public void testConstructor() {
AnnotatorParamDefinition d = new AnnotatorParamDefinition("name", String.class, "description");
assertEquals(d.getName(), "name");
assertEquals(d.getDecription(), "description");
assertEquals(d.getDescription(), "description");
assertEquals(d.getType(), String.class);
}
......
......@@ -148,7 +148,7 @@ public class KeggAnnotatorTest extends AnnotationTestFunctions {
protein.setName("bla");
protein.addMiriamData(new MiriamData(MiriamType.UNIPROT, "Q42561"));
List<UserAnnotatorsParam> aps = new ArrayList<>();
aps.add(new UserAnnotatorsParam(String.class, "KEGG organism identifier", "ATH XXX"));
aps.add(new UserAnnotatorsParam(String.class, "KEGG organism identifier", "ATH AAA"));
keggAnnotator.annotateElement(protein, aps);
int cntTairs = 0;
......
......@@ -587,3 +587,21 @@ h1 {
font-weight: bold;
}
.minerva-annotator-param-name .annotator-tooltip {
visibility: hidden;
width: 50%;
background-color: rgba(0, 0, 0, .5);
color: #fff;
text-align: left;
border-radius: 6px;
padding: 5px;
/* Position the tooltip */
position: absolute;
z-index: 1;
}
.minerva-annotator-param-name:hover .annotator-tooltip {
visibility: visible;
}
......@@ -106,6 +106,7 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) {
var paramsDefs = annotator.getParametersDefinitions();
if (paramsDefs.length > 0) {
console.log('annotator', annotator);
annotatorsParams.appendChild(Functions.createElement({
type: "div",
......@@ -132,11 +133,21 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) {
className: "minerva-annotator-param"
});
paramElement.appendChild(Functions.createElement({
var paramName = Functions.createElement({
type: "div",
className: "minerva-annotator-param-name",
content: param.name
}));
});
console.log('param', param);
var toolTip = Functions.createElement({
type: "span",
className: "annotator-tooltip",
content: param.description
});
paramName.appendChild(toolTip)
paramElement.appendChild(paramName);
var paramValue;
......@@ -169,8 +180,8 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) {
paramValue.checked = (existingParamValue && existingParamValue === 'true');
} else {
throw new InvalidAlgorithmError("Unknown annotator parameter type");
}
}
paramElement.appendChild(paramValue);
annotatorParams.appendChild(paramElement);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment