Skip to content

Commit

Permalink
Fix 2502 (#2538)
Browse files Browse the repository at this point in the history
* fixed some NPEs

* mostly works, but split pane is in the wrong place

* fixed split plane

* animated

* updated changelog

* cleand up
  • Loading branch information
nathandunn committed Dec 3, 2020
1 parent 7f89d90 commit f6b7cf1
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 34 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Infrastructure Changes
- Upgrade to [JBrowse 1.16.9](https://github.com/GMOD/jbrowse/releases/tag/1.16.9) / [2489](https://github.com/GMOD/Apollo/pull/2489).
- Fixed Python dependency for Travis for BioPython (3.7) and upgraded to Xenial [2493](https://github.com/GMOD/Apollo/pull/2493).
- Updated internal Docker Python script to add to use the [Apollo 4.2.3 library](https://pypi.org/project/apollo/).
- Shows and hide annotation detail panels on demand so list is not obscured [2538](https://github.com/GMOD/Apollo/pull/2538)


Bug Fixes
Expand Down
32 changes: 23 additions & 9 deletions src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ interface AnnotatorPanelUiBinder extends UiBinder<Widget, AnnotatorPanel> {
@UiField
ListBox userField;
@UiField
DockLayoutPanel splitPanel;
static DockLayoutPanel splitPanel;
@UiField
Container northPanelContainer;
@UiField
Expand Down Expand Up @@ -150,9 +150,11 @@ interface AnnotatorPanelUiBinder extends UiBinder<Widget, AnnotatorPanel> {
ListBox statusField;
@UiField
static HTML annotationDescription;
@UiField
static DockLayoutPanel annotatorDetailPanel;


// manage UI-state
// manage UI-state
private Boolean showDetails = true;

static AnnotationInfo selectedAnnotationInfo;
Expand Down Expand Up @@ -521,7 +523,19 @@ AnnotationInfo getCurrentGene(){
return geneDetailPanel.getInternalAnnotationInfo();
}

void selectTranscriptPanel() {
private static void closeAnnotatorDetailsPanels() {
annotationDescription.setHTML("No annotation selected");
splitPanel.setWidgetSize(annotatorDetailPanel,20);
splitPanel.animate(200);
}

private static void openAnnotatorDetailsPanel() {
splitPanel.setWidgetSize(annotatorDetailPanel,460);
splitPanel.animate(200);
}


void selectTranscriptPanel() {
AnnotationInfo selectedObject = singleSelectionModel.getSelectedObject();
updateAnnotationInfo(selectedObject);
tabPanel.selectTab(0);
Expand Down Expand Up @@ -635,11 +649,11 @@ private static void updateAnnotationInfo(AnnotationInfo annotationInfo) {
}

if (annotationInfo == null) {
annotationDescription.setHTML("nothing selected");
annotationDescription.setHTML("Nothing selected");
return;
}
String type = annotationInfo.getType();
hideDetailPanels();
// hideDetailPanels();
switch (type) {
case "gene":
case "pseudogene":
Expand Down Expand Up @@ -784,12 +798,12 @@ private static void updateAnnotationInfo(AnnotationInfo annotationInfo) {

private static void setAnnotationDescription(AnnotationInfo annotationInfo) {
if(annotationInfo!=null){
annotationDescription.setVisible(true);
annotationDescription.setHTML("&nbsp;&nbsp;&nbsp;&nbsp;<b>"+annotationInfo.getType() + "</b>: " + annotationInfo.getName() +"");
openAnnotatorDetailsPanel();
}
else{
annotationDescription.setVisible(false);
annotationDescription.setHTML("");
annotationDescription.setHTML("&nbsp;&nbsp;&nbsp;&nbsp;No annotation selected");
closeAnnotatorDetailsPanels();
}
}

Expand Down Expand Up @@ -988,7 +1002,7 @@ public void reload(Boolean forceReload) {
showAllSequences.setType(ButtonType.DEFAULT);
if (MainPanel.annotatorPanel.isVisible() || forceReload) {
setAnnotationDescription(null);
hideDetailPanels();
// hideDetailPanels();
pager.setPageStart(0);
dataGrid.setVisibleRangeAndClearData(dataGrid.getVisibleRange(), true);
}
Expand Down
8 changes: 4 additions & 4 deletions src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
border-bottom: solid 2px gray;
}
</ui:style>
<gwt:DockLayoutPanel ui:field="splitPanel">
<gwt:SplitLayoutPanel ui:field="splitPanel">
<gwt:north size="140">
<b:Container fluid="true" styleName="{style.northPanel}" ui:field="northPanelContainer">
<b:Row>
Expand Down Expand Up @@ -167,9 +167,9 @@
</gwt:DockLayoutPanel>
</gwt:center>
<gwt:south size="450">
<gwt:DockLayoutPanel>
<gwt:DockLayoutPanel ui:field="annotatorDetailPanel">
<gwt:north size="20">
<gwt:HTML text="placeholder" ui:field="annotationDescription" visible="false" styleName="{style.annotationDescription}"/>
<gwt:HTML text="placeholder" ui:field="annotationDescription" visible="true" styleName="{style.annotationDescription}"/>
</gwt:north>
<gwt:center>
<gwt:TabLayoutPanel barHeight="35" ui:field="tabPanel">
Expand Down Expand Up @@ -228,5 +228,5 @@
</gwt:center>
</gwt:DockLayoutPanel>
</gwt:south>
</gwt:DockLayoutPanel>
</gwt:SplitLayoutPanel>
</ui:UiBinder>
38 changes: 20 additions & 18 deletions src/gwt/org/bbop/apollo/gwt/client/AttributePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ interface AttributePanelUiBinder extends UiBinder<Widget, AttributePanel> {
@UiField
ListBox cannedValueSelectorBox;

private AnnotationInfo internalAnnotationInfo = null;
private AnnotationInfo annotationInfo = null;
private AttributeInfo internalAttributeInfo = null;
private String oldTag, oldValue;
private String tag, value;
Expand Down Expand Up @@ -219,15 +219,17 @@ public int compare(AttributeInfo o1, AttributeInfo o2) {
ColumnSortEvent.fire(dataGrid, dataGrid.getColumnSortList());
}

public void updateData(AnnotationInfo annotationInfo) {
if(!annotationInfo.equals(this.internalAnnotationInfo)){
this.internalAnnotationInfo = annotationInfo;
loadData();
}
public void updateData(AnnotationInfo selectedAnnotationInfo) {
if((selectedAnnotationInfo==null && this.annotationInfo!=null) ||
(selectedAnnotationInfo!=null && this.annotationInfo==null) ||
selectedAnnotationInfo!=null && !selectedAnnotationInfo.equals(this.annotationInfo)){
this.annotationInfo = selectedAnnotationInfo;
loadData();
}
}

public void updateData() {
updateData(null);
public void updateData() {
updateData(null);
}

public void selectAttributeData(AttributeInfo v) {
Expand Down Expand Up @@ -286,7 +288,7 @@ public void onError(Request request, Throwable exception) {


private AnnotationInfo getInternalAnnotation(){
return this.internalAnnotationInfo;
return this.annotationInfo;
}

public void updateAttribute() {
Expand All @@ -309,7 +311,7 @@ public void onError(Request request, Throwable exception) {
redrawTable();
}
};
AttributeRestService.updateAttribute(requestCallBack, this.internalAnnotationInfo, new AttributeInfo(this.oldTag, this.oldValue), newAttributeInfo);
AttributeRestService.updateAttribute(requestCallBack, this.annotationInfo, new AttributeInfo(this.oldTag, this.oldValue), newAttributeInfo);
;
} else {
resetTags();
Expand All @@ -319,7 +321,7 @@ public void onError(Request request, Throwable exception) {
private void resetTags() {
this.tag = this.oldTag;
this.value = this.oldValue;
updateData(this.internalAnnotationInfo);
updateData(this.annotationInfo);
redrawTable();
}

Expand Down Expand Up @@ -356,7 +358,7 @@ private void collectTags() {

@UiHandler("addAttributeButton")
public void addAttributeButton(ClickEvent ce) {
final AnnotationInfo internalAnnotationInfo = this.internalAnnotationInfo;
final AnnotationInfo internalAnnotationInfo = this.annotationInfo;
if (validateTags()) {
final AttributeInfo newAttributeInfo = new AttributeInfo(this.tag.toLowerCase(), this.value);
this.tagInputBox.clear();
Expand All @@ -380,13 +382,13 @@ public void onError(Request request, Throwable exception) {
redrawTable();
}
};
AttributeRestService.addAttribute(requestCallBack, this.internalAnnotationInfo, newAttributeInfo);
AttributeRestService.addAttribute(requestCallBack, this.annotationInfo, newAttributeInfo);
}
}

@UiHandler("deleteAttributeButton")
public void deleteAttribute(ClickEvent ce) {
final AnnotationInfo internalAnnotationInfo = this.internalAnnotationInfo;
final AnnotationInfo internalAnnotationInfo = this.annotationInfo;

if (internalAttributeInfo != null) {
RequestCallback requestCallBack = new RequestCallback() {
Expand All @@ -405,7 +407,7 @@ public void onError(Request request, Throwable exception) {
redrawTable();
}
};
AttributeRestService.deleteAttribute(requestCallBack, this.internalAnnotationInfo, this.internalAttributeInfo);
AttributeRestService.deleteAttribute(requestCallBack, this.annotationInfo, this.internalAttributeInfo);
;
}
}
Expand Down Expand Up @@ -438,8 +440,8 @@ public void onError(Request request, Throwable exception) {
Bootbox.alert("A problem with request: " + request.toString() + " " + exception.getMessage());
}
};
if (this.internalAnnotationInfo != null) {
AttributeRestService.getAttributes(requestCallback, this.internalAnnotationInfo,MainPanel.getInstance().getCurrentOrganism());
if (this.annotationInfo != null) {
AttributeRestService.getAttributes(requestCallback, this.annotationInfo,MainPanel.getInstance().getCurrentOrganism());
}
}

Expand All @@ -450,4 +452,4 @@ public void setEditable(boolean editable) {
valueInputBox.setEnabled(editable);
tagInputBox.setEnabled(editable);
}
}
}
4 changes: 3 additions & 1 deletion src/gwt/org/bbop/apollo/gwt/client/GeneProductPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ public void updateData() {
}

public void updateData(AnnotationInfo selectedAnnotationInfo) {
if(!selectedAnnotationInfo.equals(this.annotationInfo)){
if((selectedAnnotationInfo==null && this.annotationInfo!=null) ||
(selectedAnnotationInfo!=null && this.annotationInfo==null) ||
selectedAnnotationInfo!=null && !selectedAnnotationInfo.equals(this.annotationInfo)){
this.annotationInfo = selectedAnnotationInfo;
loadData();
}
Expand Down
4 changes: 3 additions & 1 deletion src/gwt/org/bbop/apollo/gwt/client/GoPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,9 @@ public void updateData() {
}

public void updateData(AnnotationInfo selectedAnnotationInfo) {
if(!selectedAnnotationInfo.equals(this.annotationInfo)){
if((selectedAnnotationInfo==null && this.annotationInfo!=null) ||
(selectedAnnotationInfo!=null && this.annotationInfo==null) ||
selectedAnnotationInfo!=null && !selectedAnnotationInfo.equals(this.annotationInfo)){
this.annotationInfo = selectedAnnotationInfo;
loadData();
}
Expand Down
4 changes: 3 additions & 1 deletion src/gwt/org/bbop/apollo/gwt/client/ProvenancePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,9 @@ public void updateData() {
}

public void updateData(AnnotationInfo selectedAnnotationInfo) {
if(!selectedAnnotationInfo.equals(this.annotationInfo)){
if((selectedAnnotationInfo==null && this.annotationInfo!=null) ||
(selectedAnnotationInfo!=null && this.annotationInfo==null) ||
selectedAnnotationInfo!=null && !selectedAnnotationInfo.equals(this.annotationInfo)){
this.annotationInfo = selectedAnnotationInfo;
loadData();
}
Expand Down

0 comments on commit f6b7cf1

Please sign in to comment.