Skip to content
Snippets Groups Projects
Commit ba236a78 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

api returns info about hierarchy visibility

parent 665cddbb
No related branches found
No related tags found
1 merge request!5Frontend refactor
......@@ -344,6 +344,8 @@ public class ProjectRestImpl {
value = StringUtils.join(ids, ",");
} else if (column.equals("type")) {
value = reaction.getStringType();
} else if (column.equals("hierarchyvisibilitylevel")) {
value = reaction.getVisibilityLevel();
} else if (column.equals("lines")) {
value = new LightReactionView(reaction).getLines();
} else {
......@@ -383,6 +385,8 @@ public class ProjectRestImpl {
value = element.getNotes();
} else if (column.equals("formersymbols")) {
value = element.getFormerSymbols();
} else if (column.equals("hierarchyvisibilitylevel")) {
value = element.getVisibilityLevel();
} else if (column.equals("bounds")) {
value = new Rectangle2D.Double(element.getX(), element.getY(), element.getWidth(), element.getHeight());
} else {
......@@ -411,6 +415,7 @@ public class ProjectRestImpl {
columnsSet.add("formerSymbols");
columnsSet.add("references");
columnsSet.add("bounds");
columnsSet.add("hierarchyVisibilityLevel");
} else {
for (String str : columns.split(",")) {
columnsSet.add(str);
......@@ -431,6 +436,7 @@ public class ProjectRestImpl {
columnsSet.add("products");
columnsSet.add("reactants");
columnsSet.add("modifiers");
columnsSet.add("hierarchyVisibilityLevel");
} else {
for (String str : columns.split(",")) {
columnsSet.add(str);
......
......@@ -147,6 +147,8 @@ public class FullAliasView extends LightAliasView implements IHeavyView {
*/
private Integer initialAmount = null;
private Integer visibilityLevel = null;
/**
* Initial concentration of species.
*
......@@ -231,6 +233,7 @@ public class FullAliasView extends LightAliasView implements IHeavyView {
setSymbol(element.getSymbol());
addSynonyms(element.getSynonyms());
setType(element.getStringType());
setVisibilityLevel(element.getVisibilityLevel());
if (element instanceof Species) {
Species species = (Species) element;
setCharge(species.getCharge());
......@@ -609,4 +612,20 @@ public class FullAliasView extends LightAliasView implements IHeavyView {
public void setSubmodelId(String submodelId) {
this.submodelId = submodelId;
}
/**
* @return the visibilityLevel
* @see #visibilityLevel
*/
public Integer getVisibilityLevel() {
return visibilityLevel;
}
/**
* @param visibilityLevel the visibilityLevel to set
* @see #visibilityLevel
*/
public void setVisibilityLevel(Integer visibilityLevel) {
this.visibilityLevel = visibilityLevel;
}
}
......@@ -33,12 +33,12 @@ public class FullReactionView extends LightReactionView implements IHeavyView {
/**
* List of reaction annotations.
*/
private List<AnnotationView> references = new ArrayList<AnnotationView>();
private List<AnnotationView> references = new ArrayList<>();
/**
* List of markers to which this reaction refers to.
*/
private List<FullAliasView> elements = new ArrayList<FullAliasView>();
private List<FullAliasView> elements = new ArrayList<>();
/**
* Submodel to which this reaction points.
......@@ -118,7 +118,7 @@ public class FullReactionView extends LightReactionView implements IHeavyView {
*
* @see Reaction#synonyms
*/
private List<String> synonyms = new ArrayList<String>();
private List<String> synonyms = new ArrayList<>();
/**
* List of other unstructurized feuters, specific for some subclases of Alias.
......@@ -126,6 +126,8 @@ public class FullReactionView extends LightReactionView implements IHeavyView {
*/
private Map<String, Object> other = new HashMap<>();
private Integer visibilityLevel = null;
/**
* Default constructor with localization passed in the argument.
*
......@@ -140,6 +142,8 @@ public class FullReactionView extends LightReactionView implements IHeavyView {
if (reaction.getModelData() != null) {
setModelId(reaction.getModelData().getId());
}
setVisibilityLevel(reaction.getVisibilityLevel());
symbol = reaction.getSymbol();
abbreviation = reaction.getAbbreviation();
formula = reaction.getFormula();
......@@ -418,4 +422,20 @@ public class FullReactionView extends LightReactionView implements IHeavyView {
this.other = other;
}
/**
* @return the visibilityLevel
* @see #visibilityLevel
*/
public Integer getVisibilityLevel() {
return visibilityLevel;
}
/**
* @param visibilityLevel the visibilityLevel to set
* @see #visibilityLevel
*/
public void setVisibilityLevel(Integer visibilityLevel) {
this.visibilityLevel = visibilityLevel;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment