Skip to content

Commit

Permalink
cleaned out and fixed some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandunn committed Dec 18, 2019
1 parent 4b03225 commit 681786e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 91 deletions.
83 changes: 0 additions & 83 deletions src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ interface AnnotatorPanelUiBinder extends UiBinder<com.google.gwt.user.client.ui.
DockLayoutPanel splitPanel;
@UiField
Container northPanelContainer;
// @UiField
// static Button gotoAnnotation;
// @UiField
// static Button deleteAnnotation;
@UiField
Button toggleAnnotation;
@UiField
Expand Down Expand Up @@ -791,16 +787,12 @@ public void onSelectionChange(SelectionChangeEvent event) {
dbXrefPanel.updateData(selectedAnnotationInfo);
commentPanel.updateData(selectedAnnotationInfo);
attributePanel.updateData(selectedAnnotationInfo);
// gotoAnnotation.setEnabled(true);
// deleteAnnotation.setEnabled(true);
} else {
exonDetailPanel.updateData();
goPanel.updateData();
dbXrefPanel.updateData();
commentPanel.updateData();
attributePanel.updateData();
// gotoAnnotation.setEnabled(false);
// deleteAnnotation.setEnabled(false);
}
}
});
Expand Down Expand Up @@ -862,14 +854,6 @@ public void setShowAllSequences(ClickEvent clickEvent) {
reload();
}

// @UiHandler("gotoAnnotation")
// void gotoAnnotation(ClickEvent clickEvent) {
// Integer min = selectedAnnotationInfo.getMin() - 50;
// Integer max = selectedAnnotationInfo.getMax() + 50;
// min = min < 0 ? 0 : min;
// MainPanel.updateGenomicViewerForLocation(selectedAnnotationInfo.getSequence(), min, max, false, false);
// }


private void handleDetails() {
if (showDetails) {
Expand All @@ -889,71 +873,6 @@ void toggleAnnotation(ClickEvent clickEvent) {
handleDetails();
}

// @UiHandler("deleteAnnotation")
// void deleteAnnotation(ClickEvent clickEvent) {
// final Set<AnnotationInfo> deletableChildren = getDeletableChildren(selectedAnnotationInfo);
// String confirmString = "";
// if (deletableChildren.size() > 0) {
// confirmString = "Delete the " + deletableChildren.size() + " annotation" + (deletableChildren.size() > 1 ? "s" : "") + " belonging to the " + selectedAnnotationInfo.getType() + " " + selectedAnnotationInfo.getName() + "?";
// } else {
// confirmString = "Delete the " + selectedAnnotationInfo.getType() + " " + selectedAnnotationInfo.getName() + "?";
// }
//
//
// final RequestCallback requestCallback = new RequestCallback() {
// @Override
// public void onResponseReceived(Request request, Response response) {
// if (response.getStatusCode() == 200) {
// // parse to make sure we return the complete amount
// try {
// JSONValue returnValue = JSONParser.parseStrict(response.getText());
// GWT.log("Return: "+returnValue.toString());
// Bootbox.confirm("Success. Reload page to reflect results?", new ConfirmCallback() {
// @Override
// public void callback(boolean result) {
// if(result){
// Window.Location.reload();
// }
// }
// });
// } catch (Exception e) {
// Bootbox.alert(e.getMessage());
// }
// } else {
// Bootbox.alert("Problem with deletion: " + response.getText());
// }
// }
//
// @Override
// public void onError(Request request, Throwable exception) {
// Bootbox.alert("Problem with deletion: " + exception.getMessage());
// }
// };
//
// Bootbox.confirm(confirmString, new ConfirmCallback() {
// @Override
// public void callback(boolean result) {
// if (result) {
// if (deletableChildren.size() == 0) {
// Set<AnnotationInfo> annotationInfoSet = new HashSet<>();
// annotationInfoSet.add(selectedAnnotationInfo);
// AnnotationRestService.deleteAnnotations(requestCallback, annotationInfoSet);
// } else {
// JSONObject jsonObject = AnnotationRestService.deleteAnnotations(requestCallback, deletableChildren);
// }
// }
// }
// });
// }


private Set<AnnotationInfo> getDeletableChildren(AnnotationInfo selectedAnnotationInfo) {
String type = selectedAnnotationInfo.getType();
if (type.equalsIgnoreCase(FeatureStringEnum.GENE.getValue()) || type.equalsIgnoreCase(FeatureStringEnum.PSEUDOGENE.getValue())) {
return selectedAnnotationInfo.getChildAnnotations();
}
return new HashSet<>();
}

private static AnnotationInfo getChildAnnotation(AnnotationInfo annotationInfo, String uniqueName) {
for (AnnotationInfo childAnnotation : annotationInfo.getChildAnnotations()) {
Expand All @@ -971,8 +890,6 @@ public void enableGoto(int geneIndex, String uniqueName) {
selectedAnnotationInfo = getChildAnnotation(annotationInfo, uniqueName);
exonDetailPanel.updateData(selectedAnnotationInfo);
updateAnnotationInfo(selectedAnnotationInfo);
// gotoAnnotation.setEnabled(true);
// deleteAnnotation.setEnabled(true);
selectedChildUniqueName = selectedAnnotationInfo.getUniqueName();
}

Expand Down
19 changes: 11 additions & 8 deletions src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@
display: inline;
/*margin: 5px;*/
background-color: grey;
border-radius: 10px;
padding: 5px;
width: 90px;
border-radius: 5px;
/*padding: 5px;*/
/*width: 90px;*/
padding-left: 5px;
padding-bottom: 5px;

/*border: solid black 5px;*/
}

.idCheckBox{
display: inline;
font-weight: bolder;
/*margin: 5px;*/
/*background-color: grey;*/
/*border-radius: 10px;*/
Expand Down Expand Up @@ -80,18 +83,18 @@
<gwt:north size="130">
<b:Container fluid="true" styleName="{style.northPanel}" ui:field="northPanelContainer">
<b:Row styleName="{style.rowPadding}">
<b:Column size="MD_5">
<b:Column size="MD_4">
<b:TextBox placeholder="Annotation Name"
ui:field="nameSearchBox" addStyleNames="{style.widgetBox}"/>
</b:Column>
<b:Column size="MD_1">
<b:CheckBox ui:field="uniqueNameCheckBox" styleName="{style.idCheckBox}" text="ID"/>
<b:Column size="MD_2">
<b:CheckBox ui:field="uniqueNameCheckBox" addStyleNames="{style.idCheckBox}" text="Search ID"/>
</b:Column>
<b:Column size="MD_3">
<b:ListBox ui:field="typeList" addStyleNames="{style.widgetBox}"/>
</b:Column>
<b:Column size="MD_3">
<b:CheckBox ui:field="goOnlyCheckBox" addStyleNames="{style.checkBox}" text="GO Only"/>
<b:Column size="MD_2">
<b:CheckBox ui:field="goOnlyCheckBox" addStyleNames="{style.idCheckBox}" text="GO Only"/>
</b:Column>
</b:Row>
<b:Row styleName="{style.rowPadding}">
Expand Down

0 comments on commit 681786e

Please sign in to comment.