Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
TLOI improvements (#98)
Browse files Browse the repository at this point in the history
* Added Method adapter for WINGS WIP

* Workflow bindings as table

* UI improvements

* TLOI view improvements
  • Loading branch information
hvarg authored Nov 8, 2021
1 parent 70769ca commit 67799cf
Show file tree
Hide file tree
Showing 23 changed files with 1,648 additions and 905 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;

Expand All @@ -18,7 +19,7 @@ interface Binder extends UiBinder<Widget, FileListDialog> {};
private static Binder uiBinder = GWT.create(Binder.class);

private List<String> list;
@UiField HTMLPanel listContainer;
@UiField HTMLPanel listContainer, listHeader;

public FileListDialog() {
setWidget(uiBinder.createAndBindUi(this));
Expand All @@ -32,6 +33,14 @@ public FileListDialog() {
//initialize();
}

public void setName (String name) {
setText(name);
}

public void setHeader (String header) {
listHeader.add(new HTML(header));
}

public void setFileList (List<String> filelist) {
this.list = filelist;
this.update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
overflow-y: scroll;
}
</style>
<g:HTMLPanel ui:field='listHeader'/>
<g:HTMLPanel ui:field='listContainer' styleName="file-container"/>

<div class="footer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ private String getHistoryToken(String type, String id) {

private String getNamespace(String id) {
return Config.getServerURL() + "/"+userid+"/"+domain + "/hypotheses/" + id + "#";

}

@UiHandler("helpicon")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
padding: 2px;
font-size: 13px;
min-height: 32px;
cursor: pointer;
}
.list paper-item.both-borders {
border-bottom: 1px dotted #e5e5e5;
Expand All @@ -54,9 +53,6 @@
.list paper-item iron-icon.transparent {
opacity: 0;
}
.list paper-item:not(.inherited):hover {
background-color: #f5f5f5;
}
div.padded {
padding: 10px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ private void updateTable () {
public void onBrowserEvent(Event event) {
FileListDialog dialog = new FileListDialog();
dialog.setFileList(tloi.getInputFiles());
dialog.setName("Input files:");
String header = "<b>" + tloi.getName().replaceAll("Triggered: ", "") + "</b>:";
dialog.setHeader("Inputs used for " + header);
dialog.show();
dialog.center();
}
Expand All @@ -178,30 +181,35 @@ public void onBrowserEvent(Event event) {
}
out.setInnerText(Integer.toString(nouts));

// Add list file dialog.
IronIcon iconOutputList = new IronIcon();
iconOutputList.addStyleName("inline-button");
iconOutputList.setIcon("description");
el = iconOutputList.getElement();
Event.sinkEvents(el, Event.ONCLICK);
Event.setEventListener(el, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
List<String> filtered = new ArrayList<String>();
for (String outfile: tloi.getOutputFiles()) {
if (!(outfile.contains("shiny_visualization") || outfile.contains("brain_visualization")
|| outfile.contains("pval") || outfile.contains("p_val") || outfile.contains("p_value"))) {
filtered.add(outfile);
if (nouts != 0) {
// Add list file dialog.
IronIcon iconOutputList = new IronIcon();
iconOutputList.addStyleName("inline-button");
iconOutputList.setIcon("description");
el = iconOutputList.getElement();
Event.sinkEvents(el, Event.ONCLICK);
Event.setEventListener(el, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
List<String> filtered = new ArrayList<String>();
for (String outfile: tloi.getOutputFiles()) {
if (!(outfile.contains("shiny_visualization") || outfile.contains("brain_visualization")
|| outfile.contains("pval") || outfile.contains("p_val") || outfile.contains("p_value"))) {
filtered.add(outfile);
}
}
}

FileListDialog dialog = new FileListDialog();
dialog.setFileList(filtered);
dialog.show();
dialog.center();
}
});
out.appendChild(el);
FileListDialog dialog = new FileListDialog();
dialog.setFileList(filtered);
dialog.setName("Output files:");
String header = "<b>" + tloi.getName().replaceAll("Triggered: ", "") + "</b>:";
dialog.setHeader("Outputs used for " + header);
dialog.show();
dialog.center();
}
});
out.appendChild(el);
}
} else if (curStatus == Status.FAILED) {
out.setInnerText("-");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,13 @@ void onSaveButtonClicked(ClickEvent event) {
hypothesis.setQuestion(questionFiller.getSelectedQuestion());
hypothesis.setQuestionBindings(questionFiller.getVariableBindings());
Graph graph = new Graph();
graph.setTriples(triples.getTriples());
try {
graph.setTriples(triples.getTriples());
} catch (Exception e) {
questionFiller.addSelectedHypothesis();
graph.setTriples(triples.getTriples());
}
GWT.log("AFTER");
hypothesis.setGraph(graph);

fireEvent(new HypothesisSaveEvent(hypothesis));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,67 +9,67 @@

<g:HTMLPanel>
<style>
.code {
font:12px Monaco,Consolas,"Andale Mono","DejaVu Sans Mono",monospace;
font-weight: bold;
}
.hyp-pattern {
border: 1px solid #aaa;
padding: 8px;
width: fit-content;
border-radius: 5px;
}
.paper-button-0 {
padding: 0;
min-width: 24px;
display: inline-block;
}
h4 {
margin: 10px 0 0 0;
}
.subs {
margin: 0 10px;
}
.code {
font:12px Monaco,Consolas,"Andale Mono","DejaVu Sans Mono",monospace;
font-weight: bold;
}
.hyp-pattern {
border: 1px solid #aaa;
padding: 8px;
width: fit-content;
border-radius: 5px;
}
.paper-button-0 {
padding: 0;
min-width: 24px;
display: inline-block;
}
h4 {
margin: 10px 0 0 0;
}
.subs {
margin: 0 10px;
}
</style>

<div class="vertical center-justified layout">
<div class="vertical-section">
<h4>Hypothesis description:</h4>
<div class="subs">
<paper-input label="Name" required="true"
autoValidate="true" ui:field="name" />
<paper-textarea label="Description" required="true"
autoValidate="true" ui:field="description" />
<paper-textarea label="Notes" required="true"
autoValidate="true" ui:field="notes" />
</div>
<div class="vertical center-justified layout">
<div class="vertical-section">
<h4>Hypothesis description:</h4>
<div class="subs">
<paper-input label="Name" required="true"
autoValidate="true" ui:field="name" />
<paper-textarea label="Description" required="true"
autoValidate="true" ui:field="description" />
<paper-textarea label="Notes" required="true"
autoValidate="true" ui:field="notes" />
</div>

<h4>Hypothesis question:</h4>
<div class="subs">
<q:QuestionFiller ui:field="questionFiller"></q:QuestionFiller>
<label class="small-grey">Corresponding hypothesis pattern</label>
<tr:HypothesisTripleInput ui:field="triples"/>
</div>
</div>
</div>
<div class="horizontal end-justified layout" style="padding: 10px 0px;">
<p:PaperButton ui:field="savebutton">
<iron-icon icon="save" />
Save
</p:PaperButton>
<p:PaperButton ui:field="runbutton">
<iron-icon icon="done" />
Submit hypothesis
</p:PaperButton>
</div>
<p:PaperDialog ui:field="triggerdialog">
<p:PaperDialogScrollable ui:field="dialogcontent">
</p:PaperDialogScrollable>
<div class="buttons">
<p:PaperButton attributes="dialog-dismiss">Close</p:PaperButton>
</div>
</p:PaperDialog>
<h4>Hypothesis question:</h4>
<div class="subs">
<q:QuestionFiller ui:field="questionFiller"></q:QuestionFiller>
<label class="small-grey">Corresponding hypothesis pattern</label>
<tr:HypothesisTripleInput ui:field="triples"/>
</div>
</div>
</div>
<div class="horizontal end-justified layout" style="padding: 10px 0px;">
<p:PaperButton ui:field="savebutton">
<iron-icon icon="save" />
Save
</p:PaperButton>
<p:PaperButton ui:field="runbutton">
<iron-icon icon="done" />
Submit hypothesis
</p:PaperButton>
</div>
<p:PaperDialog ui:field="triggerdialog">
<p:PaperDialogScrollable ui:field="dialogcontent">
</p:PaperDialogScrollable>
<div class="buttons">
<p:PaperButton attributes="dialog-dismiss">Close</p:PaperButton>
</div>
</p:PaperDialog>
</g:HTMLPanel>
</ui:UiBinder>
Loading

0 comments on commit 67799cf

Please sign in to comment.