Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
Conflicts:
	portal.ejb/src/main/java/org/vamdc/portal/session/queryLog/QueryStoreProcessor.java
  • Loading branch information
nicolasmoreau committed Jul 3, 2017
2 parents 359d749 + fb89e38 commit 0d2214f
Show file tree
Hide file tree
Showing 32 changed files with 200 additions and 176 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ private Integer requestableFormsCount(){
public List<Form> getForms() {
List<Form> forms= new ArrayList<Form>();
forms = this.getQueryData().getOrderedGuidedForm();
//return queryData.getUnsortedForms();
return forms;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.vamdc.portal.session.queryBuilder.unitConv.UnitConverter;

/**
* Field that proxies several range fields and does intercorversion into the primary one
* Field that proxies several range fields and does interconversion into the primary one
* @author doronin
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public abstract class SuggestionImpl implements SuggestionField.Suggestion{
* @return a collection that will be used for suggestion lookup
*/
protected abstract Collection<String> loadValues();

protected final Collection<String> values;
protected Collection<String> values;

public SuggestionImpl(){
this.values= loadValues();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ public class ProcessNameSuggest extends SuggestionImpl{
@Override
protected Collection<String> loadValues() {
Collection<String> result = new ArrayList<String>();
for (XsamsProcessCode code:XsamsProcessCode.values())
for (XsamsProcessCode code:XsamsProcessCode.values()){;
result.add(code.getProcessName());
}
return result;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.vamdc.portal.session.queryBuilder.formsTree;

import org.vamdc.portal.session.queryBuilder.QueryTreeInterface;
import org.vamdc.portal.session.queryBuilder.fields.AbstractField;
import org.vamdc.portal.session.queryBuilder.forms.FormForFields;
import org.vamdc.portal.session.queryBuilder.forms.AtomsForm;
import org.vamdc.portal.session.queryBuilder.forms.Order;
Expand All @@ -13,14 +12,13 @@ public class AtomsTreeForm extends AtomsForm implements FormForFields, TreeFormI
private static final long serialVersionUID = 5992593235932991330L;
protected Integer position;
private QueryTreeInterface tree;

public AtomsTreeForm(QueryTreeInterface tree) {
//super(tree);
this.tree = tree;
position = tree.getFormCount();
}

public AtomsTreeForm(QueryTreeInterface tree, String prefix) {
//super(tree);
this.tree = tree;
this.setPrefix(prefix);
position = tree.getFormCount();
Expand All @@ -30,32 +28,20 @@ public String getObject(){
return this.toString();
}

/*@Override
public String getView() {
return "/xhtml/query/queryTree/atomsForm.xhtml";
}*/

@Override
public void validate() {
// TODO Auto-generated method stub
tree.addForm(this);
}


@Override
public void fieldUpdated(AbstractField field) {
// TODO Auto-generated method stub
}

@Override
public Integer getOrder() {
// TODO Auto-generated method stub
return Order.Atoms;
}

@Override
public Boolean getQueryable() {
// TODO Auto-generated method stub
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class CollisionTreeForm extends CollisionsForm implements FormForFields,
private Boolean queryable = true;
private SearchMode selectedMode = SearchMode.withoutReaction;
private QueryTreeInterface tree;
private final String defaultSubmitButtonValue = "Select target(s) and collider(s)";
private String defaultSubmitButtonValue = "Select targets and colliders";
private String submitButtonValue = defaultSubmitButtonValue;


Expand Down Expand Up @@ -139,7 +139,7 @@ public void changeCollisionType(ValueChangeEvent e){
break;

case withReaction:
this.submitButtonValue = "Select reactant(s) and product(s)";
this.submitButtonValue = "Select reactants and products";
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ private enum NextForm{
private static final long serialVersionUID = 1L;
{
add(new SelectItem(NextForm.upperLowerEnergyRange,"Transition from an energy range to another one"));
//add(new SelectItem(NextForm.stateEnergyRange,"Transition to and from a given energy range"));
add(new SelectItem(NextForm.anyEnergyRange,"Any transition"));
}
};
Expand All @@ -67,9 +66,7 @@ public String getView() {
public void validate() {
if (this.selectedMode == null)
return;

//System.err.println("Adding next form "+selectedMode.name());


switch(this.selectedMode){
case upperLowerEnergyRange:
tree.addForm(new AllStatesEnergyTreeForm(tree));
Expand Down Expand Up @@ -129,12 +126,13 @@ public String getSubmitButtonValue(){

public void changeTransitionType(ValueChangeEvent e){
NextForm value = (NextForm)e.getNewValue();
String submitButton = "Select range";
switch(value){
case upperLowerEnergyRange:
this.submitButtonValue = "Configure energy range";
this.submitButtonValue = submitButton;
break;
case stateEnergyRange:
this.submitButtonValue = "Configure energy range";
this.submitButtonValue = submitButton;
break;
case anyEnergyRange:
this.submitButtonValue = this.defaultSubmitButtonValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public abstract class ReactionCollisionForm extends AbstractForm implements Form
private QueryTreeInterface tree;
private Boolean queryable = true;

//private Boolean hasHiddenForm = false;

private String typeAName;
private String typeBName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public WavelengthUnitConverter() {
private static final long serialVersionUID = 3599889437685237848L;

enum WavelengthConvert implements AbstractUnitConverter.EnumConverter{

ANGSTROM("A",NonSI.ANGSTROM.getConverterTo(NonSI.ANGSTROM)),
NM("nm",METRE.times(1e-9).getConverterTo(NonSI.ANGSTROM)),
UM("um",METRE.times(1e-6).getConverterTo(NonSI.ANGSTROM)),
Expand All @@ -24,6 +25,7 @@ enum WavelengthConvert implements AbstractUnitConverter.EnumConverter{
WavelengthConvert(String display,javax.measure.converter.UnitConverter converter){
this.display = display;
this.convert = converter;
javax.measure.converter.UnitConverter c = METRE.times(1e-3).getConverterTo(NonSI.ANGSTROM);
}

private javax.measure.converter.UnitConverter convert;
Expand All @@ -32,12 +34,19 @@ enum WavelengthConvert implements AbstractUnitConverter.EnumConverter{
public String getDisplay() { return display; }

@Override
public Double convert(Double value) { return convert.convert(value); }
public Double convert(Double value) {
// return int value of double if value is an integer
// to prevent trailing decimal values (i.e 1.00000000001)
if((value - Math.round(value)) == 0 ){
return new Double(Math.round(convert.convert(value)));
}else{
return convert.convert(value);
}
}

@Override
public EnumConverter[] getValues() { return WavelengthConvert.values(); }


}

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public QueryStoreResponse getResponse() {
} catch (InterruptedException e) {
log.debug(e);
result = new QueryStoreResponse(QueryStoreResponse.STATUS_ERROR, "", e.getMessage());
} catch (ExecutionException e) {
} catch (ExecutionException e) {
log.debug(e);
result = new QueryStoreResponse(QueryStoreResponse.STATUS_ERROR, "", e.getMessage());
}catch (NullPointerException e) {
Expand Down
Binary file added portal.war/src/main/webapp/img/vamdc_logo_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
3 changes: 2 additions & 1 deletion portal.war/src/main/webapp/layout/template.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a="http://richfaces.org/a4j"
xmlns:s="http://jboss.com/products/seam/taglib" contentType="text/html">
contentType="text/html">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Expand Down
28 changes: 12 additions & 16 deletions portal.war/src/main/webapp/queryTree.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,29 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:rich="http://richfaces.org/rich"
template="/layout/template.xhtml">


<ui:define name="body">
<c:if test="#{disclaimer.value == false}">
<ui:include src="/xhtml/disclaimer/disclaimerValidation.xhtml" />
<ui:include src="/xhtml/disclaimer/disclaimerValidation.xhtml" />
</c:if>
<c:if test="#{disclaimer.value == true}">
<a4j:outputPanel width="460" id="formPanel">
<h:panelGrid>
<a4j:outputPanel id="formPanel">
<h:panelGrid width="50%">
<c:forEach items="#{queryTree.forms}" var="form">
<a4j:include viewId="#{form.view}" />
</c:forEach>
<rich:spacer width="460" />
</c:forEach>

</h:panelGrid>
<a4j:outputPanel width="460" id="buttons">
<ui:include src="/xhtml/query/queryTree/actionButtons.xhtml" />
</a4j:outputPanel>

</a4j:outputPanel>
<a4j:outputPanel id="nodeTree">
<rich:spacer width="460" />
<a4j:outputPanel id="buttons">
<ui:include src="/xhtml/query/queryTree/actionButtons.xhtml" />
</a4j:outputPanel>

</a4j:outputPanel>
<a4j:outputPanel id="asyncForm" />
</c:if>
</ui:define>

Expand Down
32 changes: 23 additions & 9 deletions portal.war/src/main/webapp/stylesheet/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ table.radio input[type=radio] {
}

.content {
padding: 1%;
padding: 0.5em;
width : 100%;
}

Expand All @@ -116,7 +116,7 @@ table.radio input[type=radio] {
margin-left:5px;
}
.narrowfield{
width: 70px;
width: 60px;
margin-top:0px;
margin-bottom:0px;
margin-right:5px;
Expand All @@ -140,10 +140,10 @@ table.radio input[type=radio] {
}

.rightColumn {
width: 250px;
align: right;
width: 270px;
/*align: right;
text-align: right;
float: right;
float: right;*/
}

.queryMenuPanel{
Expand Down Expand Up @@ -180,7 +180,7 @@ table.radio input[type=radio] {
.queryForms{
height: 100%;
vertical-align: top;
width : 410px;
width : 460px;
/*max-width : 410px;*/
}

Expand Down Expand Up @@ -270,19 +270,33 @@ table.radio input[type=radio] {
background-color: inherit;
}

.collisionSpecies{
.collisionSpeciesText{
text-decoration:none;
border-bottom:1px dotted #D4CFC7;
}


.collisionSpeciesSelectionForm{
width : 49%;
float : left;
}


.roundButton {
-moz-border-radius: 10px;
border-radius: 10px;
}

.largeButton{
width : 100px;
width : 110px;
font-weight : bold;
padding : 1px;
}

.largerButton{
width : 220px;
font-weight : bold;
padding : 1px;
}

.buttonArea .largeButton{
Expand Down Expand Up @@ -411,4 +425,4 @@ table.radio input[type=radio] {
.important{
text-decoration : underline;
font-weight : bold;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
</h:selectOneMenu>
</h:panelGroup>
<h:panelGroup>
<rich:spacer width="" />
<h:inputText value="#{field.userLoValue}" styleClass="narrowfield" tabindex="10">
<a4j:support event="onkeyup" reRender="nodeTree,buttonArea,conv#{field.id}"/>
</h:inputText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
</h:outputText>
</h:panelGroup>
<h:panelGroup>
<rich:spacer width="10" />
<h:inputText value="#{field.loValue}" styleClass="narrowfield" tabindex="10">
<a4j:support event="onkeyup" reRender="nodeTree,buttonArea"/>
</h:inputText>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
Expand Down Expand Up @@ -43,7 +44,7 @@
</f:facet>

<h:column>
<h:outputText value="#{species.title}" id="cspecies#{species.id}" styleClass="collisionSpecies">
<h:outputText value="#{species.title}" id="cspecies#{species.id}" styleClass="collisionSpeciesText">
<rich:toolTip value="#{species.summary}" styleClass="toolTip"
direction="bottom-left" />
</h:outputText>
Expand Down
10 changes: 5 additions & 5 deletions portal.war/src/main/webapp/xhtml/query/forms/moleculesForm.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
<ui:include src="/xhtml/query/forms/formTitle.xhtml" />

<a4j:form ajaxSubmit="true">
<c:forEach items="#{form.fields}" var="field">
<h:panelGrid columns="2" columnClasses="leftColumn,rightColumn">
<ui:include src="#{field.view}" />
</h:panelGrid>
</c:forEach>
<h:panelGrid columns="2" columnClasses="leftColumn,rightColumn">
<c:forEach items="#{form.fields}" var="field">
<ui:include src="#{field.view}" />
</c:forEach>
</h:panelGrid>
</a4j:form>

<a4j:form ajaxSubmit="true" rendered="#{! form.molecules.isEmpty()}">
Expand Down
Loading

0 comments on commit 0d2214f

Please sign in to comment.