Skip to content

Commit

Permalink
addedose button as part of #2538
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandunn committed Dec 3, 2020
1 parent f6b7cf1 commit 1dde567
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 10 deletions.
20 changes: 13 additions & 7 deletions src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.cellview.client.Column;
import com.google.gwt.user.cellview.client.*;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.*;
import com.google.gwt.view.client.*;
import org.bbop.apollo.gwt.client.dto.AnnotationInfo;
Expand Down Expand Up @@ -152,14 +153,12 @@ interface AnnotatorPanelUiBinder extends UiBinder<Widget, AnnotatorPanel> {
static HTML annotationDescription;
@UiField
static DockLayoutPanel annotatorDetailPanel;
@UiField
static Hyperlink closeDetailsButton;


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

static AnnotationInfo selectedAnnotationInfo;


private SingleSelectionModel<AnnotationInfo> singleSelectionModel = new SingleSelectionModel<>();
private final Set<String> showingTranscripts = new HashSet<String>();

Expand Down Expand Up @@ -524,12 +523,14 @@ AnnotationInfo getCurrentGene(){
}

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

private static void openAnnotatorDetailsPanel() {
closeDetailsButton.setVisible(true);
splitPanel.setWidgetSize(annotatorDetailPanel,460);
splitPanel.animate(200);
}
Expand Down Expand Up @@ -954,7 +955,7 @@ public void onDoubleClick(DoubleClickEvent event) {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
selectedAnnotationInfo = singleSelectionModel.getSelectedObject();
tabPanel.setVisible(showDetails && selectedAnnotationInfo != null);
tabPanel.setVisible(selectedAnnotationInfo != null);
if (selectedAnnotationInfo != null) {
exonDetailPanel.updateData(selectedAnnotationInfo);
goPanel.updateData(selectedAnnotationInfo);
Expand Down Expand Up @@ -1028,7 +1029,12 @@ public void updateStatus(ChangeEvent changeEvent){
reload();
}

@UiHandler(value = {"pageSizeSelector"})
@UiHandler(value = {"closeDetailsButton"})
public void closeDetails(ClickEvent clickEvent){
closeAnnotatorDetailsPanels();
}

@UiHandler(value = {"pageSizeSelector"})
public void changePageSize(ChangeEvent changeEvent) {
pageSize = Integer.parseInt(pageSizeSelector.getSelectedValue());
dataGrid.setPageSize(pageSize);
Expand Down Expand Up @@ -1071,7 +1077,7 @@ public void setShowAllSequences(ClickEvent clickEvent) {


private void handleDetails() {
tabPanel.setVisible(showDetails && singleSelectionModel.getSelectedObject() != null);
tabPanel.setVisible(singleSelectionModel.getSelectedObject() != null);
}

private static AnnotationInfo getChildAnnotation(AnnotationInfo annotationInfo, String uniqueName) {
Expand Down
31 changes: 28 additions & 3 deletions src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,31 @@
margin-bottom: 5px !important;
}

.closeButton{
display: inline;
/*margin-left: 20px;*/
/*padding-bottom: 15px;*/
/*margin-top: 5px !important;*/
/*margin-bottom: 5px !important;*/
}

.pageSizeSelector {
display: inline;
width: 40px;
margin-top: 5px;
}

.annotationDescription {
border-top: solid 2px gray;
border-bottom: solid 2px gray;
/*border-top: solid 2px gray;*/
/*border-bottom: solid 2px gray;*/
display: inline;
/*width: 80%;*/
/*padding-left: 10px;*/
/*padding-right: 10px;*/
/*margin-left: 10px;*/
/*margin-right: 10px;*/
/*margin: 10px;*/
margin-top: 5px;
}
</ui:style>
<gwt:SplitLayoutPanel ui:field="splitPanel">
Expand Down Expand Up @@ -169,7 +185,16 @@
<gwt:south size="450">
<gwt:DockLayoutPanel ui:field="annotatorDetailPanel">
<gwt:north size="20">
<gwt:HTML text="placeholder" ui:field="annotationDescription" visible="true" styleName="{style.annotationDescription}"/>
<b:Container fluid="true" width="100%">
<b:Row>
<b:Column size="MD_10">
<gwt:HTML text="placeholder" ui:field="annotationDescription" visible="true" styleName="{style.annotationDescription}"/>
</b:Column>
<b:Column size="MD_1">
<gwt:Hyperlink visible="false" ui:field="closeDetailsButton" addStyleNames="{style.closeButton}" text="Close(x)" title="Close panel"/>
</b:Column>
</b:Row>
</b:Container>
</gwt:north>
<gwt:center>
<gwt:TabLayoutPanel barHeight="35" ui:field="tabPanel">
Expand Down

0 comments on commit 1dde567

Please sign in to comment.